mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
1.21.5 (#470)
--------- Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com> Co-authored-by: Fortern <blueten.ki@gmail.com> Co-authored-by: MC_XiaoHei <xor7xiaohei@gmail.com> Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com> Co-authored-by: MC_XiaoHei <xiaohei.xor7@outlook.com>
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
java-version: "21"
|
java-version: "21"
|
||||||
distribution: "zulu"
|
distribution: "zulu"
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/actions/setup-gradle@v3
|
uses: gradle/actions/setup-gradle@v4
|
||||||
with:
|
with:
|
||||||
add-job-summary: never
|
add-job-summary: never
|
||||||
generate-job-summary: false
|
generate-job-summary: false
|
||||||
|
|||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
java-version: "21"
|
java-version: "21"
|
||||||
distribution: "zulu"
|
distribution: "zulu"
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/actions/setup-gradle@v3
|
uses: gradle/actions/setup-gradle@v4
|
||||||
with:
|
with:
|
||||||
add-job-summary: never
|
add-job-summary: never
|
||||||
generate-job-summary: false
|
generate-job-summary: false
|
||||||
|
|||||||
@@ -16,4 +16,5 @@ should submit a pull request to this project to add their name.
|
|||||||
|
|
||||||
```text
|
```text
|
||||||
LittleChest <hiya@littlew.top>
|
LittleChest <hiya@littlew.top>
|
||||||
|
Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ maven {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("org.leavesmc.leaves:leaves-api:1.21.4-R0.1-SNAPSHOT")
|
compileOnly("org.leavesmc.leaves:leaves-api:1.21.5-R0.1-SNAPSHOT")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ Each time you want to update your dependency, you must re-build Leaves.
|
|||||||
Leaves-Server:
|
Leaves-Server:
|
||||||
```kotlin
|
```kotlin
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("org.leavesmc.leaves:leaves:1.21.4-R0.1-SNAPSHOT")
|
compileOnly("org.leavesmc.leaves:leaves:1.21.5-R0.1-SNAPSHOT")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ maven {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("org.leavesmc.leaves:leaves-api:1.21.4-R0.1-SNAPSHOT")
|
compileOnly("org.leavesmc.leaves:leaves-api:1.21.5-R0.1-SNAPSHOT")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ dependencies {
|
|||||||
Leaves-Server:
|
Leaves-Server:
|
||||||
```kotlin
|
```kotlin
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("org.leavesmc.leaves:leaves:1.21.4-R0.1-SNAPSHOT")
|
compileOnly("org.leavesmc.leaves:leaves:1.21.5-R0.1-SNAPSHOT")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
group=org.leavesmc.leaves
|
group=org.leavesmc.leaves
|
||||||
version=1.21.4-R0.1-SNAPSHOT
|
version=1.21.5-R0.1-SNAPSHOT
|
||||||
mcVersion=1.21.4
|
mcVersion=1.21.5
|
||||||
paperRef=9b1798d6438107fdf0d5939b79a8cf71f4d16e2c
|
paperRef=2ba1675c7506cadd8a540ea452e5dafb79ae8947
|
||||||
preVersion=false
|
preVersion=true
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
--- a/paper-api/build.gradle.kts
|
--- a/paper-api/build.gradle.kts
|
||||||
+++ b/paper-api/build.gradle.kts
|
+++ b/paper-api/build.gradle.kts
|
||||||
@@ -93,19 +_,33 @@
|
@@ -90,19 +_,33 @@
|
||||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||||
}
|
}
|
||||||
|
|
||||||
-val generatedApiPath: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
|
-val generatedDir: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
|
||||||
+val generatedApiPath: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.toPath() // Leaves - build change
|
+val generatedDir: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.toPath() // Leaves - build change
|
||||||
idea {
|
idea {
|
||||||
module {
|
module {
|
||||||
generatedSourceDirs.add(generatedApiPath.toFile())
|
generatedSourceDirs.add(generatedDir.toFile())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+// Leaves start - build change
|
+// Leaves start - build change
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
java {
|
||||||
srcDir(generatedApiPath)
|
srcDir(generatedDir)
|
||||||
+ srcDir(file("../paper-api/src/main/java"))
|
+ srcDir(file("../paper-api/src/main/java"))
|
||||||
+ }
|
+ }
|
||||||
+ resources {
|
+ resources {
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
val outgoingVariants = arrayOf("runtimeElements", "apiElements", "sourcesElements", "javadocElements")
|
val outgoingVariants = arrayOf("runtimeElements", "apiElements", "sourcesElements", "javadocElements")
|
||||||
val mainCapability = "${project.group}:${project.name}:${project.version}"
|
val mainCapability = "${project.group}:${project.name}:${project.version}"
|
||||||
@@ -150,6 +_,16 @@
|
@@ -147,6 +_,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
tasks.jar {
|
tasks.jar {
|
||||||
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
|
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
|
||||||
into("META-INF/maven/${project.group}/${project.name}")
|
into("META-INF/maven/${project.group}/${project.name}")
|
||||||
@@ -169,7 +_,7 @@
|
@@ -166,7 +_,7 @@
|
||||||
|
|
||||||
tasks.withType<Javadoc> {
|
tasks.withType<Javadoc> {
|
||||||
val options = options as StandardJavadocDocletOptions
|
val options = options as StandardJavadocDocletOptions
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
options.use()
|
options.use()
|
||||||
options.isDocFilesSubDirs = true
|
options.isDocFilesSubDirs = true
|
||||||
options.links(
|
options.links(
|
||||||
@@ -202,16 +_,18 @@
|
@@ -199,16 +_,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// workaround for https://github.com/gradle/gradle/issues/4046
|
// workaround for https://github.com/gradle/gradle/issues/4046
|
||||||
|
|||||||
@@ -730,7 +730,7 @@ index 199789d56d22fcb1b77ebd56805cc28aa5a5ab0a..00000000000000000000000000000000
|
|||||||
-}
|
-}
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
|
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
|
||||||
deleted file mode 100644
|
deleted file mode 100644
|
||||||
index 6f6eb1a2e6c8d49014a7ae44540ee282bae5200e..0000000000000000000000000000000000000000
|
index c8287776ad585d04fb4fa3290cd73d7097035ea0..0000000000000000000000000000000000000000
|
||||||
--- a/src/main/java/co/aikar/timings/TimingHistory.java
|
--- a/src/main/java/co/aikar/timings/TimingHistory.java
|
||||||
+++ /dev/null
|
+++ /dev/null
|
||||||
@@ -1,357 +0,0 @@
|
@@ -1,357 +0,0 @@
|
||||||
@@ -1743,7 +1743,7 @@ index b83e5ff7ada8771fdf27ba9807c77ba6a4ce12da..00000000000000000000000000000000
|
|||||||
-}
|
-}
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java
|
diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java
|
||||||
deleted file mode 100644
|
deleted file mode 100644
|
||||||
index e72ad05abada04426e32a73d02b21cb69079d268..0000000000000000000000000000000000000000
|
index 83a70358e9b7d3d9ae76cf130915b3c33d09a793..0000000000000000000000000000000000000000
|
||||||
--- a/src/main/java/co/aikar/timings/TimingsManager.java
|
--- a/src/main/java/co/aikar/timings/TimingsManager.java
|
||||||
+++ /dev/null
|
+++ /dev/null
|
||||||
@@ -1,192 +0,0 @@
|
@@ -1,192 +0,0 @@
|
||||||
@@ -2141,10 +2141,10 @@ index dae84243804b4b076cafb3e1b29bdcf614efc93f..00000000000000000000000000000000
|
|||||||
-}
|
-}
|
||||||
diff --git a/src/main/java/co/aikar/util/JSONUtil.java b/src/main/java/co/aikar/util/JSONUtil.java
|
diff --git a/src/main/java/co/aikar/util/JSONUtil.java b/src/main/java/co/aikar/util/JSONUtil.java
|
||||||
deleted file mode 100644
|
deleted file mode 100644
|
||||||
index c105a1429ca58b37be265708ec345e00f0d43ed8..0000000000000000000000000000000000000000
|
index 232bf09e1a7bc176bfd34b1acb5326a06a92fe79..0000000000000000000000000000000000000000
|
||||||
--- a/src/main/java/co/aikar/util/JSONUtil.java
|
--- a/src/main/java/co/aikar/util/JSONUtil.java
|
||||||
+++ /dev/null
|
+++ /dev/null
|
||||||
@@ -1,141 +0,0 @@
|
@@ -1,138 +0,0 @@
|
||||||
-package co.aikar.util;
|
-package co.aikar.util;
|
||||||
-
|
-
|
||||||
-import com.google.common.base.Function;
|
-import com.google.common.base.Function;
|
||||||
@@ -2152,10 +2152,7 @@ index c105a1429ca58b37be265708ec345e00f0d43ed8..00000000000000000000000000000000
|
|||||||
-import com.google.common.collect.Maps;
|
-import com.google.common.collect.Maps;
|
||||||
-import org.jetbrains.annotations.NotNull;
|
-import org.jetbrains.annotations.NotNull;
|
||||||
-import org.jetbrains.annotations.Nullable;
|
-import org.jetbrains.annotations.Nullable;
|
||||||
-import org.json.simple.JSONArray;
|
|
||||||
-import org.json.simple.JSONObject;
|
|
||||||
-
|
-
|
||||||
-import java.util.ArrayList;
|
|
||||||
-import java.util.LinkedHashMap;
|
-import java.util.LinkedHashMap;
|
||||||
-import java.util.List;
|
-import java.util.List;
|
||||||
-import java.util.Map;
|
-import java.util.Map;
|
||||||
@@ -2863,10 +2860,10 @@ index 3e61a926620a67daec3af54b72a1b911eaef2ed4..00000000000000000000000000000000
|
|||||||
- }
|
- }
|
||||||
-}
|
-}
|
||||||
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
|
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
|
||||||
index 71eb845a4d3b8b6ec3b816a0f20ec807e0f9a86d..a43419c23aa0f6fd809caf5a841cb138f350b7ba 100644
|
index 27a7c69f23084e821d945d5e97e51a94ddd94e58..d645ee8470a2dd9f7b8eff2b7ff2211aba9c342f 100644
|
||||||
--- a/src/main/java/org/bukkit/command/Command.java
|
--- a/src/main/java/org/bukkit/command/Command.java
|
||||||
+++ b/src/main/java/org/bukkit/command/Command.java
|
+++ b/src/main/java/org/bukkit/command/Command.java
|
||||||
@@ -33,16 +33,6 @@ public abstract class Command {
|
@@ -32,16 +32,6 @@ public abstract class Command {
|
||||||
protected String usageMessage;
|
protected String usageMessage;
|
||||||
private String permission;
|
private String permission;
|
||||||
private net.kyori.adventure.text.Component permissionMessage; // Paper
|
private net.kyori.adventure.text.Component permissionMessage; // Paper
|
||||||
@@ -2884,10 +2881,10 @@ index 71eb845a4d3b8b6ec3b816a0f20ec807e0f9a86d..a43419c23aa0f6fd809caf5a841cb138
|
|||||||
protected Command(@NotNull String name) {
|
protected Command(@NotNull String name) {
|
||||||
this(name, "", "/" + name, new ArrayList<String>());
|
this(name, "", "/" + name, new ArrayList<String>());
|
||||||
diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
||||||
index abe256e1e45ce28036da4aa1586715bc8a1a3414..9eab8024e0675865f17669847759a26d28f74f3a 100644
|
index 59fada9b1eb78238d280c6bbb711f52facba52c6..eb4d78c6111a530d015a0b91d14c40ad0eec9ca7 100644
|
||||||
--- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
--- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
||||||
+++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
+++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
||||||
@@ -12,7 +12,6 @@ public class FormattedCommandAlias extends Command {
|
@@ -14,7 +14,6 @@ public class FormattedCommandAlias extends Command {
|
||||||
|
|
||||||
public FormattedCommandAlias(@NotNull String alias, @NotNull String[] formatStrings) {
|
public FormattedCommandAlias(@NotNull String alias, @NotNull String[] formatStrings) {
|
||||||
super(alias);
|
super(alias);
|
||||||
@@ -2895,7 +2892,7 @@ index abe256e1e45ce28036da4aa1586715bc8a1a3414..9eab8024e0675865f17669847759a26d
|
|||||||
this.formatStrings = formatStrings;
|
this.formatStrings = formatStrings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,10 +119,6 @@ public class FormattedCommandAlias extends Command {
|
@@ -122,10 +121,6 @@ public class FormattedCommandAlias extends Command {
|
||||||
return formatString.trim(); // Paper - Causes an extra space at the end, breaks with brig commands
|
return formatString.trim(); // Paper - Causes an extra space at the end, breaks with brig commands
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2907,18 +2904,18 @@ index abe256e1e45ce28036da4aa1586715bc8a1a3414..9eab8024e0675865f17669847759a26d
|
|||||||
return i >= j && i <= k;
|
return i >= j && i <= k;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||||
index 5df19bd701c67506689fc7f49d91f99ebfbc83f0..940565704d0e8914a76cf25daf7d1f5ecd99bad4 100644
|
index 4acda947b7d69ab4133b4cc94e76d945e4d148d5..d356f1895e8f3fae14bbbe1f60e589af3856b9ec 100644
|
||||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||||
@@ -39,7 +39,6 @@ public class SimpleCommandMap implements CommandMap {
|
@@ -32,7 +32,6 @@ public class SimpleCommandMap implements CommandMap {
|
||||||
register("bukkit", new VersionCommand("version"));
|
|
||||||
|
private void setDefaultCommands() {
|
||||||
register("bukkit", new ReloadCommand("reload"));
|
register("bukkit", new ReloadCommand("reload"));
|
||||||
//register("bukkit", new PluginsCommand("plugins")); // Paper
|
- register("bukkit", new co.aikar.timings.TimingsCommand("timings"));
|
||||||
- register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Paper
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFallbackCommands() {
|
public void setFallbackCommands() {
|
||||||
@@ -71,7 +70,6 @@ public class SimpleCommandMap implements CommandMap {
|
@@ -64,7 +63,6 @@ public class SimpleCommandMap implements CommandMap {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) {
|
public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) {
|
||||||
@@ -2926,7 +2923,7 @@ index 5df19bd701c67506689fc7f49d91f99ebfbc83f0..940565704d0e8914a76cf25daf7d1f5e
|
|||||||
label = label.toLowerCase(Locale.ROOT).trim();
|
label = label.toLowerCase(Locale.ROOT).trim();
|
||||||
fallbackPrefix = fallbackPrefix.toLowerCase(Locale.ROOT).trim();
|
fallbackPrefix = fallbackPrefix.toLowerCase(Locale.ROOT).trim();
|
||||||
boolean registered = register(label, command, false, fallbackPrefix);
|
boolean registered = register(label, command, false, fallbackPrefix);
|
||||||
@@ -153,17 +151,9 @@ public class SimpleCommandMap implements CommandMap {
|
@@ -146,17 +144,9 @@ public class SimpleCommandMap implements CommandMap {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2977,35 +2974,45 @@ index 001465eedafa51ac027a4db51cba6223edfe1171..dd98b4886d21ac92d9f9139450258754
|
|||||||
|
|
||||||
// Paper start
|
// Paper start
|
||||||
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||||
index b412aaf08901d169ac9fc89b36f9d6ccb95c53d3..b2257f3e51a754b7d3d946b434745f22e3305b0a 100644
|
index 163e9a0e179dc88be93614ff66ee2be3eccc694f..f4f1a51a3b0c34b87270ba81b705a8ee5d615f8a 100644
|
||||||
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||||
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||||
@@ -43,7 +43,6 @@ import org.bukkit.plugin.TimedRegisteredListener;
|
@@ -290,22 +290,22 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||||
import org.bukkit.plugin.UnknownDependencyException;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
-import org.spigotmc.CustomTimingsHandler; // Spigot
|
|
||||||
import org.yaml.snakeyaml.error.YAMLException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -293,7 +292,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Paper
|
- EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Paper
|
||||||
+ EventExecutor executor = new EventExecutor() { // Paper
|
- @Override
|
||||||
@Override
|
- public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { // Paper
|
||||||
public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { // Paper
|
- try {
|
||||||
try {
|
- if (!eventClass.isAssignableFrom(event.getClass())) {
|
||||||
@@ -307,7 +306,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
- return;
|
||||||
throw new EventException(t);
|
- }
|
||||||
|
- method.invoke(listener, event);
|
||||||
|
- } catch (InvocationTargetException ex) {
|
||||||
|
- throw new EventException(ex.getCause());
|
||||||
|
- } catch (Throwable t) {
|
||||||
|
- throw new EventException(t);
|
||||||
|
+ // Leaves start - Delete timings
|
||||||
|
+ // Paper
|
||||||
|
+ EventExecutor executor = (listener1, event) -> { // Paper
|
||||||
|
+ try {
|
||||||
|
+ if (!eventClass.isAssignableFrom(event.getClass())) {
|
||||||
|
+ return;
|
||||||
}
|
}
|
||||||
|
+ method.invoke(listener1, event);
|
||||||
|
+ } catch (java.lang.reflect.InvocationTargetException ex) {
|
||||||
|
+ throw new org.bukkit.event.EventException(ex.getCause());
|
||||||
|
+ } catch (Throwable t) {
|
||||||
|
+ throw new org.bukkit.event.EventException(t);
|
||||||
}
|
}
|
||||||
- }, plugin, method, eventClass); // Paper
|
- }, plugin, method, eventClass); // Paper
|
||||||
+ }; // Paper
|
+ }; // Paper
|
||||||
if (false) { // Spigot - RL handles useTimings check now
|
eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
|
||||||
eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
|
+ // Leaves end - Delete timings
|
||||||
} else {
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
||||||
deleted file mode 100644
|
deleted file mode 100644
|
||||||
index 5fbacfcf108432c5187aa9a4092d00d7d5b0fd53..0000000000000000000000000000000000000000
|
index 5fbacfcf108432c5187aa9a4092d00d7d5b0fd53..0000000000000000000000000000000000000000
|
||||||
|
|||||||
@@ -5,38 +5,38 @@ Subject: [PATCH] Add isShrink to EntityResurrectEvent
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java b/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
|
diff --git a/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java b/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
|
||||||
index 2a7426c157f6a06f2491d95d67df95a0fb809926..8fe7d559ad6cbb8f15584c202067250dd55a8ede 100644
|
index fa60c0ce5c79757952ad39932e1c5fac8b068811..71fd070aaebfd9fa0fbfd6eb7cd26c8b34120203 100644
|
||||||
--- a/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
|
--- a/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
|
+++ b/src/main/java/org/bukkit/event/entity/EntityResurrectEvent.java
|
||||||
@@ -16,20 +16,44 @@ import org.jetbrains.annotations.Nullable;
|
@@ -17,22 +17,46 @@ public class EntityResurrectEvent extends EntityEvent implements Cancellable {
|
||||||
public class EntityResurrectEvent extends EntityEvent implements Cancellable {
|
|
||||||
|
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
- //
|
|
||||||
+
|
- private final EquipmentSlot hand;
|
||||||
|
-
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
+ private boolean shrink;
|
+ private boolean shrink;
|
||||||
|
+
|
||||||
private final EquipmentSlot hand;
|
+ private final EquipmentSlot hand;
|
||||||
|
|
||||||
@ApiStatus.Internal
|
@ApiStatus.Internal
|
||||||
- public EntityResurrectEvent(@NotNull LivingEntity what, @Nullable EquipmentSlot hand) {
|
- public EntityResurrectEvent(@NotNull LivingEntity livingEntity, @Nullable EquipmentSlot hand) {
|
||||||
+ public EntityResurrectEvent(@NotNull LivingEntity what, @Nullable EquipmentSlot hand, boolean shrink) {
|
+ public EntityResurrectEvent(@NotNull LivingEntity livingEntity, @Nullable EquipmentSlot hand, boolean shrink) {
|
||||||
super(what);
|
super(livingEntity);
|
||||||
+ this.shrink = shrink;
|
+ this.shrink = shrink;
|
||||||
this.hand = hand;
|
this.hand = hand;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ public EntityResurrectEvent(@NotNull LivingEntity what, @Nullable EquipmentSlot hand) {
|
+ public EntityResurrectEvent(@NotNull LivingEntity livingEntity, @Nullable EquipmentSlot hand) {
|
||||||
+ this(what, hand, true);
|
+ this(livingEntity, hand, true);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ApiStatus.Internal
|
||||||
@Deprecated(since = "1.19.2", forRemoval = true)
|
@Deprecated(since = "1.19.2", forRemoval = true)
|
||||||
public EntityResurrectEvent(@NotNull LivingEntity what) {
|
public EntityResurrectEvent(@NotNull LivingEntity livingEntity) {
|
||||||
- this(what, null);
|
this(livingEntity, null);
|
||||||
+ this(what, null, true);
|
}
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
+ /**
|
||||||
+ * Get is shrink item
|
+ * Get is shrink item
|
||||||
+ *
|
+ *
|
||||||
@@ -53,6 +53,8 @@ index 2a7426c157f6a06f2491d95d67df95a0fb809926..8fe7d559ad6cbb8f15584c202067250d
|
|||||||
+ */
|
+ */
|
||||||
+ public void setShrink(boolean shrink) {
|
+ public void setShrink(boolean shrink) {
|
||||||
+ this.shrink = shrink;
|
+ this.shrink = shrink;
|
||||||
}
|
+ }
|
||||||
|
+
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public LivingEntity getEntity() {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add fakeplayer api
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||||
index 4eb723afaca049a816d16370b383fa37441eafd4..e1c6974cfd96b406314901862c2d92ad0a4ba8f2 100644
|
index c9ea6559f809a6732588b8908001807be3d91196..fe30de1f0a7fc7112466b6eb2e5813f39259c3b6 100644
|
||||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||||
@@ -2996,4 +2996,15 @@ public final class Bukkit {
|
@@ -3007,4 +3007,15 @@ public final class Bukkit {
|
||||||
public static void restart() {
|
public static void restart() {
|
||||||
server.restart();
|
server.restart();
|
||||||
}
|
}
|
||||||
@@ -25,18 +25,10 @@ index 4eb723afaca049a816d16370b383fa37441eafd4..e1c6974cfd96b406314901862c2d92ad
|
|||||||
+ // Leaves end - Bot API
|
+ // Leaves end - Bot API
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
index 0c1f3053ecb415a6dfbbe283bae8c1f6d8477e9c..e42fa3dc7f70a5e4426564f26d471c5bfc3d57f2 100644
|
index ed899c4cb4b5261ceff56bbc9ca806e20904508e..a5370832380e93cf029588caeb8e29e03cc52db8 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
@@ -66,6 +66,7 @@ import org.jetbrains.annotations.ApiStatus;
|
@@ -2716,4 +2716,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
import org.jetbrains.annotations.Contract;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
+import org.leavesmc.leaves.entity.BotManager;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a server implementation.
|
|
||||||
@@ -2698,4 +2699,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
|
||||||
*/
|
*/
|
||||||
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
|
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
|
||||||
// Paper end - API to check if the server is sleeping
|
// Paper end - API to check if the server is sleeping
|
||||||
@@ -47,6 +39,6 @@ index 0c1f3053ecb415a6dfbbe283bae8c1f6d8477e9c..e42fa3dc7f70a5e4426564f26d471c5b
|
|||||||
+ *
|
+ *
|
||||||
+ * @return Bot Manager
|
+ * @return Bot Manager
|
||||||
+ */
|
+ */
|
||||||
+ @NotNull BotManager getBotManager();
|
+ @NotNull org.leavesmc.leaves.entity.BotManager getBotManager();
|
||||||
+ // Leaves end - Bot API
|
+ // Leaves end - Bot API
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Force peaceful mode switch
|
|||||||
|
|
||||||
|
|
||||||
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 bff01411f4b2d3ecd9e6d807c3f450d72c108323..aae996e55cfda36adcca50065e05b5ecc4129614 100644
|
index a8b64f78bf3c453094074b4b4d3c8fd07b9eb273..ed2bcc30cec91d3266c3d184b89b96bac6fb1f67 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
|
||||||
@@ -4351,6 +4351,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
@@ -4358,6 +4358,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||||
void setSendViewDistance(int viewDistance);
|
void setSendViewDistance(int viewDistance);
|
||||||
// Paper end - view distance api
|
// Paper end - view distance api
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
|
From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
|
||||||
Date: Sun, 26 Jan 2025 01:39:16 -0500
|
Date: Sat, 17 May 2025 17:36:22 +0800
|
||||||
Subject: [PATCH] Replay Mod API
|
Subject: [PATCH] Replay Mod API
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||||
index e1c6974cfd96b406314901862c2d92ad0a4ba8f2..27bd3867836744a6e10507d165215ebf8dd7da53 100644
|
index fe30de1f0a7fc7112466b6eb2e5813f39259c3b6..23f3ab31bbc9d197f9a82f4ed5003e6de814fad7 100644
|
||||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||||
@@ -3007,4 +3007,10 @@ public final class Bukkit {
|
@@ -3018,4 +3018,10 @@ public final class Bukkit {
|
||||||
return server.getBotManager();
|
return server.getBotManager();
|
||||||
}
|
}
|
||||||
// Leaves end - Bot API
|
// Leaves end - Bot API
|
||||||
@@ -20,23 +20,15 @@ index e1c6974cfd96b406314901862c2d92ad0a4ba8f2..27bd3867836744a6e10507d165215ebf
|
|||||||
+ // Leaves end - Photographer API
|
+ // Leaves end - Photographer API
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
index e42fa3dc7f70a5e4426564f26d471c5bfc3d57f2..f4f83b1534a90127a77420a1768cd4b255a04868 100644
|
index a5370832380e93cf029588caeb8e29e03cc52db8..2531e82464e54e0c1b707e7c5a62ff0fd5ed8637 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
@@ -67,6 +67,7 @@ import org.jetbrains.annotations.Contract;
|
@@ -2725,4 +2725,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
import org.leavesmc.leaves.entity.BotManager;
|
|
||||||
+import org.leavesmc.leaves.entity.PhotographerManager;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a server implementation.
|
|
||||||
@@ -2708,4 +2709,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
|
||||||
*/
|
*/
|
||||||
@NotNull BotManager getBotManager();
|
@NotNull org.leavesmc.leaves.entity.BotManager getBotManager();
|
||||||
// Leaves end - Bot API
|
// Leaves end - Bot API
|
||||||
+
|
+
|
||||||
+ // Leaves start - Photographer API
|
+ // Leaves start - Photographer API
|
||||||
+ @NotNull PhotographerManager getPhotographerManager();
|
+ @NotNull org.leavesmc.leaves.entity.PhotographerManager getPhotographerManager();
|
||||||
+ // Leaves end - Photographer API
|
+ // Leaves end - Photographer API
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Bytebuf API
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||||
index 27bd3867836744a6e10507d165215ebf8dd7da53..190e532fd3ddaf78eae3ea0ba2b4b986ab5f9540 100644
|
index 23f3ab31bbc9d197f9a82f4ed5003e6de814fad7..30488f80b98d1dba485e53601edb5cb0e23b7591 100644
|
||||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||||
@@ -3013,4 +3013,10 @@ public final class Bukkit {
|
@@ -3024,4 +3024,10 @@ public final class Bukkit {
|
||||||
return server.getPhotographerManager();
|
return server.getPhotographerManager();
|
||||||
}
|
}
|
||||||
// Leaves end - Photographer API
|
// Leaves end - Photographer API
|
||||||
@@ -20,12 +20,12 @@ index 27bd3867836744a6e10507d165215ebf8dd7da53..190e532fd3ddaf78eae3ea0ba2b4b986
|
|||||||
+ // Leaves end - Bytebuf API
|
+ // Leaves end - Bytebuf API
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
index f4f83b1534a90127a77420a1768cd4b255a04868..8d4c10d7d8b3982a960ca2cee52ce069b1916c24 100644
|
index 2531e82464e54e0c1b707e7c5a62ff0fd5ed8637..a1742e64232c949dc88deb5d6083c4bf62e6aae9 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
@@ -2713,4 +2713,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -2729,4 +2729,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
// Leaves start - Photographer API
|
// Leaves start - Photographer API
|
||||||
@NotNull PhotographerManager getPhotographerManager();
|
@NotNull org.leavesmc.leaves.entity.PhotographerManager getPhotographerManager();
|
||||||
// Leaves end - Photographer API
|
// Leaves end - Photographer API
|
||||||
+
|
+
|
||||||
+ // Leaves start - Bytebuf API
|
+ // Leaves start - Bytebuf API
|
||||||
@@ -33,10 +33,10 @@ index f4f83b1534a90127a77420a1768cd4b255a04868..8d4c10d7d8b3982a960ca2cee52ce069
|
|||||||
+ // Leaves end - Bytebuf API
|
+ // Leaves end - Bytebuf API
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||||
index 494dca2ee48a03953d47050b178496df12bc48c5..b429eb9a0326460a8841a1cfdfd6cd13c02ec2b7 100644
|
index d34419693fc78b3f7e8f6bbf115f17f29e5e3377..ab45edbc10398d92ddfcfd16d12d49f5b4e87c4c 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||||
@@ -3853,6 +3853,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
@@ -3860,6 +3860,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||||
boolean isChunkSent(long chunkKey);
|
boolean isChunkSent(long chunkKey);
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Revert raid changes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
diff --git a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
||||||
index f6218d317af4f4d83292a10abdf583fb01824232..3eb836575307116ce0668eadd6a6ee0a9aafc7cd 100644
|
index 22e14ba522510d659c191d72536cde895458d9ed..253f937dbd130fac064963b4af7572e1302fee8f 100644
|
||||||
--- a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
--- a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
+++ b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
||||||
@@ -219,9 +219,7 @@ public class EntityPotionEffectEvent extends EntityEvent implements Cancellable
|
@@ -221,9 +221,7 @@ public class EntityPotionEffectEvent extends EntityEvent implements Cancellable
|
||||||
/**
|
/**
|
||||||
* When a player gets bad omen after killing a patrol captain.
|
* When a player gets bad omen after killing a patrol captain.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -5,36 +5,40 @@ Subject: [PATCH] Fix SculkCatalyst exp skip
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
|
diff --git a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
|
||||||
index 42ffb81708b327f765ba3235fdd1ab69cd7589fd..0a7e37420f8d024ffba1fd1c52edc50c10408e6e 100644
|
index 76c08499b704a6cb0cb95ce69b9a9248d69cc127..316bbf8c95e4803190897d66a0c7d8b4316f4164 100644
|
||||||
--- a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
|
--- a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
|
+++ b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
|
||||||
@@ -25,17 +25,25 @@ public class EntityDeathEvent extends EntityEvent implements org.bukkit.event.Ca
|
@@ -28,6 +28,8 @@ public class EntityDeathEvent extends EntityEvent implements Cancellable {
|
||||||
private float deathSoundVolume;
|
private float deathSoundVolume;
|
||||||
private float deathSoundPitch;
|
private float deathSoundPitch;
|
||||||
// Paper end
|
|
||||||
+ private int rewardExp; // Leaves - exp fix
|
+ private int rewardExp; // Leaves - exp fix
|
||||||
|
+
|
||||||
|
private boolean cancelled;
|
||||||
|
|
||||||
public EntityDeathEvent(@NotNull final LivingEntity entity, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops) {
|
@ApiStatus.Internal
|
||||||
this(entity, damageSource, drops, 0);
|
@@ -37,12 +39,19 @@ public class EntityDeathEvent extends EntityEvent implements Cancellable {
|
||||||
}
|
|
||||||
|
|
||||||
public EntityDeathEvent(@NotNull final LivingEntity what, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp) {
|
@ApiStatus.Internal
|
||||||
|
public EntityDeathEvent(@NotNull final LivingEntity livingEntity, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp) {
|
||||||
+ // Leaves start - exp fix
|
+ // Leaves start - exp fix
|
||||||
+ this(what, damageSource, drops, droppedExp, droppedExp);
|
+ this(livingEntity, damageSource, drops, droppedExp, droppedExp);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public EntityDeathEvent(@NotNull final LivingEntity what, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp, final int rewardExp) {
|
+ @ApiStatus.Internal
|
||||||
super(what);
|
+ public EntityDeathEvent(@NotNull final LivingEntity livingEntity, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp, final int rewardExp) {
|
||||||
|
super(livingEntity);
|
||||||
this.damageSource = damageSource;
|
this.damageSource = damageSource;
|
||||||
this.drops = drops;
|
this.drops = drops;
|
||||||
this.dropExp = droppedExp;
|
this.dropExp = droppedExp;
|
||||||
+ this.rewardExp = rewardExp;
|
+ this.rewardExp = rewardExp;
|
||||||
}
|
}
|
||||||
|
-
|
||||||
+ // Leaves end - exp fix
|
+ // Leaves end - exp fix
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -75,6 +83,7 @@ public class EntityDeathEvent extends EntityEvent implements org.bukkit.event.Ca
|
public LivingEntity getEntity() {
|
||||||
|
@@ -81,6 +90,7 @@ public class EntityDeathEvent extends EntityEvent implements Cancellable {
|
||||||
*/
|
*/
|
||||||
public void setDroppedExp(int exp) {
|
public void setDroppedExp(int exp) {
|
||||||
this.dropExp = exp;
|
this.dropExp = exp;
|
||||||
@@ -42,11 +46,10 @@ index 42ffb81708b327f765ba3235fdd1ab69cd7589fd..0a7e37420f8d024ffba1fd1c52edc50c
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -226,4 +235,14 @@ public class EntityDeathEvent extends EntityEvent implements org.bukkit.event.Ca
|
@@ -210,6 +220,16 @@ public class EntityDeathEvent extends EntityEvent implements Cancellable {
|
||||||
this.deathSoundPitch = pitch;
|
this.deathSoundPitch = pitch;
|
||||||
}
|
}
|
||||||
// Paper end
|
|
||||||
+
|
|
||||||
+ // Leaves start - exp fix
|
+ // Leaves start - exp fix
|
||||||
+ public int getRewardExp() {
|
+ public int getRewardExp() {
|
||||||
+ return rewardExp;
|
+ return rewardExp;
|
||||||
@@ -56,26 +59,28 @@ index 42ffb81708b327f765ba3235fdd1ab69cd7589fd..0a7e37420f8d024ffba1fd1c52edc50c
|
|||||||
+ this.rewardExp = rewardExp;
|
+ this.rewardExp = rewardExp;
|
||||||
+ }
|
+ }
|
||||||
+ // Leaves end - exp fix
|
+ // Leaves end - exp fix
|
||||||
}
|
+
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return this.cancelled;
|
||||||
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||||
index ab7584873e46020148bceecbd42a43055684e6a0..7c99b1c6f5fc8e4ce442d111e7598ddb89d6ee05 100644
|
index 6316a2f1d2dc0314397e33e6dbd354fb8bc50541..16d4e3d42710be5eb87372d31c0ea9935d441de0 100644
|
||||||
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||||
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||||
@@ -18,6 +18,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
@@ -23,6 +23,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||||
|
private Component deathMessage;
|
||||||
|
private Component deathScreenMessageOverride = null;
|
||||||
|
private boolean doExpDrop;
|
||||||
|
+ private boolean useApiExpDropStatus = false; // Leaves - exp fix
|
||||||
private boolean keepLevel = false;
|
private boolean keepLevel = false;
|
||||||
private boolean keepInventory = false;
|
private boolean keepInventory = false;
|
||||||
private boolean doExpDrop; // Paper - shouldDropExperience API
|
@Deprecated
|
||||||
+ private boolean useApiExpDropStatus = false; // Leaves - exp fix
|
@@ -82,8 +83,15 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||||
// Paper start - adventure
|
this.showDeathMessages = true;
|
||||||
@org.jetbrains.annotations.ApiStatus.Internal
|
this.deathMessage = LegacyComponentSerializer.legacySection().deserializeOrNull(deathMessage);
|
||||||
public PlayerDeathEvent(final @NotNull Player player, final @NotNull DamageSource damageSource, final @NotNull List<ItemStack> drops, final int droppedExp, final @Nullable net.kyori.adventure.text.Component deathMessage) {
|
|
||||||
@@ -122,9 +123,16 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
|
||||||
*/
|
|
||||||
public void setShouldDropExperience(boolean doExpDrop) {
|
|
||||||
this.doExpDrop = doExpDrop;
|
this.doExpDrop = doExpDrop;
|
||||||
+ this.useApiExpDropStatus = true; // Leaves - exp fix
|
+ this.useApiExpDropStatus = true; // Leaves - exp fix
|
||||||
}
|
}
|
||||||
// Paper end - shouldDropExperience API
|
|
||||||
|
|
||||||
+ // Leaves start - exp fix
|
+ // Leaves start - exp fix
|
||||||
+ public boolean forceUseEventDropStatus() {
|
+ public boolean forceUseEventDropStatus() {
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
|
||||||
|
Date: Sun, 18 May 2025 19:59:11 +0800
|
||||||
|
Subject: [PATCH] Leaves Config API
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||||
|
index 30488f80b98d1dba485e53601edb5cb0e23b7591..91fa30c1713795007faef73280713a33d2518487 100644
|
||||||
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||||
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||||
|
@@ -3030,4 +3030,10 @@ public final class Bukkit {
|
||||||
|
return server.getBytebufManager();
|
||||||
|
}
|
||||||
|
// Leaves end - Bytebuf API
|
||||||
|
+
|
||||||
|
+ // Leaves start - Config API
|
||||||
|
+ public static org.leavesmc.leaves.config.LeavesConfigProvider getLeavesConfig() {
|
||||||
|
+ return server.getLeavesConfig();
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - Config API
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||||
|
index a1742e64232c949dc88deb5d6083c4bf62e6aae9..75a1917d998bf8aa0b86a67ca0f0836804fad012 100644
|
||||||
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
|
@@ -2733,4 +2733,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
|
// Leaves start - Bytebuf API
|
||||||
|
org.leavesmc.leaves.bytebuf.BytebufManager getBytebufManager();
|
||||||
|
// Leaves end - Bytebuf API
|
||||||
|
+
|
||||||
|
+ // Leaves start - Config API
|
||||||
|
+ org.leavesmc.leaves.config.LeavesConfigProvider getLeavesConfig();
|
||||||
|
+ // Leaves End - Config API
|
||||||
|
}
|
||||||
@@ -4,8 +4,8 @@ import com.google.gson.JsonElement;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface Bytebuf {
|
public interface Bytebuf {
|
||||||
|
|
||||||
@@ -103,5 +103,7 @@ public interface Bytebuf {
|
|||||||
|
|
||||||
Bytebuf copy();
|
Bytebuf copy();
|
||||||
|
|
||||||
|
void retain();
|
||||||
|
|
||||||
boolean release();
|
boolean release();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import org.leavesmc.leaves.bytebuf.packet.PacketListener;
|
|||||||
|
|
||||||
public interface BytebufManager {
|
public interface BytebufManager {
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
void registerListener(Plugin plugin, PacketListener listener);
|
void registerListener(Plugin plugin, PacketListener listener);
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
void unregisterListener(Plugin plugin, PacketListener listener);
|
void unregisterListener(Plugin plugin, PacketListener listener);
|
||||||
|
|
||||||
Bytebuf newBytebuf(int size);
|
Bytebuf newBytebuf(int size);
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ package org.leavesmc.leaves.bytebuf.packet;
|
|||||||
|
|
||||||
import org.leavesmc.leaves.bytebuf.Bytebuf;
|
import org.leavesmc.leaves.bytebuf.Bytebuf;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public record Packet(PacketType type, Bytebuf bytebuf) {
|
public record Packet(PacketType type, Bytebuf bytebuf) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.leavesmc.leaves.bytebuf.packet;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public interface PacketListener {
|
public interface PacketListener {
|
||||||
|
|
||||||
Packet onPacketIn(Player player, Packet packet);
|
Packet onPacketIn(Player player, Packet packet);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.leavesmc.leaves.bytebuf.packet;
|
package org.leavesmc.leaves.bytebuf.packet;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public enum PacketType {
|
public enum PacketType {
|
||||||
// ClientboundBundle,
|
// ClientboundBundle,
|
||||||
// ClientboundBundleDelimiter,
|
// ClientboundBundleDelimiter,
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package org.leavesmc.leaves.config;
|
||||||
|
|
||||||
|
public interface LeavesConfigProvider {
|
||||||
|
|
||||||
|
LeavesConfigValue getConfig(String configNode);
|
||||||
|
|
||||||
|
void setConfig(String configNode, LeavesConfigValue value);
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package org.leavesmc.leaves.config;
|
||||||
|
|
||||||
|
public record LeavesConfigValue(Object value) {
|
||||||
|
|
||||||
|
public int getInt() {
|
||||||
|
if (value instanceof Integer) {
|
||||||
|
return (Integer) value;
|
||||||
|
}
|
||||||
|
throw new ClassCastException("Value is not an integer");
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getDouble() {
|
||||||
|
if (value instanceof Double) {
|
||||||
|
return (Double) value;
|
||||||
|
}
|
||||||
|
throw new ClassCastException("Value is not a double");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getBoolean() {
|
||||||
|
if (value instanceof Boolean) {
|
||||||
|
return (Boolean) value;
|
||||||
|
}
|
||||||
|
throw new ClassCastException("Value is not a boolean");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getString() {
|
||||||
|
if (value instanceof String) {
|
||||||
|
return (String) value;
|
||||||
|
}
|
||||||
|
throw new ClassCastException("Value is not a string");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,31 +17,29 @@ public interface Bot extends Player {
|
|||||||
*
|
*
|
||||||
* @return fakeplayer skin name
|
* @return fakeplayer skin name
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable String getSkinName();
|
||||||
public String getSkinName();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the fakeplayer name without prefix and suffix
|
* Gets the fakeplayer name without prefix and suffix
|
||||||
*
|
*
|
||||||
* @return fakeplayer real name
|
* @return fakeplayer real name
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull String getRealName();
|
||||||
public String getRealName();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the creator's UUID of the fakeplayer
|
* Gets the creator's UUID of the fakeplayer
|
||||||
*
|
*
|
||||||
* @return creator's UUID
|
* @return creator's UUID
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable UUID getCreatePlayerUUID();
|
||||||
public UUID getCreatePlayerUUID();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an action to the fakeplayer
|
* Add an action to the fakeplayer
|
||||||
*
|
*
|
||||||
* @param action bot action
|
* @param action bot action
|
||||||
*/
|
*/
|
||||||
public void addAction(@NotNull LeavesBotAction action);
|
@org.jetbrains.annotations.ApiStatus.Experimental
|
||||||
|
void addAction(@NotNull LeavesBotAction action);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the copy action in giving index
|
* Get the copy action in giving index
|
||||||
@@ -49,26 +47,27 @@ public interface Bot extends Player {
|
|||||||
* @param index index of actions
|
* @param index index of actions
|
||||||
* @return Action of that index
|
* @return Action of that index
|
||||||
*/
|
*/
|
||||||
public LeavesBotAction getAction(int index);
|
@org.jetbrains.annotations.ApiStatus.Experimental
|
||||||
|
LeavesBotAction getAction(int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get action size
|
* Get action size
|
||||||
*
|
*
|
||||||
* @return size
|
* @return size
|
||||||
*/
|
*/
|
||||||
public int getActionSize();
|
int getActionSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop the action in giving index
|
* Stop the action in giving index
|
||||||
*
|
*
|
||||||
* @param index index of actions
|
* @param index index of actions
|
||||||
*/
|
*/
|
||||||
public void stopAction(int index);
|
void stopAction(int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop all the actions of the fakeplayer
|
* Stop all the actions of the fakeplayer
|
||||||
*/
|
*/
|
||||||
public void stopAllActions();
|
void stopAllActions();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the fakeplayer
|
* Remove the fakeplayer
|
||||||
@@ -76,5 +75,5 @@ public interface Bot extends Player {
|
|||||||
* @param save should save
|
* @param save should save
|
||||||
* @return success
|
* @return success
|
||||||
*/
|
*/
|
||||||
public boolean remove(boolean save);
|
boolean remove(boolean save);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ public interface BotCreator {
|
|||||||
return Bukkit.getBotManager().botCreator(realName, location);
|
return Bukkit.getBotManager().botCreator(realName, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BotCreator name(String name);
|
BotCreator name(String name);
|
||||||
|
|
||||||
public BotCreator skinName(String skinName);
|
BotCreator skinName(String skinName);
|
||||||
|
|
||||||
public BotCreator skin(String[] skin);
|
BotCreator skin(String[] skin);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the skin of the bot using the Mojang API based on the provided skin name.
|
* Sets the skin of the bot using the Mojang API based on the provided skin name.
|
||||||
@@ -27,19 +27,18 @@ public interface BotCreator {
|
|||||||
*
|
*
|
||||||
* @return BotCreator
|
* @return BotCreator
|
||||||
*/
|
*/
|
||||||
public BotCreator mojangAPISkin();
|
BotCreator mojangAPISkin();
|
||||||
|
|
||||||
public BotCreator location(@NotNull Location location);
|
BotCreator location(@NotNull Location location);
|
||||||
|
|
||||||
public BotCreator creator(@Nullable CommandSender creator);
|
BotCreator creator(@Nullable CommandSender creator);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a bot directly
|
* Create a bot directly
|
||||||
*
|
*
|
||||||
* @return a bot, null spawn fail
|
* @return a bot, null spawn fail
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable Bot spawn();
|
||||||
public Bot spawn();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a bot and apply skin of player names `skinName` from MojangAPI
|
* Create a bot and apply skin of player names `skinName` from MojangAPI
|
||||||
@@ -49,5 +48,5 @@ public interface BotCreator {
|
|||||||
*
|
*
|
||||||
* @param consumer Consumer
|
* @param consumer Consumer
|
||||||
*/
|
*/
|
||||||
public void spawnWithSkin(Consumer<Bot> consumer);
|
void spawnWithSkin(Consumer<Bot> consumer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ public interface BotManager {
|
|||||||
* @param uuid the uuid to look up
|
* @param uuid the uuid to look up
|
||||||
* @return a fakeplayer if one was found, null otherwise
|
* @return a fakeplayer if one was found, null otherwise
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable Bot getBot(@NotNull UUID uuid);
|
||||||
public Bot getBot(@NotNull UUID uuid);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a fakeplayer object by the given name.
|
* Gets a fakeplayer object by the given name.
|
||||||
@@ -28,15 +27,14 @@ public interface BotManager {
|
|||||||
* @param name the name to look up
|
* @param name the name to look up
|
||||||
* @return a fakeplayer if one was found, null otherwise
|
* @return a fakeplayer if one was found, null otherwise
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable Bot getBot(@NotNull String name);
|
||||||
public Bot getBot(@NotNull String name);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a view of all currently logged in fakeplayers. This view is a reused object, making some operations like Collection.size() zero-allocation.
|
* Gets a view of all currently logged in fakeplayers. This view is a reused object, making some operations like Collection.size() zero-allocation.
|
||||||
*
|
*
|
||||||
* @return a view of fakeplayers.
|
* @return a view of fakeplayers.
|
||||||
*/
|
*/
|
||||||
public Collection<Bot> getBots();
|
Collection<Bot> getBots();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a custom bot action.
|
* Register a custom bot action.
|
||||||
@@ -45,7 +43,8 @@ public interface BotManager {
|
|||||||
* @param action action executor
|
* @param action action executor
|
||||||
* @return true if success, or false
|
* @return true if success, or false
|
||||||
*/
|
*/
|
||||||
public boolean registerCustomBotAction(String name, CustomBotAction action);
|
@org.jetbrains.annotations.ApiStatus.Experimental
|
||||||
|
boolean registerCustomBotAction(String name, CustomBotAction action);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unregister a custom bot action.
|
* Unregister a custom bot action.
|
||||||
@@ -53,7 +52,8 @@ public interface BotManager {
|
|||||||
* @param name action name
|
* @param name action name
|
||||||
* @return true if success, or false
|
* @return true if success, or false
|
||||||
*/
|
*/
|
||||||
public boolean unregisterCustomBotAction(String name);
|
@org.jetbrains.annotations.ApiStatus.Experimental
|
||||||
|
boolean unregisterCustomBotAction(String name);
|
||||||
|
|
||||||
public BotCreator botCreator(@NotNull String realName, @NotNull Location location);
|
BotCreator botCreator(@NotNull String realName, @NotNull Location location);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,20 +8,19 @@ import java.io.File;
|
|||||||
|
|
||||||
public interface Photographer extends Player {
|
public interface Photographer extends Player {
|
||||||
|
|
||||||
@NotNull
|
@NotNull String getId();
|
||||||
public String getId();
|
|
||||||
|
|
||||||
public void setRecordFile(@NotNull File file);
|
void setRecordFile(@NotNull File file);
|
||||||
|
|
||||||
public void stopRecording();
|
void stopRecording();
|
||||||
|
|
||||||
public void stopRecording(boolean async);
|
void stopRecording(boolean async);
|
||||||
|
|
||||||
public void stopRecording(boolean async, boolean save);
|
void stopRecording(boolean async, boolean save);
|
||||||
|
|
||||||
public void pauseRecording();
|
void pauseRecording();
|
||||||
|
|
||||||
public void resumeRecording();
|
void resumeRecording();
|
||||||
|
|
||||||
public void setFollowPlayer(@Nullable Player player);
|
void setFollowPlayer(@Nullable Player player);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,27 @@
|
|||||||
package org.leavesmc.leaves.entity;
|
package org.leavesmc.leaves.entity;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.util.Consumer;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.leavesmc.leaves.entity.botaction.CustomBotAction;
|
|
||||||
import org.leavesmc.leaves.replay.BukkitRecorderOption;
|
import org.leavesmc.leaves.replay.BukkitRecorderOption;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface PhotographerManager {
|
public interface PhotographerManager {
|
||||||
@Nullable
|
@Nullable Photographer getPhotographer(@NotNull UUID uuid);
|
||||||
public Photographer getPhotographer(@NotNull UUID uuid);
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable Photographer getPhotographer(@NotNull String id);
|
||||||
public Photographer getPhotographer(@NotNull String id);
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable Photographer createPhotographer(@NotNull String id, @NotNull Location location);
|
||||||
public Photographer createPhotographer(@NotNull String id, @NotNull Location location);
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable Photographer createPhotographer(@NotNull String id, @NotNull Location location, @NotNull BukkitRecorderOption recorderOption);
|
||||||
public Photographer createPhotographer(@NotNull String id, @NotNull Location location, @NotNull BukkitRecorderOption recorderOption);
|
|
||||||
|
|
||||||
public void removePhotographer(@NotNull String id);
|
void removePhotographer(@NotNull String id);
|
||||||
|
|
||||||
public void removePhotographer(@NotNull UUID uuid);
|
void removePhotographer(@NotNull UUID uuid);
|
||||||
|
|
||||||
public void removeAllPhotographers();
|
void removeAllPhotographers();
|
||||||
|
|
||||||
public Collection<Photographer> getPhotographers();
|
Collection<Photographer> getPhotographers();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package org.leavesmc.leaves.entity.botaction;
|
|||||||
/**
|
/**
|
||||||
* A Leaves bot action enum
|
* A Leaves bot action enum
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@org.jetbrains.annotations.ApiStatus.Experimental
|
||||||
public enum BotActionType {
|
public enum BotActionType {
|
||||||
ATTACK("attack"),
|
ATTACK("attack"),
|
||||||
BREAK("break"),
|
BREAK("break"),
|
||||||
@@ -23,7 +25,7 @@ public enum BotActionType {
|
|||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
private BotActionType(String name) {
|
BotActionType(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* Represents a class which contains methods for a custom bot action
|
* Represents a class which contains methods for a custom bot action
|
||||||
*/
|
*/
|
||||||
|
@org.jetbrains.annotations.ApiStatus.Experimental
|
||||||
public interface CustomBotAction {
|
public interface CustomBotAction {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,7 +19,7 @@ public interface CustomBotAction {
|
|||||||
* @param bot bot of the action
|
* @param bot bot of the action
|
||||||
* @return true if once action finish, otherwise false
|
* @return true if once action finish, otherwise false
|
||||||
*/
|
*/
|
||||||
public boolean doTick(Bot bot);
|
boolean doTick(Bot bot);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created a new action instance.
|
* Created a new action instance.
|
||||||
@@ -27,28 +28,33 @@ public interface CustomBotAction {
|
|||||||
* @param args passed action arguments
|
* @param args passed action arguments
|
||||||
* @return a new action instance with given args
|
* @return a new action instance with given args
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable CustomBotAction getNew(@Nullable Player player, String[] args);
|
||||||
public CustomBotAction getNew(@Nullable Player player, String[] args);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests a list of possible completions for a action argument.
|
* Requests a list of possible completions for a action argument.
|
||||||
*
|
*
|
||||||
* @return A List of a List of possible completions for the argument.
|
* @return A List of a List of possible completions for the argument.
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull List<List<String>> getTabComplete();
|
||||||
public List<List<String>> getTabComplete();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a ticks to wait between {@link CustomBotAction#doTick(Bot)}
|
* Return the interval between {@link CustomBotAction#doTick(Bot)}
|
||||||
*
|
*
|
||||||
* @return the ticks to wait between runs
|
* @return the tick interval
|
||||||
*/
|
*/
|
||||||
public int getTickDelay();
|
int getInitialTickInterval();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the tick delay to the first {@link CustomBotAction#doTick(Bot)}
|
||||||
|
*
|
||||||
|
* @return the tick delay
|
||||||
|
*/
|
||||||
|
int getInitialTickDelay();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a number of times {@link CustomBotAction#doTick(Bot)} can return true
|
* Return a number of times {@link CustomBotAction#doTick(Bot)} can return true
|
||||||
*
|
*
|
||||||
* @return the number of times an action can be executed
|
* @return the number of times an action can be executed
|
||||||
*/
|
*/
|
||||||
public int getNumber();
|
int getInitialNumber();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,61 +5,54 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@org.jetbrains.annotations.ApiStatus.Experimental
|
||||||
public class LeavesBotAction {
|
public class LeavesBotAction {
|
||||||
|
|
||||||
private final String actionName;
|
private final String actionName;
|
||||||
private int tickToExecute;
|
|
||||||
private int executeInterval;
|
|
||||||
private int remainingExecuteTime;
|
|
||||||
private final UUID uuid;
|
private final UUID uuid;
|
||||||
|
private final int initialTickDelay;
|
||||||
|
private final int initialTickInterval;
|
||||||
|
private final int initialNumber;
|
||||||
|
|
||||||
private Player actionPlayer;
|
private Player actionPlayer;
|
||||||
|
private int tickToNext;
|
||||||
|
private int numberRemaining;
|
||||||
|
private boolean cancel;
|
||||||
|
|
||||||
public LeavesBotAction(BotActionType type, int executeInterval, int remainingExecuteTime) {
|
public LeavesBotAction(BotActionType type, int initialTickInterval, int initialNumber) {
|
||||||
this(type.getName(), executeInterval, remainingExecuteTime, UUID.randomUUID());
|
this(type.getName(), UUID.randomUUID(), 0, initialTickInterval, initialNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LeavesBotAction(String name, int executeInterval, int remainingExecuteTime) {
|
public LeavesBotAction(BotActionType type, int initialTickDelay, int initialTickInterval, int initialNumber) {
|
||||||
this(name, executeInterval, remainingExecuteTime, UUID.randomUUID());
|
this(type.getName(), UUID.randomUUID(), initialTickDelay, initialTickInterval, initialNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LeavesBotAction(String name, int executeInterval, int remainingExecuteTime, UUID actionUUID) {
|
protected LeavesBotAction(String name, UUID actionUUID, int initialTickDelay, int initialTickInterval, int initialNumber) {
|
||||||
this.actionName = name;
|
this.actionName = name;
|
||||||
this.remainingExecuteTime = remainingExecuteTime;
|
|
||||||
this.executeInterval = executeInterval;
|
|
||||||
this.uuid = actionUUID;
|
this.uuid = actionUUID;
|
||||||
this.tickToExecute = executeInterval;
|
this.initialTickDelay = initialTickDelay;
|
||||||
}
|
this.initialTickInterval = initialTickInterval;
|
||||||
|
this.initialNumber = initialNumber;
|
||||||
public void setTickToExecute(int tickToExecute) {
|
|
||||||
this.tickToExecute = tickToExecute;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTickToExecute() {
|
|
||||||
return tickToExecute;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExecuteInterval(int executeInterval) {
|
|
||||||
this.executeInterval = executeInterval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getExecuteInterval() {
|
|
||||||
return executeInterval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemainingExecuteTime(int remainingExecuteTime) {
|
|
||||||
this.remainingExecuteTime = remainingExecuteTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRemainingExecuteTime() {
|
|
||||||
return remainingExecuteTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getActionName() {
|
public String getActionName() {
|
||||||
return actionName;
|
return actionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActionPlayer(@Nullable Player actionPlayer) {
|
public UUID getUuid() {
|
||||||
this.actionPlayer = actionPlayer;
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getInitialTickDelay() {
|
||||||
|
return initialTickDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getInitialTickInterval() {
|
||||||
|
return initialTickInterval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getInitialNumber() {
|
||||||
|
return initialNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -67,7 +60,31 @@ public class LeavesBotAction {
|
|||||||
return actionPlayer;
|
return actionPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getUuid() {
|
public void setActionPlayer(@Nullable Player actionPlayer) {
|
||||||
return uuid;
|
this.actionPlayer = actionPlayer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCancel() {
|
||||||
|
return cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCancel(boolean cancel) {
|
||||||
|
this.cancel = cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNumberRemaining() {
|
||||||
|
return numberRemaining;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberRemaining(int numberRemaining) {
|
||||||
|
this.numberRemaining = numberRemaining;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTickToNext() {
|
||||||
|
return tickToNext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTickToNext(int tickToNext) {
|
||||||
|
this.tickToNext = tickToNext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,18 +10,16 @@ import java.util.UUID;
|
|||||||
public class BotActionExecuteEvent extends BotActionEvent implements Cancellable {
|
public class BotActionExecuteEvent extends BotActionEvent implements Cancellable {
|
||||||
|
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
public enum Result {
|
|
||||||
PASS, SOFT_CANCEL, HARD_CANCEL;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private Result result = Result.PASS;
|
private Result result = Result.PASS;
|
||||||
|
|
||||||
public BotActionExecuteEvent(@NotNull Bot who, String actionName, UUID actionUUID) {
|
public BotActionExecuteEvent(@NotNull Bot who, String actionName, UUID actionUUID) {
|
||||||
super(who, actionName, actionUUID);
|
super(who, actionName, actionUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return result != Result.PASS;
|
return result != Result.PASS;
|
||||||
@@ -45,8 +43,9 @@ public class BotActionExecuteEvent extends BotActionEvent implements Cancellable
|
|||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HandlerList getHandlerList() {
|
public enum Result {
|
||||||
return handlers;
|
PASS, SOFT_CANCEL, HARD_CANCEL
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,15 +12,18 @@ import java.util.UUID;
|
|||||||
public class BotActionScheduleEvent extends BotActionEvent implements Cancellable {
|
public class BotActionScheduleEvent extends BotActionEvent implements Cancellable {
|
||||||
|
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
private boolean cancel = false;
|
|
||||||
private final CommandSender sender;
|
private final CommandSender sender;
|
||||||
|
private boolean cancel = false;
|
||||||
|
|
||||||
public BotActionScheduleEvent(@NotNull Bot who, String actionName, UUID actionUUID, CommandSender sender) {
|
public BotActionScheduleEvent(@NotNull Bot who, String actionName, UUID actionUUID, CommandSender sender) {
|
||||||
super(who, actionName, actionUUID);
|
super(who, actionName, actionUUID);
|
||||||
this.sender = sender;
|
this.sender = sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancel;
|
return cancel;
|
||||||
@@ -41,8 +44,4 @@ public class BotActionScheduleEvent extends BotActionEvent implements Cancellabl
|
|||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HandlerList getHandlerList() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,14 +11,9 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class BotActionStopEvent extends BotActionEvent implements Cancellable {
|
public class BotActionStopEvent extends BotActionEvent implements Cancellable {
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private boolean cancel = false;
|
|
||||||
private final CommandSender sender;
|
private final CommandSender sender;
|
||||||
|
|
||||||
public enum Reason {
|
|
||||||
DONE, COMMAND, PLUGIN, INTERNAL
|
|
||||||
}
|
|
||||||
|
|
||||||
private final Reason reason;
|
private final Reason reason;
|
||||||
|
private boolean cancel = false;
|
||||||
|
|
||||||
public BotActionStopEvent(@NotNull Bot who, String actionName, UUID actionUUID, Reason stopReason, CommandSender sender) {
|
public BotActionStopEvent(@NotNull Bot who, String actionName, UUID actionUUID, Reason stopReason, CommandSender sender) {
|
||||||
super(who, actionName, actionUUID);
|
super(who, actionName, actionUUID);
|
||||||
@@ -26,6 +21,10 @@ public class BotActionStopEvent extends BotActionEvent implements Cancellable{
|
|||||||
this.sender = sender;
|
this.sender = sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
public Reason getReason() {
|
public Reason getReason() {
|
||||||
return reason;
|
return reason;
|
||||||
}
|
}
|
||||||
@@ -35,10 +34,6 @@ public class BotActionStopEvent extends BotActionEvent implements Cancellable{
|
|||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HandlerList getHandlerList() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancel;
|
return cancel;
|
||||||
@@ -53,4 +48,8 @@ public class BotActionStopEvent extends BotActionEvent implements Cancellable{
|
|||||||
public CommandSender getSender() {
|
public CommandSender getSender() {
|
||||||
return sender;
|
return sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum Reason {
|
||||||
|
DONE, COMMAND, PLUGIN, INTERNAL
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ public class BotConfigModifyEvent extends BotEvent implements Cancellable {
|
|||||||
|
|
||||||
private final String configName;
|
private final String configName;
|
||||||
private final String[] configValue;
|
private final String[] configValue;
|
||||||
private boolean cancel;
|
|
||||||
private final CommandSender sender;
|
private final CommandSender sender;
|
||||||
|
private boolean cancel;
|
||||||
|
|
||||||
public BotConfigModifyEvent(@NotNull Bot who, String configName, String[] configValue, CommandSender sender) {
|
public BotConfigModifyEvent(@NotNull Bot who, String configName, String[] configValue, CommandSender sender) {
|
||||||
super(who);
|
super(who);
|
||||||
@@ -22,6 +22,10 @@ public class BotConfigModifyEvent extends BotEvent implements Cancellable {
|
|||||||
this.sender = sender;
|
this.sender = sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public String getConfigName() {
|
public String getConfigName() {
|
||||||
return configName;
|
return configName;
|
||||||
@@ -46,8 +50,4 @@ public class BotConfigModifyEvent extends BotEvent implements Cancellable {
|
|||||||
public @NotNull HandlerList getHandlers() {
|
public @NotNull HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HandlerList getHandlerList() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,21 +14,12 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
public class BotCreateEvent extends Event implements Cancellable {
|
public class BotCreateEvent extends Event implements Cancellable {
|
||||||
|
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
public enum CreateReason {
|
|
||||||
COMMAND,
|
|
||||||
PLUGIN,
|
|
||||||
INTERNAL,
|
|
||||||
UNKNOWN,
|
|
||||||
}
|
|
||||||
|
|
||||||
private final String bot;
|
private final String bot;
|
||||||
private final String skin;
|
private final String skin;
|
||||||
private final CreateReason reason;
|
private final CreateReason reason;
|
||||||
private final CommandSender creator;
|
private final CommandSender creator;
|
||||||
private Location createLocation;
|
private Location createLocation;
|
||||||
private boolean cancel = false;
|
private boolean cancel = false;
|
||||||
|
|
||||||
public BotCreateEvent(@NotNull final String who, @NotNull final String skin, @NotNull final Location createLocation, @NotNull CreateReason reason, @Nullable CommandSender creator) {
|
public BotCreateEvent(@NotNull final String who, @NotNull final String skin, @NotNull final Location createLocation, @NotNull CreateReason reason, @Nullable CommandSender creator) {
|
||||||
this.bot = who;
|
this.bot = who;
|
||||||
this.skin = skin;
|
this.skin = skin;
|
||||||
@@ -37,6 +28,11 @@ public class BotCreateEvent extends Event implements Cancellable {
|
|||||||
this.creator = creator;
|
this.creator = creator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the fakeplayer name
|
* Gets the fakeplayer name
|
||||||
*
|
*
|
||||||
@@ -112,8 +108,10 @@ public class BotCreateEvent extends Event implements Cancellable {
|
|||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
public enum CreateReason {
|
||||||
public static HandlerList getHandlerList() {
|
COMMAND,
|
||||||
return handlers;
|
PLUGIN,
|
||||||
|
INTERNAL,
|
||||||
|
UNKNOWN,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ public class BotDeathEvent extends BotEvent implements Cancellable {
|
|||||||
this.sendDeathMessage = sendDeathMessage;
|
this.sendDeathMessage = sendDeathMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@NotNull
|
||||||
public @NotNull HandlerList getHandlers() {
|
public static HandlerList getHandlerList() {
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@Override
|
||||||
public static HandlerList getHandlerList() {
|
public @NotNull HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ public class BotInventoryOpenEvent extends BotEvent implements Cancellable {
|
|||||||
this.player = player;
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancel;
|
return cancel;
|
||||||
@@ -38,9 +43,4 @@ public class BotInventoryOpenEvent extends BotEvent implements Cancellable {
|
|||||||
public @NotNull HandlerList getHandlers() {
|
public @NotNull HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static HandlerList getHandlerList() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ public class BotJoinEvent extends BotEvent {
|
|||||||
this.joinMessage = joinMessage != null ? LegacyComponentSerializer.legacySection().deserialize(joinMessage) : null;
|
this.joinMessage = joinMessage != null ? LegacyComponentSerializer.legacySection().deserialize(joinMessage) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
public void joinMessage(@Nullable final Component joinMessage) {
|
public void joinMessage(@Nullable final Component joinMessage) {
|
||||||
this.joinMessage = joinMessage;
|
this.joinMessage = joinMessage;
|
||||||
}
|
}
|
||||||
@@ -59,9 +64,4 @@ public class BotJoinEvent extends BotEvent {
|
|||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static HandlerList getHandlerList() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ public class BotLoadEvent extends Event implements Cancellable {
|
|||||||
this.botUUID = uuid;
|
this.botUUID = uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the fakeplayer name
|
* Gets the fakeplayer name
|
||||||
*
|
*
|
||||||
@@ -51,9 +56,4 @@ public class BotLoadEvent extends Event implements Cancellable {
|
|||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static HandlerList getHandlerList() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,20 +15,11 @@ import org.leavesmc.leaves.entity.Bot;
|
|||||||
public class BotRemoveEvent extends BotEvent implements Cancellable {
|
public class BotRemoveEvent extends BotEvent implements Cancellable {
|
||||||
|
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
public enum RemoveReason {
|
|
||||||
COMMAND,
|
|
||||||
PLUGIN,
|
|
||||||
DEATH,
|
|
||||||
INTERNAL
|
|
||||||
}
|
|
||||||
|
|
||||||
private final RemoveReason reason;
|
private final RemoveReason reason;
|
||||||
private final CommandSender remover;
|
private final CommandSender remover;
|
||||||
private Component removeMessage;
|
private Component removeMessage;
|
||||||
private boolean save;
|
private boolean save;
|
||||||
private boolean cancel = false;
|
private boolean cancel = false;
|
||||||
|
|
||||||
public BotRemoveEvent(@NotNull final Bot who, @NotNull RemoveReason reason, @Nullable CommandSender remover, @Nullable Component removeMessage, boolean save) {
|
public BotRemoveEvent(@NotNull final Bot who, @NotNull RemoveReason reason, @Nullable CommandSender remover, @Nullable Component removeMessage, boolean save) {
|
||||||
super(who);
|
super(who);
|
||||||
this.reason = reason;
|
this.reason = reason;
|
||||||
@@ -37,6 +28,11 @@ public class BotRemoveEvent extends BotEvent implements Cancellable {
|
|||||||
this.save = save;
|
this.save = save;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the remove reason of the bot
|
* Gets the remove reason of the bot
|
||||||
*
|
*
|
||||||
@@ -99,8 +95,10 @@ public class BotRemoveEvent extends BotEvent implements Cancellable {
|
|||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
public enum RemoveReason {
|
||||||
public static HandlerList getHandlerList() {
|
COMMAND,
|
||||||
return handlers;
|
PLUGIN,
|
||||||
|
DEATH,
|
||||||
|
INTERNAL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ public class BotSpawnLocationEvent extends BotEvent {
|
|||||||
this.spawnLocation = spawnLocation;
|
this.spawnLocation = spawnLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public Location getSpawnLocation() {
|
public Location getSpawnLocation() {
|
||||||
return spawnLocation;
|
return spawnLocation;
|
||||||
@@ -30,9 +35,4 @@ public class BotSpawnLocationEvent extends BotEvent {
|
|||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static HandlerList getHandlerList() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ public class PlayerOperationLimitEvent extends PlayerEvent {
|
|||||||
this.operation = operation;
|
this.operation = operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the operated block
|
* Gets the operated block
|
||||||
*
|
*
|
||||||
@@ -45,11 +50,6 @@ public class PlayerOperationLimitEvent extends PlayerEvent {
|
|||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static HandlerList getHandlerList() {
|
|
||||||
return handlers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum Operation {
|
public enum Operation {
|
||||||
MINE, PLACE
|
MINE, PLACE
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// This file is licensed under the MIT license.
|
||||||
|
package org.leavesmc.leaves.plugin;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public interface FeatureManager {
|
||||||
|
Set<String> getAvailableFeatures();
|
||||||
|
|
||||||
|
boolean isFeatureAvailable(String feature);
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// This file is licensed under the MIT license.
|
||||||
|
package org.leavesmc.leaves.plugin;
|
||||||
|
|
||||||
|
public class Features {
|
||||||
|
public static final String MIXIN = "mixin";
|
||||||
|
public static final String FAKEPLAYER = "fakeplayer";
|
||||||
|
public static final String PHOTOGRAPHER = "photographer";
|
||||||
|
public static final String RECORDER = "recorder";
|
||||||
|
}
|
||||||
@@ -1,26 +1,31 @@
|
|||||||
--- a/paper-server/build.gradle.kts
|
--- a/paper-server/build.gradle.kts
|
||||||
+++ b/paper-server/build.gradle.kts
|
+++ b/paper-server/build.gradle.kts
|
||||||
@@ -5,14 +_,15 @@
|
@@ -9,25 +_,38 @@
|
||||||
plugins {
|
|
||||||
`java-library`
|
`java-library`
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
|
idea
|
||||||
- id("io.papermc.paperweight.core")
|
- id("io.papermc.paperweight.core")
|
||||||
+ id("org.leavesmc.leavesweight.core") // Leaves - build change
|
+ id("org.leavesmc.leavesweight.core") // Leaves - build change
|
||||||
}
|
}
|
||||||
|
|
||||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||||
+val leavesMavenPublicUrl = "https://repo.leavesmc.com/snapshots/"
|
+val leavesMavenPublicUrl = "https://repo.leavesmc.com/snapshots/" // Leaves - build change
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
mache("io.papermc:mache:1.21.4+build.7")
|
mache("io.papermc:mache:1.21.5+build.2")
|
||||||
- paperclip("io.papermc:paperclip:3.0.3")
|
- paperclip("io.papermc:paperclip:3.0.3")
|
||||||
+ leavesclip("org.leavesmc:leavesclip:2.0.1") // Leaves - build change
|
+ leavesclip("org.leavesmc:leavesclip:3.0.0") // Leaves - build change
|
||||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,6 +_,18 @@
|
paperweight {
|
||||||
// macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java")
|
- minecraftVersion = providers.gradleProperty("mcVersion")
|
||||||
// gitFilePatches = true
|
+ minecraftVersion = rootProject.providers.gradleProperty("mcVersion") // Leaves - build change
|
||||||
|
gitFilePatches = false
|
||||||
|
|
||||||
|
//updatingMinecraft {
|
||||||
|
// oldPaperCommit = "f4f275519f7c1fbe9db173b7144a4fe81440e365"
|
||||||
|
//}
|
||||||
|
|
||||||
+ // Leaves start - build change
|
+ // Leaves start - build change
|
||||||
+ val leaves = forks.register("leaves") {
|
+ val leaves = forks.register("leaves") {
|
||||||
@@ -35,17 +40,17 @@
|
|||||||
+ // Leaves end - build change
|
+ // Leaves end - build change
|
||||||
+
|
+
|
||||||
spigot {
|
spigot {
|
||||||
buildDataRef = "3edaf46ec1eed4115ce1b18d2846cded42577e42"
|
buildDataRef = "702e1a0a5072b2c4082371d5228cb30525687efc"
|
||||||
packageVersion = "v1_21_R3" // also needs to be updated in MappingEnvironment
|
packageVersion = "v1_21_R4" // also needs to be updated in MappingEnvironment
|
||||||
@@ -43,6 +_,7 @@
|
@@ -50,6 +_,7 @@
|
||||||
libraryRepositories.addAll(
|
libraryRepositories.addAll(
|
||||||
"https://repo.maven.apache.org/maven2/",
|
"https://repo.maven.apache.org/maven2/",
|
||||||
paperMavenPublicUrl,
|
paperMavenPublicUrl,
|
||||||
+ leavesMavenPublicUrl
|
+ leavesMavenPublicUrl // Leaves - build change
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +_,21 @@
|
@@ -108,7 +_,22 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,10 +70,11 @@
|
|||||||
+ java { srcDir("../paper-server/src/log4jPlugins/java") }
|
+ java { srcDir("../paper-server/src/log4jPlugins/java") }
|
||||||
+}
|
+}
|
||||||
+// Leaves end - build change
|
+// Leaves end - build change
|
||||||
|
+
|
||||||
configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||||
extendsFrom(configurations.compileClasspath.get())
|
extendsFrom(configurations.compileClasspath.get())
|
||||||
}
|
}
|
||||||
@@ -119,7 +_,13 @@
|
@@ -130,7 +_,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -79,12 +85,28 @@
|
|||||||
+ implementation("org.lz4:lz4-java:1.8.0")
|
+ implementation("org.lz4:lz4-java:1.8.0")
|
||||||
+ implementation("net.openhft:zero-allocation-hashing:0.16")
|
+ implementation("net.openhft:zero-allocation-hashing:0.16")
|
||||||
+ // Leaves end - linear
|
+ // Leaves end - linear
|
||||||
+ implementation("org.spongepowered:configurate-hocon:4.2.0-SNAPSHOT") // Leaves - leaves plugins
|
+ // Leaves start - leaves plugin
|
||||||
|
+ implementation("org.spongepowered:configurate-gson:4.2.0-SNAPSHOT") {
|
||||||
|
+ exclude(group = "com.google.code.gson", module = "gson")
|
||||||
|
+ exclude(group = "com.google.guava", module = "guava")
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - leaves plugin
|
||||||
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
|
||||||
@@ -177,6 +_,16 @@
|
@@ -157,9 +_,9 @@
|
||||||
implementation("me.lucko:spark-paper:1.10.119-20241121.092015-1")
|
implementation("org.ow2.asm:asm-commons:9.8")
|
||||||
|
implementation("org.spongepowered:configurate-yaml:4.2.0-20250225.064233-199")
|
||||||
|
implementation("org.spongepowered:configurate-core:4.2.0-20250225.064233-204") // Pinned dependency of above pinned yaml snapshot.
|
||||||
|
+ implementation("commons-lang:commons-lang:2.6") // Leaves
|
||||||
|
|
||||||
|
// Deps that were previously in the API but have now been moved here for backwards compat, eventually to be removed
|
||||||
|
- runtimeOnly("commons-lang:commons-lang:2.6")
|
||||||
|
runtimeOnly("org.xerial:sqlite-jdbc:3.49.1.0")
|
||||||
|
runtimeOnly("com.mysql:mysql-connector-j:9.2.0")
|
||||||
|
runtimeOnly("com.lmax:disruptor:3.4.4")
|
||||||
|
@@ -194,6 +_,16 @@
|
||||||
|
implementation("me.lucko:spark-paper:1.10.133-20250413.112336-1")
|
||||||
}
|
}
|
||||||
|
|
||||||
+// Leaves start - hide irrelevant compilation warnings
|
+// Leaves start - hide irrelevant compilation warnings
|
||||||
@@ -100,7 +122,7 @@
|
|||||||
tasks.jar {
|
tasks.jar {
|
||||||
manifest {
|
manifest {
|
||||||
val git = Git(rootProject.layout.projectDirectory.path)
|
val git = Git(rootProject.layout.projectDirectory.path)
|
||||||
@@ -189,14 +_,14 @@
|
@@ -206,14 +_,14 @@
|
||||||
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
|
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
|
||||||
attributes(
|
attributes(
|
||||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
@@ -120,7 +142,16 @@
|
|||||||
"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,
|
||||||
@@ -317,13 +_,23 @@
|
@@ -267,7 +_,7 @@
|
||||||
|
jvmArgumentProviders.add(provider)
|
||||||
|
}
|
||||||
|
|
||||||
|
-val generatedDir: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
|
||||||
|
+val generatedDir: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-server/src/generated/java").asFile.toPath()
|
||||||
|
idea {
|
||||||
|
module {
|
||||||
|
generatedSourceDirs.add(generatedDir.toFile())
|
||||||
|
@@ -360,13 +_,26 @@
|
||||||
classpath(tasks.createReobfBundlerJar.flatMap { it.outputZip })
|
classpath(tasks.createReobfBundlerJar.flatMap { it.outputZip })
|
||||||
mainClass.set(null as String?)
|
mainClass.set(null as String?)
|
||||||
}
|
}
|
||||||
@@ -134,15 +165,18 @@
|
|||||||
- classpath(tasks.createReobfPaperclipJar.flatMap { it.outputZip })
|
- classpath(tasks.createReobfPaperclipJar.flatMap { it.outputZip })
|
||||||
- mainClass.set(null as String?)
|
- mainClass.set(null as String?)
|
||||||
-}
|
-}
|
||||||
|
+
|
||||||
+// Leaves start - build change
|
+// Leaves start - build change
|
||||||
+tasks.registerRunTask("runLeavesclip") {
|
+tasks.registerRunTask("runLeavesclip") {
|
||||||
+ description = "Spin up a test server from the Mojang mapped Leavesclip jar"
|
+ description = "Spin up a test server from the Mojang mapped Leavesclip jar"
|
||||||
|
+ systemProperty("leavesclip.enable.mixin", true)
|
||||||
+ classpath(tasks.createMojmapLeavesclipJar.flatMap { it.outputZip })
|
+ classpath(tasks.createMojmapLeavesclipJar.flatMap { it.outputZip })
|
||||||
+ mainClass.set(null as String?)
|
+ mainClass.set(null as String?)
|
||||||
+}
|
+}
|
||||||
+tasks.registerRunTask("runReobfLeavesclip") {
|
+tasks.registerRunTask("runReobfLeavesclip") {
|
||||||
+ description = "Spin up a test server from the reobf Leavesclip jar"
|
+ description = "Spin up a test server from the reobf Leavesclip jar"
|
||||||
+ classpath(tasks.createReobfLeavesclipJar.flatMap { it.outputZip })
|
+ systemProperty("leavesclip.enable.mixin", true)
|
||||||
|
+ classpath(tasks.createMojmapLeavesclipJar.flatMap { it.outputZip })
|
||||||
+ mainClass.set(null as String?)
|
+ mainClass.set(null as String?)
|
||||||
+}
|
+}
|
||||||
+// Leaves end - build change
|
+// Leaves end - build change
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Build changes
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/ca/spottedleaf/moonrise/paper/PaperHooks.java b/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
diff --git a/ca/spottedleaf/moonrise/paper/PaperHooks.java b/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
||||||
index 4d344559a20a0c35c181e297e81788c747363ec9..9d25c263508da5b6a027132e6cc071b675e4af44 100644
|
index b9b774a3ca600cee3d0e967063ea2f72c7ab184f..dfc582444cd7273afb78b250d9fa12317591d8aa 100644
|
||||||
--- a/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
--- a/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
||||||
+++ b/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
+++ b/ca/spottedleaf/moonrise/paper/PaperHooks.java
|
||||||
@@ -28,7 +28,7 @@ import net.minecraft.world.phys.AABB;
|
@@ -29,7 +29,7 @@ import net.minecraft.world.phys.AABB;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
@@ -18,10 +18,10 @@ index 4d344559a20a0c35c181e297e81788c747363ec9..9d25c263508da5b6a027132e6cc071b6
|
|||||||
@Override
|
@Override
|
||||||
public String getBrand() {
|
public String getBrand() {
|
||||||
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 ae220a732c78ab076261f20b5a54c71d7fceb407..5dfdf76c8de5eda9a02f9a5fa1c3bada8ec7dcde 100644
|
index f1373fd5fdebb9f4600ba7f32a5df6188de3a0e9..4e5b27f2d00a6be6da6db461471395a515dc9b38 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
|
||||||
@@ -1192,7 +1192,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1190,7 +1190,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
LOGGER.info("*************************************************************************************");
|
LOGGER.info("*************************************************************************************");
|
||||||
LOGGER.info("This is the first time you're starting this server.");
|
LOGGER.info("This is the first time you're starting this server.");
|
||||||
LOGGER.info("It's recommended you read our 'Getting Started' documentation for guidance.");
|
LOGGER.info("It's recommended you read our 'Getting Started' documentation for guidance.");
|
||||||
@@ -30,7 +30,7 @@ index ae220a732c78ab076261f20b5a54c71d7fceb407..5dfdf76c8de5eda9a02f9a5fa1c3bada
|
|||||||
LOGGER.info("*************************************************************************************");
|
LOGGER.info("*************************************************************************************");
|
||||||
}
|
}
|
||||||
// Paper end - Add onboarding message for initial server start
|
// Paper end - Add onboarding message for initial server start
|
||||||
@@ -1855,7 +1855,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1853,7 +1853,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
@@ -40,10 +40,10 @@ index ae220a732c78ab076261f20b5a54c71d7fceb407..5dfdf76c8de5eda9a02f9a5fa1c3bada
|
|||||||
|
|
||||||
public SystemReport fillSystemReport(SystemReport systemReport) {
|
public SystemReport fillSystemReport(SystemReport systemReport) {
|
||||||
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 97a294d2f5c1ddf0af7ffec3e1425eb329c5751b..fc9f1b1cde5516eee06d6365645386cd0e3d14ec 100644
|
index 31e02f50edd46220dac81500dbb273f1ccdbe0b9..c22234df51a61954d1728b8406545f753dd8a3c2 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
|
||||||
@@ -223,9 +223,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -182,9 +182,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
|
thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
|
||||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||||
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Leaves Server Config And Command
|
|||||||
|
|
||||||
|
|
||||||
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 fc9f1b1cde5516eee06d6365645386cd0e3d14ec..64708df57aeca5c1f656748da96c6dadfba67ed7 100644
|
index c22234df51a61954d1728b8406545f753dd8a3c2..4924acb972ee2c9d5d1aa32e4969d4932629273b 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
|
||||||
@@ -225,6 +225,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -184,6 +184,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
||||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||||
|
|
||||||
|
|||||||
@@ -1,94 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
||||||
Date: Sun, 2 Feb 2025 13:08:32 +0800
|
|
||||||
Subject: [PATCH] Leaves Protocol Core
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
|
||||||
index fb263fa1f30a7dfcb7ec2656abfb38e5fe88eac9..7e19dfe90a63ff26f03b95891dacb7360bba5a3c 100644
|
|
||||||
--- a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
|
||||||
+++ b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
|
||||||
@@ -40,13 +40,23 @@ public interface CustomPacketPayload {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void encode(B buffer, CustomPacketPayload value) {
|
|
||||||
+ // Leaves start - protocol core
|
|
||||||
+ if (value instanceof org.leavesmc.leaves.protocol.core.LeavesCustomPayload<?> payload) {
|
|
||||||
+ buffer.writeResourceLocation(payload.id());
|
|
||||||
+ payload.write(buffer);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ // Leaves end - protocol core
|
|
||||||
this.writeCap(buffer, value.type(), value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CustomPacketPayload decode(B buffer) {
|
|
||||||
ResourceLocation resourceLocation = buffer.readResourceLocation();
|
|
||||||
- return (CustomPacketPayload)this.findCodec(resourceLocation).decode(buffer);
|
|
||||||
+ // Leaves start - protocol core
|
|
||||||
+ var payload = org.leavesmc.leaves.protocol.core.LeavesProtocolManager.decode(resourceLocation, buffer);
|
|
||||||
+ return java.util.Objects.requireNonNullElseGet(payload, () -> this.findCodec(resourceLocation).decode(buffer));
|
|
||||||
+ // Leaves end - protocol core
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
|
||||||
index 5dfdf76c8de5eda9a02f9a5fa1c3bada8ec7dcde..bde8ddadd3930100d1e31e630f809e77d6a70dac 100644
|
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
|
||||||
@@ -1744,6 +1744,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
||||||
|
|
||||||
profilerFiller.popPush("server gui refresh");
|
|
||||||
|
|
||||||
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleTick(); // Leaves - protocol
|
|
||||||
+
|
|
||||||
for (int i = 0; i < this.tickables.size(); i++) {
|
|
||||||
this.tickables.get(i).run();
|
|
||||||
}
|
|
||||||
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
||||||
index af75f1ca60dc01045f27cb550ac9e3deacf1a1cf..ba6338037f04a35a9f8c93cdb1e4b9d53c1a7925 100644
|
|
||||||
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
||||||
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
||||||
@@ -136,6 +136,12 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
|
|
||||||
+ // Leaves start - protocol
|
|
||||||
+ if (packet.payload() instanceof org.leavesmc.leaves.protocol.core.LeavesCustomPayload<?> leavesPayload) {
|
|
||||||
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePayload(player, leavesPayload);
|
|
||||||
+ }
|
|
||||||
+ // Leaves end - protocol
|
|
||||||
+
|
|
||||||
// Paper start
|
|
||||||
if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.BrandPayload(String brand)) {
|
|
||||||
this.player.clientBrandName = brand;
|
|
||||||
@@ -189,6 +195,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
|
||||||
final String channel = new String(data, from, length, java.nio.charset.StandardCharsets.US_ASCII);
|
|
||||||
if (register) {
|
|
||||||
this.getCraftPlayer().addChannel(channel);
|
|
||||||
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleMinecraftRegister(channel, player); // Leaves - protocol
|
|
||||||
} else {
|
|
||||||
this.getCraftPlayer().removeChannel(channel);
|
|
||||||
}
|
|
||||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
|
||||||
index c9dbe659374e3ce140316116e05110567e44b810..f88b3b3d0f8e56f17de491fa9d312dadad364a42 100644
|
|
||||||
--- a/net/minecraft/server/players/PlayerList.java
|
|
||||||
+++ b/net/minecraft/server/players/PlayerList.java
|
|
||||||
@@ -330,6 +330,8 @@ public abstract class PlayerList {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol
|
|
||||||
+
|
|
||||||
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
|
|
||||||
|
|
||||||
if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
|
|
||||||
@@ -500,6 +502,7 @@ public abstract class PlayerList {
|
|
||||||
return this.remove(player, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? player.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(player.getDisplayName())));
|
|
||||||
}
|
|
||||||
public net.kyori.adventure.text.Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
|
|
||||||
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerLeave(player); // Leaves - protocol
|
|
||||||
// Paper end - Fix kick event leave message not being sent
|
|
||||||
ServerLevel serverLevel = player.serverLevel();
|
|
||||||
player.awardStat(Stats.LEAVE_GAME);
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
|
||||||
|
Date: Tue, 22 Apr 2025 23:32:41 +0800
|
||||||
|
Subject: [PATCH] Leaves entity ex data
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
|
index 81a18b8e605bd4c28b48a32c80be231609182970..f8d45c1076852a0553c3dd7c5512f76a6891e2cb 100644
|
||||||
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
|
@@ -351,6 +351,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
public boolean isTemporarilyActive;
|
||||||
|
public long activatedImmunityTick = Integer.MIN_VALUE;
|
||||||
|
|
||||||
|
+ private CompoundTag leavesData = new CompoundTag(); // Leaves - Leaves ex data
|
||||||
|
+
|
||||||
|
public void inactiveTick() {
|
||||||
|
}
|
||||||
|
// Paper end - EAR 2
|
||||||
|
@@ -2516,6 +2518,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
compound.putBoolean("Paper.FreezeLock", true);
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
+ compound.put("Leaves.Data", leavesData); // Leaves - leaves ex data
|
||||||
|
return compound;
|
||||||
|
} catch (Throwable var8) {
|
||||||
|
CrashReport crashReport = CrashReport.forThrowable(var8, "Saving entity NBT");
|
||||||
|
@@ -2646,6 +2649,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
freezeLocked = compound.getBooleanOr("Paper.FreezeLock", false);
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
+ // Leaves start - leaves ex data
|
||||||
|
+ if (compound.contains("Leaves.Data")) {
|
||||||
|
+ leavesData = compound.getCompoundOrEmpty("Leaves.Data");
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - leaves ex data
|
||||||
|
} catch (Throwable var8) {
|
||||||
|
CrashReport crashReport = CrashReport.forThrowable(var8, "Loading entity NBT");
|
||||||
|
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded");
|
||||||
|
@@ -5114,4 +5122,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition());
|
||||||
|
}
|
||||||
|
// Paper end - Expose entity id counter
|
||||||
|
+ // Leaves start - leaves ex data
|
||||||
|
+ public CompoundTag getLeavesData() {
|
||||||
|
+ return leavesData;
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - leaves ex data
|
||||||
|
}
|
||||||
@@ -0,0 +1,147 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||||
|
Date: Sun, 2 Feb 2025 13:08:32 +0800
|
||||||
|
Subject: [PATCH] Leaves Protocol Core
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
||||||
|
index fb263fa1f30a7dfcb7ec2656abfb38e5fe88eac9..56fd1ed7ccaf96e7eedea60fbdbf7f934939d563 100644
|
||||||
|
--- a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
||||||
|
+++ b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
||||||
|
@@ -40,13 +40,22 @@ public interface CustomPacketPayload {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void encode(B buffer, CustomPacketPayload value) {
|
||||||
|
+ // Leaves start - protocol core
|
||||||
|
+ if (value instanceof org.leavesmc.leaves.protocol.core.LeavesCustomPayload payload) {
|
||||||
|
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.encode(buffer, payload);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - protocol core
|
||||||
|
this.writeCap(buffer, value.type(), value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CustomPacketPayload decode(B buffer) {
|
||||||
|
ResourceLocation resourceLocation = buffer.readResourceLocation();
|
||||||
|
- return (CustomPacketPayload)this.findCodec(resourceLocation).decode(buffer);
|
||||||
|
+ // Leaves start - protocol core
|
||||||
|
+ var payload = org.leavesmc.leaves.protocol.core.LeavesProtocolManager.decode(resourceLocation, buffer);
|
||||||
|
+ return java.util.Objects.requireNonNullElseGet(payload, () -> this.findCodec(resourceLocation).decode(buffer));
|
||||||
|
+ // Leaves end - protocol core
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
diff --git a/net/minecraft/network/protocol/common/custom/DiscardedPayload.java b/net/minecraft/network/protocol/common/custom/DiscardedPayload.java
|
||||||
|
index 62b9d9486c15a1ec6527f786df4e9fc483390bcb..5384bbc6bb3dbe5481f9d8cb10282551a0f78ec1 100644
|
||||||
|
--- a/net/minecraft/network/protocol/common/custom/DiscardedPayload.java
|
||||||
|
+++ b/net/minecraft/network/protocol/common/custom/DiscardedPayload.java
|
||||||
|
@@ -4,12 +4,12 @@ import net.minecraft.network.FriendlyByteBuf;
|
||||||
|
import net.minecraft.network.codec.StreamCodec;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
|
||||||
|
-public record DiscardedPayload(ResourceLocation id, byte[] data) implements CustomPacketPayload { // Paper - store data
|
||||||
|
+public record DiscardedPayload(ResourceLocation id, byte @org.jetbrains.annotations.Nullable [] data) implements CustomPacketPayload { // Paper - store data // Leaves - nullable
|
||||||
|
public static <T extends FriendlyByteBuf> StreamCodec<T, DiscardedPayload> codec(ResourceLocation id, int maxSize) {
|
||||||
|
return CustomPacketPayload.codec((value, output) -> {
|
||||||
|
// Paper start
|
||||||
|
// Always write data
|
||||||
|
- output.writeBytes(value.data);
|
||||||
|
+ if (value.data != null) output.writeBytes(value.data); // Leaves - nullable
|
||||||
|
}, buffer -> {
|
||||||
|
int i = buffer.readableBytes();
|
||||||
|
if (i >= 0 && i <= maxSize) {
|
||||||
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
|
index 4e5b27f2d00a6be6da6db461471395a515dc9b38..d48581353661799e5e031a512227d5e651fa2996 100644
|
||||||
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
|
@@ -1742,6 +1742,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
|
profilerFiller.popPush("server gui refresh");
|
||||||
|
|
||||||
|
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleTick(tickCount); // Leaves - protocol
|
||||||
|
+
|
||||||
|
for (int i = 0; i < this.tickables.size(); i++) {
|
||||||
|
this.tickables.get(i).run();
|
||||||
|
}
|
||||||
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
index 3781d9cc174b7aecacb9b9855d52c7b1ff05835c..443bfb06951f0ffe6af8724b53e150cd0907e68d 100644
|
||||||
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
@@ -425,6 +425,8 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
|
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();
|
||||||
|
|
||||||
|
+ public net.minecraft.network.Connection internalConnection; // Leaves - protocol core
|
||||||
|
+
|
||||||
|
@Override
|
||||||
|
public final boolean moonrise$isRealPlayer() {
|
||||||
|
return this.isRealPlayer;
|
||||||
|
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
|
index 186393485396cfe9b1baef29586198356e2d2600..ac5ef04fae4bc19bae9007c0ffd8f688434d22d7 100644
|
||||||
|
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
|
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
|
@@ -136,6 +136,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
|
||||||
|
+ // Leaves start - protocol
|
||||||
|
+ if (packet.payload() instanceof org.leavesmc.leaves.protocol.core.LeavesCustomPayload leavesPayload) {
|
||||||
|
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePayload(player, leavesPayload);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.DiscardedPayload(net.minecraft.resources.ResourceLocation id, byte[] data)) {
|
||||||
|
+ if (org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleBytebuf(player, id, io.netty.buffer.Unpooled.wrappedBuffer(data))) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - protocol
|
||||||
|
+
|
||||||
|
// Paper start
|
||||||
|
if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.BrandPayload(String brand)) {
|
||||||
|
this.player.clientBrandName = brand;
|
||||||
|
@@ -189,6 +201,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
|
final String channel = new String(data, from, length, java.nio.charset.StandardCharsets.US_ASCII);
|
||||||
|
if (register) {
|
||||||
|
this.getCraftPlayer().addChannel(channel);
|
||||||
|
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleMinecraftRegister(channel, player); // Leaves - protocol
|
||||||
|
} else {
|
||||||
|
this.getCraftPlayer().removeChannel(channel);
|
||||||
|
}
|
||||||
|
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||||
|
index 9ca3c55a3b5b1a532b86b08eb92460df4cb54f2a..2648a3ad296f59ee554783cdd4c7e889d0447f5b 100644
|
||||||
|
--- a/net/minecraft/server/players/PlayerList.java
|
||||||
|
+++ b/net/minecraft/server/players/PlayerList.java
|
||||||
|
@@ -334,6 +334,8 @@ public abstract class PlayerList {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol
|
||||||
|
+
|
||||||
|
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
|
||||||
|
|
||||||
|
if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
|
||||||
|
@@ -504,6 +506,7 @@ public abstract class PlayerList {
|
||||||
|
return this.remove(player, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? player.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(player.getDisplayName())));
|
||||||
|
}
|
||||||
|
public @Nullable net.kyori.adventure.text.Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
|
||||||
|
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerLeave(player); // Leaves - protocol
|
||||||
|
// Paper end - Fix kick event leave message not being sent
|
||||||
|
ServerLevel serverLevel = player.serverLevel();
|
||||||
|
player.awardStat(Stats.LEAVE_GAME);
|
||||||
|
@@ -628,6 +631,7 @@ public abstract class PlayerList {
|
||||||
|
SocketAddress socketAddress = loginlistener.connection.getRemoteAddress();
|
||||||
|
|
||||||
|
ServerPlayer entity = new ServerPlayer(this.server, this.server.getLevel(Level.OVERWORLD), gameProfile, ClientInformation.createDefault());
|
||||||
|
+ entity.internalConnection = loginlistener.connection; // Leaves - protocol core
|
||||||
|
entity.transferCookieConnection = loginlistener;
|
||||||
|
org.bukkit.entity.Player player = entity.getBukkitEntity();
|
||||||
|
org.bukkit.event.player.PlayerLoginEvent event = new org.bukkit.event.player.PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketAddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.channel.remoteAddress()).getAddress());
|
||||||
|
@@ -1418,6 +1422,7 @@ public abstract class PlayerList {
|
||||||
|
serverPlayer.connection.send(clientboundUpdateRecipesPacket);
|
||||||
|
serverPlayer.getRecipeBook().sendInitialRecipeBook(serverPlayer);
|
||||||
|
}
|
||||||
|
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleDataPackReload(); // Leaves - protocol core
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAllowCommandsForAllPlayers() {
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix trading with the void
|
|||||||
|
|
||||||
|
|
||||||
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 d3c50acc5ca30b608825d4baff4b7e09a9e0f586..60425aade859c03ec21669b33d6b5096e444f6e9 100644
|
index 3c8a1fe9831d6cf9e622e3ac2aede4e5c657c18f..e29dd7c4759319fffea46bca17b65df412eca6f5 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
|
||||||
@@ -2678,11 +2678,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -2673,11 +2673,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
// Spigot end
|
// Spigot end
|
||||||
// Spigot start
|
// Spigot start
|
||||||
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Make snowball and egg can knockback player
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/projectile/Snowball.java b/net/minecraft/world/entity/projectile/Snowball.java
|
diff --git a/net/minecraft/world/entity/projectile/Snowball.java b/net/minecraft/world/entity/projectile/Snowball.java
|
||||||
index c57bbdc13221d2ce349f3f1d894193f80ff1e24b..51e412e814523c4acccee9caf39af729e1e950d8 100644
|
index 677b4b681f9c2c09a8ae3cfdec72102265547a7b..1474cf208019cd46ca767374bceb3c9c31fdeab2 100644
|
||||||
--- a/net/minecraft/world/entity/projectile/Snowball.java
|
--- a/net/minecraft/world/entity/projectile/Snowball.java
|
||||||
+++ b/net/minecraft/world/entity/projectile/Snowball.java
|
+++ b/net/minecraft/world/entity/projectile/Snowball.java
|
||||||
@@ -54,6 +54,12 @@ public class Snowball extends ThrowableItemProjectile {
|
@@ -54,6 +54,12 @@ public class Snowball extends ThrowableItemProjectile {
|
||||||
@@ -22,10 +22,10 @@ index c57bbdc13221d2ce349f3f1d894193f80ff1e24b..51e412e814523c4acccee9caf39af729
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/net/minecraft/world/entity/projectile/ThrownEgg.java b/net/minecraft/world/entity/projectile/ThrownEgg.java
|
diff --git a/net/minecraft/world/entity/projectile/ThrownEgg.java b/net/minecraft/world/entity/projectile/ThrownEgg.java
|
||||||
index 76481c0e77fc3a2e4be8eeb9de8d1e6de5507c64..14aeb330627e6fa06834736ab747b0fe64666bec 100644
|
index 73ec34b43f3fb2aa3edc3f1cb48a923d1fa32036..6583f983129b2a90bd44104de9f4f992fa21a00c 100644
|
||||||
--- a/net/minecraft/world/entity/projectile/ThrownEgg.java
|
--- a/net/minecraft/world/entity/projectile/ThrownEgg.java
|
||||||
+++ b/net/minecraft/world/entity/projectile/ThrownEgg.java
|
+++ b/net/minecraft/world/entity/projectile/ThrownEgg.java
|
||||||
@@ -53,6 +53,12 @@ public class ThrownEgg extends ThrowableItemProjectile {
|
@@ -55,6 +55,12 @@ public class ThrownEgg extends ThrowableItemProjectile {
|
||||||
protected void onHitEntity(EntityHitResult result) {
|
protected void onHitEntity(EntityHitResult result) {
|
||||||
super.onHitEntity(result);
|
super.onHitEntity(result);
|
||||||
result.getEntity().hurt(this.damageSources().thrown(this, this.getOwner()), 0.0F);
|
result.getEntity().hurt(this.damageSources().thrown(this, this.getOwner()), 0.0F);
|
||||||
@@ -30,19 +30,19 @@ index 4ed9611994c5c8da01fede690197527c5b3a5731..364ddf9f25ef3cb97ba788c469fee9dd
|
|||||||
private DisconnectionDetails disconnectionDetails;
|
private DisconnectionDetails disconnectionDetails;
|
||||||
private boolean encrypted;
|
private boolean encrypted;
|
||||||
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 bde8ddadd3930100d1e31e630f809e77d6a70dac..073d4a57f78dc18e4cf95bdb852877b8624ec3f8 100644
|
index d48581353661799e5e031a512227d5e651fa2996..b0881eaf3484560740d2d53b3957cf3f4d829360 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
|
||||||
@@ -304,6 +304,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -303,6 +303,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
|
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
|
||||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||||
|
|
||||||
+ private org.leavesmc.leaves.bot.BotList botList; // Leaves - fakeplayer
|
+ private org.leavesmc.leaves.bot.BotList botList; // Leaves - fakeplayer
|
||||||
+
|
+
|
||||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
|
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
|
||||||
ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.init(); // Paper - rewrite data converter system
|
|
||||||
AtomicReference<S> atomicReference = new AtomicReference<>();
|
AtomicReference<S> atomicReference = new AtomicReference<>();
|
||||||
@@ -740,6 +742,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
Thread thread = new ca.spottedleaf.moonrise.common.util.TickThread(() -> atomicReference.get().runServer(), "Server thread");
|
||||||
|
@@ -738,6 +740,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
// Paper end - Configurable player collision
|
// Paper end - Configurable player collision
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ index bde8ddadd3930100d1e31e630f809e77d6a70dac..073d4a57f78dc18e4cf95bdb852877b8
|
|||||||
this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
|
this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
|
||||||
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
||||||
this.server.spark.enableAfterPlugins(this.server); // Paper - spark
|
this.server.spark.enableAfterPlugins(this.server); // Paper - spark
|
||||||
@@ -1001,6 +1005,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -993,6 +997,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
LOGGER.info("Stopping server");
|
LOGGER.info("Stopping server");
|
||||||
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
|
||||||
@@ -59,7 +59,7 @@ index bde8ddadd3930100d1e31e630f809e77d6a70dac..073d4a57f78dc18e4cf95bdb852877b8
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (this.server != null) {
|
if (this.server != null) {
|
||||||
this.server.spark.disable(); // Paper - spark
|
this.server.spark.disable(); // Paper - spark
|
||||||
@@ -1762,6 +1767,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1760,6 +1765,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
public void tickConnection() {
|
public void tickConnection() {
|
||||||
this.getConnection().tick();
|
this.getConnection().tick();
|
||||||
@@ -67,7 +67,7 @@ index bde8ddadd3930100d1e31e630f809e77d6a70dac..073d4a57f78dc18e4cf95bdb852877b8
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void synchronizeTime(ServerLevel level) {
|
private void synchronizeTime(ServerLevel level) {
|
||||||
@@ -2811,6 +2817,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2805,6 +2811,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ index bde8ddadd3930100d1e31e630f809e77d6a70dac..073d4a57f78dc18e4cf95bdb852877b8
|
|||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
|
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
|
||||||
index 64dbee1f67eaa17c93c13bfa38fbe27de57651e4..459e59c370a729dfeed3872f3a5984dd3da96abe 100644
|
index 52e0ae233a7b1c88bfbbc27707ef5f18453ec865..f56a3fb47aa34c39cbd0e0e4e47d924da1488d7a 100644
|
||||||
--- a/net/minecraft/server/PlayerAdvancements.java
|
--- a/net/minecraft/server/PlayerAdvancements.java
|
||||||
+++ b/net/minecraft/server/PlayerAdvancements.java
|
+++ b/net/minecraft/server/PlayerAdvancements.java
|
||||||
@@ -168,6 +168,11 @@ public class PlayerAdvancements {
|
@@ -168,6 +168,11 @@ public class PlayerAdvancements {
|
||||||
@@ -101,10 +101,10 @@ index 64dbee1f67eaa17c93c13bfa38fbe27de57651e4..459e59c370a729dfeed3872f3a5984dd
|
|||||||
AdvancementProgress orStartProgress = this.getOrStartProgress(advancement);
|
AdvancementProgress orStartProgress = this.getOrStartProgress(advancement);
|
||||||
boolean isDone = orStartProgress.isDone();
|
boolean isDone = orStartProgress.isDone();
|
||||||
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 5eb12553eb96db7204ee45a2ab4ed18e2e048573..529a2caa2cde82bfdea7c173768fee32f5f21e49 100644
|
index 4924acb972ee2c9d5d1aa32e4969d4932629273b..e56f26fc504538d88bfa1954e929ee44fd31d657 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
|
||||||
@@ -203,6 +203,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -162,6 +162,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spigot start
|
// Spigot start
|
||||||
@@ -113,10 +113,10 @@ index 5eb12553eb96db7204ee45a2ab4ed18e2e048573..529a2caa2cde82bfdea7c173768fee32
|
|||||||
org.spigotmc.SpigotConfig.init((java.io.File) this.options.valueOf("spigot-settings"));
|
org.spigotmc.SpigotConfig.init((java.io.File) this.options.valueOf("spigot-settings"));
|
||||||
org.spigotmc.SpigotConfig.registerCommands();
|
org.spigotmc.SpigotConfig.registerCommands();
|
||||||
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 b3f498558614243cf633dcd71e3c49c2c55e6e0f..36c0a690e7e9b301c5a3d63fae2c7cbe36ba6cdf 100644
|
index 0d8aefe8c886eaa4c33cbab53b0ad1c016f0531f..4785f9d6c53e18419a3df4a1be9c8a4f9d8cadfb 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
|
||||||
@@ -1247,6 +1247,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1317,6 +1317,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
} else if (this.seenBy.remove(player.connection)) {
|
} else if (this.seenBy.remove(player.connection)) {
|
||||||
this.serverEntity.removePairing(player);
|
this.serverEntity.removePairing(player);
|
||||||
@@ -131,18 +131,18 @@ index b3f498558614243cf633dcd71e3c49c2c55e6e0f..36c0a690e7e9b301c5a3d63fae2c7cbe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
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 60425aade859c03ec21669b33d6b5096e444f6e9..9fba04e8a8e95546f7d7cc1210b4b324c86d2b87 100644
|
index b1ede1dce7d6c5ea6e93259618ed63e53fc46756..d71e9c713f52a41563b20faa648aa81046af02e4 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
|
||||||
@@ -215,6 +215,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -211,6 +211,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent
|
public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent
|
||||||
public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent
|
public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent
|
||||||
private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current)
|
private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current)
|
||||||
+ final List<ServerPlayer> realPlayers; // Leaves - skip
|
+ final List<ServerPlayer> realPlayers; // Leaves - skip
|
||||||
|
|
||||||
public LevelChunk getChunkIfLoaded(int x, int z) {
|
@Override
|
||||||
return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately
|
public @Nullable LevelChunk getChunkIfLoaded(int x, int z) {
|
||||||
@@ -681,6 +682,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -671,6 +672,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
|
this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
|
||||||
// Paper end - rewrite chunk system
|
// Paper end - rewrite chunk system
|
||||||
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
||||||
@@ -150,7 +150,7 @@ index 60425aade859c03ec21669b33d6b5096e444f6e9..9fba04e8a8e95546f7d7cc1210b4b324
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Paper start
|
// Paper start
|
||||||
@@ -2206,6 +2208,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -2204,6 +2206,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
return this.players;
|
return this.players;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,9 +161,9 @@ index 60425aade859c03ec21669b33d6b5096e444f6e9..9fba04e8a8e95546f7d7cc1210b4b324
|
|||||||
+ // Leaves end - fakeplayer skip
|
+ // Leaves end - fakeplayer skip
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public void onBlockStateChange(BlockPos pos, BlockState blockState, BlockState newState) {
|
public void updatePOIOnBlockStateChange(BlockPos pos, BlockState oldState, BlockState newState) {
|
||||||
Optional<Holder<PoiType>> optional = PoiTypes.forState(blockState);
|
Optional<Holder<PoiType>> optional = PoiTypes.forState(oldState);
|
||||||
@@ -2621,6 +2629,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -2616,6 +2624,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
// ServerLevel.this.getChunkSource().addEntity(entity); // Paper - ignore and warn about illegal addEntity calls instead of crashing server; moved down below valid=true
|
// ServerLevel.this.getChunkSource().addEntity(entity); // Paper - ignore and warn about illegal addEntity calls instead of crashing server; moved down below valid=true
|
||||||
if (entity instanceof ServerPlayer serverPlayer) {
|
if (entity instanceof ServerPlayer serverPlayer) {
|
||||||
ServerLevel.this.players.add(serverPlayer);
|
ServerLevel.this.players.add(serverPlayer);
|
||||||
@@ -175,7 +175,7 @@ index 60425aade859c03ec21669b33d6b5096e444f6e9..9fba04e8a8e95546f7d7cc1210b4b324
|
|||||||
ServerLevel.this.updateSleepingPlayerList();
|
ServerLevel.this.updateSleepingPlayerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2687,6 +2700,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -2682,6 +2695,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
ServerLevel.this.getChunkSource().removeEntity(entity);
|
ServerLevel.this.getChunkSource().removeEntity(entity);
|
||||||
if (entity instanceof ServerPlayer serverPlayer) {
|
if (entity instanceof ServerPlayer serverPlayer) {
|
||||||
ServerLevel.this.players.remove(serverPlayer);
|
ServerLevel.this.players.remove(serverPlayer);
|
||||||
@@ -188,11 +188,11 @@ index 60425aade859c03ec21669b33d6b5096e444f6e9..9fba04e8a8e95546f7d7cc1210b4b324
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 3de65c4025be91d938a350c884975cb6edc234d3..339cec1f040d47bb37834c6ebe0633b7c991e0cd 100644
|
index 443bfb06951f0ffe6af8724b53e150cd0907e68d..01687ea3acf449c49cbc615887a7dbdd3a693613 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
|
||||||
@@ -197,7 +197,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -208,7 +208,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
);
|
private static final boolean DEFAULT_SPAWN_EXTRA_PARTICLES_ON_FALL = false;
|
||||||
public ServerGamePacketListenerImpl connection;
|
public ServerGamePacketListenerImpl connection;
|
||||||
public final MinecraftServer server;
|
public final MinecraftServer server;
|
||||||
- public final ServerPlayerGameMode gameMode;
|
- public final ServerPlayerGameMode gameMode;
|
||||||
@@ -200,7 +200,7 @@ index 3de65c4025be91d938a350c884975cb6edc234d3..339cec1f040d47bb37834c6ebe0633b7
|
|||||||
private final PlayerAdvancements advancements;
|
private final PlayerAdvancements advancements;
|
||||||
private final ServerStatsCounter stats;
|
private final ServerStatsCounter stats;
|
||||||
private float lastRecordedHealthAndAbsorption = Float.MIN_VALUE;
|
private float lastRecordedHealthAndAbsorption = Float.MIN_VALUE;
|
||||||
@@ -1469,6 +1469,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1413,6 +1413,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
this.lastSentHealth = -1.0F;
|
this.lastSentHealth = -1.0F;
|
||||||
this.lastSentFood = -1;
|
this.lastSentFood = -1;
|
||||||
|
|
||||||
@@ -213,10 +213,10 @@ index 3de65c4025be91d938a350c884975cb6edc234d3..339cec1f040d47bb37834c6ebe0633b7
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
org.bukkit.event.player.PlayerChangedWorldEvent changeEvent = new org.bukkit.event.player.PlayerChangedWorldEvent(this.getBukkitEntity(), serverLevel.getWorld());
|
org.bukkit.event.player.PlayerChangedWorldEvent changeEvent = new org.bukkit.event.player.PlayerChangedWorldEvent(this.getBukkitEntity(), serverLevel.getWorld());
|
||||||
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 f88b3b3d0f8e56f17de491fa9d312dadad364a42..bd7ae7aba1802f202ea09cb1064832092da30c4b 100644
|
index d24c61c34427aa526c16ffc8aa43ec9ec1232589..012574f56d9d7e6340c8b7bf7bee43e36d99df65 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
|
||||||
@@ -332,6 +332,19 @@ public abstract class PlayerList {
|
@@ -336,6 +336,19 @@ public abstract class PlayerList {
|
||||||
|
|
||||||
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol
|
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ index f88b3b3d0f8e56f17de491fa9d312dadad364a42..bd7ae7aba1802f202ea09cb106483209
|
|||||||
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
|
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
|
||||||
|
|
||||||
if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
|
if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
|
||||||
@@ -852,6 +865,12 @@ public abstract class PlayerList {
|
@@ -867,6 +880,12 @@ public abstract class PlayerList {
|
||||||
}
|
}
|
||||||
// Paper end - Add PlayerPostRespawnEvent
|
// Paper end - Add PlayerPostRespawnEvent
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ index f88b3b3d0f8e56f17de491fa9d312dadad364a42..bd7ae7aba1802f202ea09cb106483209
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
return serverPlayer;
|
return serverPlayer;
|
||||||
@@ -957,11 +976,16 @@ public abstract class PlayerList {
|
@@ -971,11 +990,16 @@ public abstract class PlayerList {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getPlayerNamesArray() {
|
public String[] getPlayerNamesArray() {
|
||||||
@@ -267,7 +267,7 @@ index f88b3b3d0f8e56f17de491fa9d312dadad364a42..bd7ae7aba1802f202ea09cb106483209
|
|||||||
|
|
||||||
return strings;
|
return strings;
|
||||||
}
|
}
|
||||||
@@ -1045,7 +1069,14 @@ public abstract class PlayerList {
|
@@ -1061,7 +1085,14 @@ public abstract class PlayerList {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public ServerPlayer getPlayerByName(String username) {
|
public ServerPlayer getPlayerByName(String username) {
|
||||||
@@ -283,7 +283,7 @@ index f88b3b3d0f8e56f17de491fa9d312dadad364a42..bd7ae7aba1802f202ea09cb106483209
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void broadcast(@Nullable Player except, double x, double y, double z, double radius, ResourceKey<Level> dimension, Packet<?> packet) {
|
public void broadcast(@Nullable Player except, double x, double y, double z, double radius, ResourceKey<Level> dimension, Packet<?> packet) {
|
||||||
@@ -1361,7 +1392,13 @@ public abstract class PlayerList {
|
@@ -1377,7 +1408,13 @@ public abstract class PlayerList {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public ServerPlayer getPlayer(UUID playerUUID) {
|
public ServerPlayer getPlayer(UUID playerUUID) {
|
||||||
@@ -299,10 +299,10 @@ index f88b3b3d0f8e56f17de491fa9d312dadad364a42..bd7ae7aba1802f202ea09cb106483209
|
|||||||
|
|
||||||
public boolean canBypassPlayerLimit(GameProfile profile) {
|
public boolean canBypassPlayerLimit(GameProfile profile) {
|
||||||
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 e6bbcfed42233a31b72533c1f45b88b401b273a3..c599b8196d0eb72290081a533e5651448269d8ca 100644
|
index f8d45c1076852a0553c3dd7c5512f76a6891e2cb..1f50aca05ff1adf8f2e16cab2fac757a7094e1b8 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
|
||||||
@@ -1432,7 +1432,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -1454,7 +1454,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paper start - optimise collisions
|
// Paper start - optimise collisions
|
||||||
@@ -312,10 +312,10 @@ index e6bbcfed42233a31b72533c1f45b88b401b273a3..c599b8196d0eb72290081a533e565144
|
|||||||
final boolean yZero = movement.y == 0.0;
|
final boolean yZero = movement.y == 0.0;
|
||||||
final boolean zZero = movement.z == 0.0;
|
final boolean zZero = movement.z == 0.0;
|
||||||
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 a0813aa9ebf5b32375b1bc9f294d8fc34cc867fe..4ff40881c2d58881497794d2abb6efbfcd53d524 100644
|
index 2046c4d3ad5ea3254ad6bc83e6437e5c237c92b6..2fe76bc1c26423ed5e39453ac1b27a2cc66b1f2e 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
|
||||||
@@ -186,7 +186,7 @@ public abstract class Player extends LivingEntity {
|
@@ -196,7 +196,7 @@ public abstract class Player extends LivingEntity {
|
||||||
private int lastLevelUpTime;
|
private int lastLevelUpTime;
|
||||||
public GameProfile gameProfile;
|
public GameProfile gameProfile;
|
||||||
private boolean reducedDebugInfo;
|
private boolean reducedDebugInfo;
|
||||||
@@ -324,7 +324,7 @@ index a0813aa9ebf5b32375b1bc9f294d8fc34cc867fe..4ff40881c2d58881497794d2abb6efbf
|
|||||||
private final ItemCooldowns cooldowns = this.createItemCooldowns();
|
private final ItemCooldowns cooldowns = this.createItemCooldowns();
|
||||||
private Optional<GlobalPos> lastDeathLocation = Optional.empty();
|
private Optional<GlobalPos> lastDeathLocation = Optional.empty();
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -347,6 +347,12 @@ public abstract class Player extends LivingEntity {
|
@@ -362,6 +362,12 @@ public abstract class Player extends LivingEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ index a0813aa9ebf5b32375b1bc9f294d8fc34cc867fe..4ff40881c2d58881497794d2abb6efbf
|
|||||||
@Override
|
@Override
|
||||||
protected float getMaxHeadRotationRelativeToBody() {
|
protected float getMaxHeadRotationRelativeToBody() {
|
||||||
return this.isBlocking() ? 15.0F : super.getMaxHeadRotationRelativeToBody();
|
return this.isBlocking() ? 15.0F : super.getMaxHeadRotationRelativeToBody();
|
||||||
@@ -658,7 +664,7 @@ public abstract class Player extends LivingEntity {
|
@@ -664,7 +670,7 @@ public abstract class Player extends LivingEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,7 +346,7 @@ index a0813aa9ebf5b32375b1bc9f294d8fc34cc867fe..4ff40881c2d58881497794d2abb6efbf
|
|||||||
entity.playerTouch(this);
|
entity.playerTouch(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1347,7 +1353,7 @@ public abstract class Player extends LivingEntity {
|
@@ -1287,7 +1293,7 @@ public abstract class Player extends LivingEntity {
|
||||||
this.sweepAttack();
|
this.sweepAttack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ index a0813aa9ebf5b32375b1bc9f294d8fc34cc867fe..4ff40881c2d58881497794d2abb6efbf
|
|||||||
boolean cancelled = false;
|
boolean cancelled = false;
|
||||||
org.bukkit.entity.Player player = (org.bukkit.entity.Player) target.getBukkitEntity();
|
org.bukkit.entity.Player player = (org.bukkit.entity.Player) target.getBukkitEntity();
|
||||||
diff --git a/net/minecraft/world/entity/projectile/FishingHook.java b/net/minecraft/world/entity/projectile/FishingHook.java
|
diff --git a/net/minecraft/world/entity/projectile/FishingHook.java b/net/minecraft/world/entity/projectile/FishingHook.java
|
||||||
index 1e012c7ef699a64ff3f1b00f897bb893ab25ecbd..f2bf0cdbd29438ca51b74ae2fcdf49dba0d52804 100644
|
index ca5cd9354d53c6c05bd7ba50c6e1dbd1ed548f67..f82f37d498f99ce38f72a63d051721c6dab9f2ca 100644
|
||||||
--- a/net/minecraft/world/entity/projectile/FishingHook.java
|
--- a/net/minecraft/world/entity/projectile/FishingHook.java
|
||||||
+++ b/net/minecraft/world/entity/projectile/FishingHook.java
|
+++ b/net/minecraft/world/entity/projectile/FishingHook.java
|
||||||
@@ -55,7 +55,7 @@ public class FishingHook extends Projectile {
|
@@ -55,7 +55,7 @@ public class FishingHook extends Projectile {
|
||||||
@@ -369,10 +369,10 @@ index 1e012c7ef699a64ff3f1b00f897bb893ab25ecbd..f2bf0cdbd29438ca51b74ae2fcdf49db
|
|||||||
public int timeUntilHooked;
|
public int timeUntilHooked;
|
||||||
public float fishAngle;
|
public float fishAngle;
|
||||||
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 acca8c51d2030c675c157b10d0bbc6af631afe61..b4721c4e81cc2ae989765d86bd51ebf0be41758c 100644
|
index 813417a09b4acc7d57e80a53d970767e230d75b1..2a4763c951ddc78c9d8a39e661e59bbffc5cf109 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
|
||||||
@@ -375,6 +375,7 @@ public abstract class AbstractContainerMenu {
|
@@ -376,6 +376,7 @@ public abstract class AbstractContainerMenu {
|
||||||
|
|
||||||
private void doClick(int slotId, int button, ClickType clickType, Player player) {
|
private void doClick(int slotId, int button, ClickType clickType, Player player) {
|
||||||
Inventory inventory = player.getInventory();
|
Inventory inventory = player.getInventory();
|
||||||
@@ -380,7 +380,7 @@ index acca8c51d2030c675c157b10d0bbc6af631afe61..b4721c4e81cc2ae989765d86bd51ebf0
|
|||||||
if (clickType == ClickType.QUICK_CRAFT) {
|
if (clickType == ClickType.QUICK_CRAFT) {
|
||||||
int i = this.quickcraftStatus;
|
int i = this.quickcraftStatus;
|
||||||
this.quickcraftStatus = getQuickcraftHeader(button);
|
this.quickcraftStatus = getQuickcraftHeader(button);
|
||||||
@@ -651,6 +652,22 @@ public abstract class AbstractContainerMenu {
|
@@ -652,6 +653,22 @@ public abstract class AbstractContainerMenu {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,7 +394,7 @@ index acca8c51d2030c675c157b10d0bbc6af631afe61..b4721c4e81cc2ae989765d86bd51ebf0
|
|||||||
+ ItemStack itemStack = slot.getItem();
|
+ ItemStack itemStack = slot.getItem();
|
||||||
+ net.minecraft.world.item.component.CustomData customData = itemStack.get(net.minecraft.core.component.DataComponents.CUSTOM_DATA);
|
+ net.minecraft.world.item.component.CustomData customData = itemStack.get(net.minecraft.core.component.DataComponents.CUSTOM_DATA);
|
||||||
+ if (customData != null && customData.contains("Leaves.Gui.Placeholder")) {
|
+ if (customData != null && customData.contains("Leaves.Gui.Placeholder")) {
|
||||||
+ return !customData.copyTag().getBoolean("Leaves.Gui.Placeholder");
|
+ return !customData.copyTag().getBoolean("Leaves.Gui.Placeholder").orElse(false);
|
||||||
+ }
|
+ }
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
@@ -404,10 +404,10 @@ index acca8c51d2030c675c157b10d0bbc6af631afe61..b4721c4e81cc2ae989765d86bd51ebf0
|
|||||||
FeatureFlagSet featureFlagSet = player.level().enabledFeatures();
|
FeatureFlagSet featureFlagSet = player.level().enabledFeatures();
|
||||||
return carriedItem.isItemEnabled(featureFlagSet) && carriedItem.overrideStackedOnOther(slot, action, player)
|
return carriedItem.isItemEnabled(featureFlagSet) && carriedItem.overrideStackedOnOther(slot, action, player)
|
||||||
diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
index ee2f8e8deb35059824b5730a1442f383dc79f01c..190377ccd52458c6b490fad25983fe992b0aa0da 100644
|
index 1669b76800756000a2f620610b3c8c8b6c48dd4a..8449545bd5278f5558567dd6b7c1522f63045f22 100644
|
||||||
--- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
--- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
+++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
@@ -132,7 +132,7 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
@@ -136,7 +136,7 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,21 +417,19 @@ index ee2f8e8deb35059824b5730a1442f383dc79f01c..190377ccd52458c6b490fad25983fe99
|
|||||||
double d1 = deltaMovement.x;
|
double d1 = deltaMovement.x;
|
||||||
double d2 = deltaMovement.y;
|
double d2 = deltaMovement.y;
|
||||||
diff --git a/net/minecraft/world/level/levelgen/PhantomSpawner.java b/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
diff --git a/net/minecraft/world/level/levelgen/PhantomSpawner.java b/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||||
index 11d25e64349b27bf54dc1620e4cce444c79f581c..82d9d53ef0aa57342173af29d14d00e4039fb583 100644
|
index d2e674b046bcf82a239b4706c3b89197ec6749c8..8e2c18fdb76ae6ea7402e6862a64c96db03f191a 100644
|
||||||
--- a/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
--- a/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||||
+++ b/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
+++ b/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
||||||
@@ -57,6 +57,13 @@ public class PhantomSpawner implements CustomSpawner {
|
@@ -48,6 +48,11 @@ public class PhantomSpawner implements CustomSpawner {
|
||||||
ServerStatsCounter stats = serverPlayer.getStats();
|
ServerStatsCounter stats = serverPlayer.getStats();
|
||||||
int i1 = Mth.clamp(stats.getValue(Stats.CUSTOM.get(Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE);
|
int i = Mth.clamp(stats.getValue(Stats.CUSTOM.get(Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE);
|
||||||
int i2 = 24000;
|
int i1 = 24000;
|
||||||
+
|
|
||||||
+ // Leaves start - fakeplayer spawn
|
+ // Leaves start - fakeplayer spawn
|
||||||
+ if (serverPlayer instanceof org.leavesmc.leaves.bot.ServerBot bot && bot.getConfigValue(org.leavesmc.leaves.bot.agent.Configs.SPAWN_PHANTOM)) {
|
+ if (serverPlayer instanceof org.leavesmc.leaves.bot.ServerBot bot && bot.getConfigValue(org.leavesmc.leaves.bot.agent.Configs.SPAWN_PHANTOM)) {
|
||||||
+ i1 = Math.max(bot.notSleepTicks, 1);
|
+ i1 = Math.max(bot.notSleepTicks, 1);
|
||||||
+ }
|
+ }
|
||||||
+ // Leaves end - fakeplayer spawn
|
+ // Leaves end - fakeplayer spawn
|
||||||
+
|
if (randomSource.nextInt(i) >= 72000) {
|
||||||
if (randomSource.nextInt(i1) >= level.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper - Ability to control player's insomnia and phantoms
|
|
||||||
BlockPos blockPos1 = blockPos.above(20 + randomSource.nextInt(15))
|
BlockPos blockPos1 = blockPos.above(20 + randomSource.nextInt(15))
|
||||||
.east(-10 + randomSource.nextInt(21))
|
.east(-10 + randomSource.nextInt(21))
|
||||||
diff --git a/net/minecraft/world/level/storage/LevelResource.java b/net/minecraft/world/level/storage/LevelResource.java
|
diff --git a/net/minecraft/world/level/storage/LevelResource.java b/net/minecraft/world/level/storage/LevelResource.java
|
||||||
@@ -448,11 +446,11 @@ index bef794c3f58c41d910aa0bcc63fbdeea7225fddf..a601da588e6973cc5b87d3e3eeba49b5
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/storage/PlayerDataStorage.java b/net/minecraft/world/level/storage/PlayerDataStorage.java
|
diff --git a/net/minecraft/world/level/storage/PlayerDataStorage.java b/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||||
index c44110b123ba5912af18faf0065e9ded780da9b7..e9da7206f9508bb2597f1b6ba8e52fa81e993a10 100644
|
index ab9282c04c1996b037567d07f95e2b150bcfcd38..91f2e0abd1e6d5ad1613b8f750a900bfc39b2f9e 100644
|
||||||
--- a/net/minecraft/world/level/storage/PlayerDataStorage.java
|
--- a/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||||
+++ b/net/minecraft/world/level/storage/PlayerDataStorage.java
|
+++ b/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||||
@@ -20,7 +20,7 @@ import net.minecraft.world.entity.player.Player;
|
@@ -18,7 +18,7 @@ import net.minecraft.util.datafix.DataFixTypes;
|
||||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
-public class PlayerDataStorage {
|
-public class PlayerDataStorage {
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Make shears in dispenser can unlimited use
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
diff --git a/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||||
index 626e9feb6a6e7a2cbc7c63e30ba4fb6b923e85c7..e8622aed7c59c15ecf73901e610688778dee56fc 100644
|
index c1bd6d91cf9828ccc7275efe0f5c959c0f457c13..34eef95855032655a97f246cc56eb3006eebae19 100644
|
||||||
--- a/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
--- a/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||||
+++ b/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
+++ b/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||||
@@ -46,7 +46,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
|
@@ -44,7 +44,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
|
||||||
if (!serverLevel.isClientSide()) {
|
if (!serverLevel.isClientSide()) {
|
||||||
BlockPos blockPos = blockSource.pos().relative(blockSource.state().getValue(DispenserBlock.FACING));
|
BlockPos blockPos = blockSource.pos().relative(blockSource.state().getValue(DispenserBlock.FACING));
|
||||||
this.setSuccess(tryShearBeehive(serverLevel, blockPos) || tryShearLivingEntity(serverLevel, blockPos, item, bukkitBlock, craftItem)); // CraftBukkit
|
this.setSuccess(tryShearBeehive(serverLevel, blockPos) || tryShearLivingEntity(serverLevel, blockPos, item, bukkitBlock, craftItem)); // CraftBukkit
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Redstone Shears Wrench
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/item/ShearsItem.java b/net/minecraft/world/item/ShearsItem.java
|
diff --git a/net/minecraft/world/item/ShearsItem.java b/net/minecraft/world/item/ShearsItem.java
|
||||||
index 9140b41f2ffef897b74792c916e8320a9a7afb7c..0f4f970071a289209eb8131d289e23426d53e818 100644
|
index 8cf3e51e12f9cf98836657e722edb23943f9e866..813a6d2bfe99ad8ddf81d7dfca51a7544b5fef0d 100644
|
||||||
--- a/net/minecraft/world/item/ShearsItem.java
|
--- a/net/minecraft/world/item/ShearsItem.java
|
||||||
+++ b/net/minecraft/world/item/ShearsItem.java
|
+++ b/net/minecraft/world/item/ShearsItem.java
|
||||||
@@ -23,6 +23,22 @@ import net.minecraft.world.level.block.GrowingPlantHeadBlock;
|
@@ -24,6 +24,22 @@ import net.minecraft.world.level.block.GrowingPlantHeadBlock;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.gameevent.GameEvent;
|
import net.minecraft.world.level.gameevent.GameEvent;
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ index 9140b41f2ffef897b74792c916e8320a9a7afb7c..0f4f970071a289209eb8131d289e2342
|
|||||||
public class ShearsItem extends Item {
|
public class ShearsItem extends Item {
|
||||||
public ShearsItem(Item.Properties properties) {
|
public ShearsItem(Item.Properties properties) {
|
||||||
super(properties);
|
super(properties);
|
||||||
@@ -81,7 +97,68 @@ public class ShearsItem extends Item {
|
@@ -80,7 +96,68 @@ public class ShearsItem extends Item {
|
||||||
|
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add isShrink to EntityResurrectEvent
|
|||||||
|
|
||||||
|
|
||||||
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 d87e31572aa85bffc62dc017520dd408560f79b4..e34f50a5f488ab676622b6c922577009c3a7f4c8 100644
|
index 3e8f4f3c3d43c6875108295187023c48eece2788..5fc4d97ef421a37158b01864b035385bb7bf5f5f 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
|
||||||
@@ -1595,14 +1595,14 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -1701,14 +1701,14 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
}
|
}
|
||||||
|
|
||||||
final org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
|
final org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
|
||||||
@@ -5,12 +5,12 @@ Subject: [PATCH] Budding Amethyst can push by piston
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
|
diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
|
||||||
index 976de81d65b6494cdad20f4ec5125fceec86f951..37f561ae2eca0d118c63f519fabdcfe9cb710826 100644
|
index ae3e6e31171b1bcfba1ae51a0941b52dda270acd..f289e37f77e1c9d3b0f6c29da1b99f0d5f156e37 100644
|
||||||
--- a/net/minecraft/world/level/block/Block.java
|
--- a/net/minecraft/world/level/block/Block.java
|
||||||
+++ b/net/minecraft/world/level/block/Block.java
|
+++ b/net/minecraft/world/level/block/Block.java
|
||||||
@@ -557,6 +557,13 @@ public class Block extends BlockBehaviour implements ItemLike {
|
@@ -610,6 +610,13 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||||
}
|
}
|
||||||
// Spigot end
|
// CraftBukkit end
|
||||||
|
|
||||||
+ // Leaves start - reset push reaction
|
+ // Leaves start - reset push reaction
|
||||||
+ @org.jetbrains.annotations.Nullable
|
+ @org.jetbrains.annotations.Nullable
|
||||||
@@ -23,7 +23,7 @@ index 976de81d65b6494cdad20f4ec5125fceec86f951..37f561ae2eca0d118c63f519fabdcfe9
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
diff --git a/net/minecraft/world/level/block/BuddingAmethystBlock.java b/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
diff --git a/net/minecraft/world/level/block/BuddingAmethystBlock.java b/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
||||||
index f6850d3ab54a6eb4ff718d861f39aac2facd3a88..5f51b4689b0ea92eb7e4e5e42e9eb5538930d60d 100644
|
index 9fc8e9e2b168954c8377bd1a8cf57f49fa137213..18b3ab3bfa4effed9ff22e5156349d86c7881849 100644
|
||||||
--- a/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
--- a/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
+++ b/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
||||||
@@ -58,4 +58,12 @@ public class BuddingAmethystBlock extends AmethystBlock {
|
@@ -58,4 +58,12 @@ public class BuddingAmethystBlock extends AmethystBlock {
|
||||||
@@ -40,10 +40,10 @@ index f6850d3ab54a6eb4ff718d861f39aac2facd3a88..5f51b4689b0ea92eb7e4e5e42e9eb553
|
|||||||
+ // Leaves end - budding amethyst can push by piston
|
+ // Leaves end - budding amethyst can push by piston
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java
|
diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
index 5473b4006f7e0266ea11a7b05cef78a113c30d97..a37a5528b36ebade8b0e3fe570c6d4819ab1cfbf 100644
|
index 834e27ef2f7b342b074ff9e1e390e02f3ca1c399..bbb1abfbfe7afd7b631cf269c1e338697cd016d2 100644
|
||||||
--- a/net/minecraft/world/level/block/state/BlockBehaviour.java
|
--- a/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
+++ b/net/minecraft/world/level/block/state/BlockBehaviour.java
|
+++ b/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
@@ -766,7 +766,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
@@ -763,7 +763,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PushReaction getPistonPushReaction() {
|
public PushReaction getPistonPushReaction() {
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Spectator dont get Advancement
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
|
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
|
||||||
index 459e59c370a729dfeed3872f3a5984dd3da96abe..4e9ce0c8b459ef41a6945182401c47c61b16b1f7 100644
|
index f56a3fb47aa34c39cbd0e0e4e47d924da1488d7a..82fb9c61ce97c2e88a3252068bb28eb40bda0273 100644
|
||||||
--- a/net/minecraft/server/PlayerAdvancements.java
|
--- a/net/minecraft/server/PlayerAdvancements.java
|
||||||
+++ b/net/minecraft/server/PlayerAdvancements.java
|
+++ b/net/minecraft/server/PlayerAdvancements.java
|
||||||
@@ -168,6 +168,11 @@ public class PlayerAdvancements {
|
@@ -168,6 +168,11 @@ public class PlayerAdvancements {
|
||||||
@@ -5,16 +5,17 @@ Subject: [PATCH] Stick can change ArmorStand arm status
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/decoration/ArmorStand.java b/net/minecraft/world/entity/decoration/ArmorStand.java
|
diff --git a/net/minecraft/world/entity/decoration/ArmorStand.java b/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||||
index a3cc0001a949597e345d7919c3f6109fa4a949ad..dfae614a67476d649be2a8c2cd8258abe12842e3 100644
|
index 6f601a0a300bbf01f77d835576d15e25c8ba10b8..9ef422c34a70367f4dcee50b51a17143d14f131c 100644
|
||||||
--- a/net/minecraft/world/entity/decoration/ArmorStand.java
|
--- a/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||||
+++ b/net/minecraft/world/entity/decoration/ArmorStand.java
|
+++ b/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||||
@@ -341,6 +341,12 @@ public class ArmorStand extends LivingEntity {
|
@@ -270,6 +270,13 @@ public class ArmorStand extends LivingEntity {
|
||||||
return InteractionResult.SUCCESS_SERVER;
|
return InteractionResult.SUCCESS_SERVER;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
+ // Leaves start - stick can change ArmorStand arm status
|
+ // Leaves start - stick can change ArmorStand arm status
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.modify.stickChangeArmorStandArmStatus && itemInHand.is(Items.STICK) && player.isShiftKeyDown()) {
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.stickChangeArmorStandArmStatus && itemInHand.is(Items.STICK) && player.isShiftKeyDown()) {
|
||||||
+ setShowArms(!showArms());
|
+ setShowArms(!showArms());
|
||||||
|
+ return InteractionResult.FAIL;
|
||||||
+ }
|
+ }
|
||||||
+ // Leaves end - stick can change ArmorStand arm status
|
+ // Leaves end - stick can change ArmorStand arm status
|
||||||
+
|
+
|
||||||
@@ -5,32 +5,24 @@ Subject: [PATCH] Configurable MC-59471
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/block/TripWireHookBlock.java b/net/minecraft/world/level/block/TripWireHookBlock.java
|
diff --git a/net/minecraft/world/level/block/TripWireHookBlock.java b/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||||
index 9aace993c6c18f1a50610e4766225485984b8167..dee8bd2a22be8639f8faec428a5ca3a1ecc1d356 100644
|
index 8a3a8b0fdf9545a41501dc992c6982d9c8ce7b66..a92462c76a648e6c175b8c2ef3e925aba81ba774 100644
|
||||||
--- a/net/minecraft/world/level/block/TripWireHookBlock.java
|
--- a/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/TripWireHookBlock.java
|
+++ b/net/minecraft/world/level/block/TripWireHookBlock.java
|
||||||
@@ -201,7 +201,6 @@ public class TripWireHookBlock extends Block {
|
@@ -200,10 +200,17 @@ public class TripWireHookBlock extends Block {
|
||||||
if (!cancelledEmitterHook) { // Paper - Call BlockRedstoneEvent
|
|
||||||
emitState(level, pos, flag2, flag3, flag, flag1);
|
|
||||||
if (!attaching) {
|
|
||||||
- if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.skipTripwireHookPlacementValidation || level.getBlockState(pos).is(Blocks.TRIPWIRE_HOOK)) // Paper - Validate tripwire hook placement before update
|
|
||||||
level.setBlock(pos, blockState1.setValue(FACING, direction), 3);
|
|
||||||
if (shouldNotifyNeighbours) {
|
|
||||||
notifyNeighbors(block, level, pos, direction);
|
|
||||||
@@ -214,10 +213,17 @@ public class TripWireHookBlock extends Block {
|
|
||||||
BlockPos blockPos1 = pos.relative(direction, i2);
|
BlockPos blockPos1 = pos.relative(direction, i2);
|
||||||
BlockState blockState2 = blockStates[i2];
|
BlockState blockState2 = blockStates[i2];
|
||||||
if (blockState2 != null) {
|
if (blockState2 != null) {
|
||||||
- BlockState blockState3 = level.getBlockState(blockPos1);
|
- BlockState blockState3 = level.getBlockState(blockPos1);
|
||||||
- if (blockState3.is(Blocks.TRIPWIRE) || blockState3.is(Blocks.TRIPWIRE_HOOK)) {
|
- if (blockState3.is(Blocks.TRIPWIRE) || blockState3.is(Blocks.TRIPWIRE_HOOK)) {
|
||||||
- if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates || !blockState3.is(Blocks.TRIPWIRE)) level.setBlock(blockPos1, blockState2.trySetValue(ATTACHED, Boolean.valueOf(flag2)), 3); // Paper - prevent tripwire from updating
|
- if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates || !blockState3.is(Blocks.TRIPWIRE)) level.setBlock(blockPos1, blockState2.trySetValue(ATTACHED, flag2), 3); // Paper - prevent tripwire from updating
|
||||||
+ // Leaves start - MC-59471
|
+ // Leaves start - MC-59471
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.stringTripwireHookDuplicate) {
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.tripwire.stringTripwireHookDuplicate) {
|
||||||
+ level.setBlock(blockPos1, blockState2.trySetValue(ATTACHED, flag2), 3);
|
+ level.setBlock(blockPos1, blockState2.trySetValue(ATTACHED, flag2), 3);
|
||||||
+ level.getBlockState(blockPos1);
|
+ level.getBlockState(blockPos1);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ BlockState blockState3 = level.getBlockState(blockPos1);
|
+ BlockState blockState3 = level.getBlockState(blockPos1);
|
||||||
+ if (blockState3.is(Blocks.TRIPWIRE) || blockState3.is(Blocks.TRIPWIRE_HOOK)) {
|
+ if (blockState3.is(Blocks.TRIPWIRE) || blockState3.is(Blocks.TRIPWIRE_HOOK)) {
|
||||||
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates || !blockState3.is(Blocks.TRIPWIRE)) level.setBlock(blockPos1, blockState2.trySetValue(ATTACHED, Boolean.valueOf(flag2)), 3); // Paper - prevent tripwire from updating
|
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates || !blockState3.is(Blocks.TRIPWIRE)) level.setBlock(blockPos1, blockState2.trySetValue(ATTACHED, flag2), 3); // Paper - prevent tripwire from updating
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
+ // Leaves end - MC-59471
|
+ // Leaves end - MC-59471
|
||||||
@@ -28,7 +28,7 @@ index 47cb25aa9c37bd84d156288c397321009f1d9ae2..a94981882ac37ea215df3a71117d4a9b
|
|||||||
buffer.writeCollection(this.entries, (buffer1, entry) -> entry.write(buffer1));
|
buffer.writeCollection(this.entries, (buffer1, entry) -> entry.write(buffer1));
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/network/FriendlyByteBuf.java b/net/minecraft/network/FriendlyByteBuf.java
|
diff --git a/net/minecraft/network/FriendlyByteBuf.java b/net/minecraft/network/FriendlyByteBuf.java
|
||||||
index d1daa3443446f47e2215f0c7c5823da58e053bab..60b39a320b795a320a28fd9c003ee948a0cc0208 100644
|
index 7da7d645f83f351e8c964da01734f3074a877ca1..a9d37c540397b5e24721b3eba47e2d5b2577579f 100644
|
||||||
--- a/net/minecraft/network/FriendlyByteBuf.java
|
--- a/net/minecraft/network/FriendlyByteBuf.java
|
||||||
+++ b/net/minecraft/network/FriendlyByteBuf.java
|
+++ b/net/minecraft/network/FriendlyByteBuf.java
|
||||||
@@ -118,6 +118,14 @@ public class FriendlyByteBuf extends ByteBuf {
|
@@ -118,6 +118,14 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||||
@@ -91,10 +91,10 @@ index 1df628ac0b414511aaed6e09d78f884c4170f730..b92081d70ffeec47c304e553ce1aea0a
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
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 529a2caa2cde82bfdea7c173768fee32f5f21e49..a8775acd67db19ad671d2de252c0c553ee9f90ca 100644
|
index e56f26fc504538d88bfa1954e929ee44fd31d657..e4946438d0c1fb9d2be616cb95768f890b32f286 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
|
||||||
@@ -616,7 +616,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -574,7 +574,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
// Paper start - Add setting for proxy online mode status
|
// Paper start - Add setting for proxy online mode status
|
||||||
return properties.enforceSecureProfile
|
return properties.enforceSecureProfile
|
||||||
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
||||||
@@ -104,10 +104,10 @@ index 529a2caa2cde82bfdea7c173768fee32f5f21e49..a8775acd67db19ad671d2de252c0c553
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 ba6338037f04a35a9f8c93cdb1e4b9d53c1a7925..888cecc9a91587ddb01deac698ff4c25b1242516 100644
|
index ac5ef04fae4bc19bae9007c0ffd8f688434d22d7..649aeec6954d26cb67827e99c4b5b736f4f5bef4 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
|
||||||
@@ -288,10 +288,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
@@ -294,10 +294,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
}
|
}
|
||||||
|
|
||||||
public void send(Packet<?> packet) {
|
public void send(Packet<?> packet) {
|
||||||
@@ -133,13 +133,13 @@ index ba6338037f04a35a9f8c93cdb1e4b9d53c1a7925..888cecc9a91587ddb01deac698ff4c25
|
|||||||
if (packet == null || this.processedDisconnect) { // Spigot
|
if (packet == null || this.processedDisconnect) { // Spigot
|
||||||
return;
|
return;
|
||||||
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 bd7ae7aba1802f202ea09cb1064832092da30c4b..43759c08630fce13199cc3dda1841c52088b615e 100644
|
index 012574f56d9d7e6340c8b7bf7bee43e36d99df65..ffa92892ab4e1e079fa058a270877a9654624875 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
|
||||||
@@ -1320,7 +1320,7 @@ public abstract class PlayerList {
|
@@ -1336,7 +1336,7 @@ public abstract class PlayerList {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
public boolean verifyChatTrusted(PlayerChatMessage message) {
|
||||||
- return message.hasSignature() && !message.hasExpiredServer(Instant.now());
|
- return message.hasSignature() && !message.hasExpiredServer(Instant.now());
|
||||||
+ return org.leavesmc.leaves.LeavesConfig.mics.noChatSign || (message.hasSignature() && !message.hasExpiredServer(Instant.now())); // Leaves - No Not Secure
|
+ return org.leavesmc.leaves.LeavesConfig.mics.noChatSign || (message.hasSignature() && !message.hasExpiredServer(Instant.now())); // Leaves - No Not Secure
|
||||||
}
|
}
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Dont send useless entity packets
|
|||||||
This patch is Powered by Purpur(https://github.com/PurpurMC/Purpur)
|
This patch is Powered by Purpur(https://github.com/PurpurMC/Purpur)
|
||||||
|
|
||||||
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 0fb253aa55a24b56b17f524b3261c5b75c7d7e59..f2974a0f49711d17c349fdfa8f57d3a4706ff0ca 100644
|
index b118e91f1e0b5a8b8c0b2a4a32faabc5a34a5954..7681195587d361acf524d09ad3958e628aad73b6 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
|
||||||
@@ -186,6 +186,11 @@ public class ServerEntity {
|
@@ -196,6 +196,11 @@ public class ServerEntity {
|
||||||
} else if (flag) {
|
} else if (flag) {
|
||||||
packet = new ClientboundMoveEntityPacket.Rot(this.entity.getId(), b, b1, this.entity.onGround());
|
packet = new ClientboundMoveEntityPacket.Rot(this.entity.getId(), b, b1, this.entity.onGround());
|
||||||
flag4 = true;
|
flag4 = true;
|
||||||
@@ -21,8 +21,8 @@ index 0fb253aa55a24b56b17f524b3261c5b75c7d7e59..f2974a0f49711d17c349fdfa8f57d3a4
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
packet = new ClientboundMoveEntityPacket.PosRot(this.entity.getId(), (short)l, (short)l1, (short)l2, b, b1, this.entity.onGround());
|
packet = new ClientboundMoveEntityPacket.PosRot(this.entity.getId(), (short)l, (short)l1, (short)l2, b, b1, this.entity.onGround());
|
||||||
@@ -302,6 +307,21 @@ public class ServerEntity {
|
@@ -315,6 +320,21 @@ public class ServerEntity {
|
||||||
return currentPassengers.stream().filter(entity -> !initialPassengers.contains(entity));
|
this.positionCodec.setBase(this.entity.position());
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Leaves start - dont send useless entity packets
|
+ // Leaves start - dont send useless entity packets
|
||||||
@@ -31,9 +31,9 @@ index 0fb253aa55a24b56b17f524b3261c5b75c7d7e59..f2974a0f49711d17c349fdfa8f57d3a4
|
|||||||
+ if (possibleUselessPacket instanceof ClientboundMoveEntityPacket.Pos) {
|
+ if (possibleUselessPacket instanceof ClientboundMoveEntityPacket.Pos) {
|
||||||
+ return packet.getXa() == 0 && packet.getYa() == 0 && packet.getZa() == 0;
|
+ return packet.getXa() == 0 && packet.getYa() == 0 && packet.getZa() == 0;
|
||||||
+ } else if (possibleUselessPacket instanceof ClientboundMoveEntityPacket.PosRot) {
|
+ } else if (possibleUselessPacket instanceof ClientboundMoveEntityPacket.PosRot) {
|
||||||
+ return packet.getXa() == 0 && packet.getYa() == 0 && packet.getZa() == 0 && packet.getyRot() == 0 && packet.getxRot() == 0;
|
+ return packet.getXa() == 0 && packet.getYa() == 0 && packet.getZa() == 0 && packet.getYRot() == 0 && packet.getXRot() == 0;
|
||||||
+ } else if (possibleUselessPacket instanceof ClientboundMoveEntityPacket.Rot) {
|
+ } else if (possibleUselessPacket instanceof ClientboundMoveEntityPacket.Rot) {
|
||||||
+ return packet.getyRot() == 0 && packet.getxRot() == 0;
|
+ return packet.getYRot() == 0 && packet.getXRot() == 0;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ return false;
|
+ return false;
|
||||||
@@ -6,19 +6,19 @@ Subject: [PATCH] Optimize suffocation
|
|||||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
|
||||||
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 985a6428f91c5834f36b5cea632af83f50f49f2d..144b756fede8afcb42015a4b155801d6c3715a45 100644
|
index 5fc4d97ef421a37158b01864b035385bb7bf5f5f..b5f6a76c977bbb5dbb06fb3dd654f0b01aaba692 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
|
||||||
@@ -452,7 +452,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -423,7 +423,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
if (this.isAlive()) {
|
|
||||||
|
if (this.isAlive() && this.level() instanceof ServerLevel serverLevel1) {
|
||||||
boolean flag = this instanceof Player;
|
boolean flag = this instanceof Player;
|
||||||
if (this.level() instanceof ServerLevel serverLevel1) {
|
|
||||||
- if (this.isInWall()) {
|
- if (this.isInWall()) {
|
||||||
+ if ((!org.leavesmc.leaves.LeavesConfig.performance.enableSuffocationOptimization || this instanceof WitherBoss || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) { // Leaves - optimize suffocation
|
+ if ((!org.leavesmc.leaves.LeavesConfig.performance.enableSuffocationOptimization || this instanceof WitherBoss || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) { // Leaves - optimize suffocation
|
||||||
this.hurtServer(serverLevel1, this.damageSources().inWall(), 1.0F);
|
this.hurtServer(serverLevel1, this.damageSources().inWall(), 1.0F);
|
||||||
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
} else if (flag && !serverLevel1.getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||||
double d = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
|
double d = serverLevel1.getWorldBorder().getDistanceToBorder(this) + serverLevel1.getWorldBorder().getDamageSafeZone();
|
||||||
@@ -1359,6 +1359,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -1372,6 +1372,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
return this.getHealth() <= 0.0F;
|
return this.getHealth() <= 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Only check for spooky season once an hour
|
|||||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/ambient/Bat.java b/net/minecraft/world/entity/ambient/Bat.java
|
diff --git a/net/minecraft/world/entity/ambient/Bat.java b/net/minecraft/world/entity/ambient/Bat.java
|
||||||
index 5ebe7b1dce367d5c5e1136b97b2b9f6737595201..54e59c1fdc9c189b9c6fb620444aeb3d08fde67a 100644
|
index eb9fb57440f498079182030a46034008d3f6b5e8..5f0ddf96e8ca1bb32c773f11232dedd1a981fde9 100644
|
||||||
--- a/net/minecraft/world/entity/ambient/Bat.java
|
--- a/net/minecraft/world/entity/ambient/Bat.java
|
||||||
+++ b/net/minecraft/world/entity/ambient/Bat.java
|
+++ b/net/minecraft/world/entity/ambient/Bat.java
|
||||||
@@ -243,12 +243,30 @@ public class Bat extends AmbientCreature {
|
@@ -244,12 +244,30 @@ public class Bat extends AmbientCreature {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Config to disable method profiler
|
|||||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
|
||||||
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 073d4a57f78dc18e4cf95bdb852877b8624ec3f8..09fc1c1923f7cc4470cca3b703810fb165c4ca15 100644
|
index 940e6cb4b8f990e3c4ae8a5efc7adc56ffae28de..105c207b8db2c505f256f4104642af5929b50aa9 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
|
||||||
@@ -1249,7 +1249,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1247,7 +1247,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
lastTick = currentTime;
|
lastTick = currentTime;
|
||||||
this.nextTickTimeNanos += l;
|
this.nextTickTimeNanos += l;
|
||||||
|
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Throttle goal selector during inactive ticking
|
|||||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
|
||||||
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 1ed07fd23985a6bf8cf8300f74c92b7531a79fc6..b694ea0a5fee852c31ff503a42e50a999c5a287b 100644
|
index 73ba442b9d39bc021cd5eb6c1c0f98aed94a5a02..c83ad2553145b66aad000be3b82fec57f56359ce 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
|
||||||
@@ -215,11 +215,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
@@ -203,11 +203,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
return this.lookControl;
|
return this.lookControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Reduce entity allocations
|
|||||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
|
||||||
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 4c808c7ef336de74048f40bd1cc8b14131a9325d..22c315f936982e496d26a2846351969b32fe61e4 100644
|
index bed9b564c493cd84bf53fc49368fda736f3fbc2b..69ec8e21c96e26bafedcdd979fc9d050b1f3846f 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
|
||||||
@@ -23,9 +23,11 @@ public class AttributeMap {
|
@@ -18,9 +18,11 @@ public class AttributeMap {
|
||||||
private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
||||||
private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
||||||
private final AttributeSupplier supplier;
|
private final AttributeSupplier supplier;
|
||||||
@@ -21,7 +21,7 @@ index 4c808c7ef336de74048f40bd1cc8b14131a9325d..22c315f936982e496d26a2846351969b
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onAttributeModified(AttributeInstance instance) {
|
private void onAttributeModified(AttributeInstance instance) {
|
||||||
@@ -49,7 +51,13 @@ public class AttributeMap {
|
@@ -44,7 +46,13 @@ public class AttributeMap {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public AttributeInstance getInstance(Holder<Attribute> attribute) {
|
public AttributeInstance getInstance(Holder<Attribute> attribute) {
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Remove lambda from ticking guard
|
|||||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
|
||||||
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 9fba04e8a8e95546f7d7cc1210b4b324c86d2b87..30a543de1d8b454ffec0c6cd668aad3504cdf95d 100644
|
index b1821dc6bfdda93431e2f43d5de6ecc60901c757..26a20dea38628c7acd88f172a09b12af02a82d09 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
|
||||||
@@ -816,7 +816,24 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -806,7 +806,24 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
}
|
}
|
||||||
|
|
||||||
profilerFiller.push("tick");
|
profilerFiller.push("tick");
|
||||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Cache climbing check for activation
|
|||||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
|
||||||
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 bd888ef719b9bfc93bace0b1d0fb771ac659f515..4b552eca363396c7e4ccfbf25d7b826f1c8163bb 100644
|
index 2ebee223085fe7926c7f3e555df19ae69f36157e..40f83551c74b594aa5fda82ac67eec72c3cd4942 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
|
||||||
@@ -215,7 +215,7 @@ public final class ActivationRange {
|
@@ -215,7 +215,7 @@ public final class ActivationRange {
|
||||||
@@ -19,10 +19,10 @@ index bd888ef719b9bfc93bace0b1d0fb771ac659f515..4b552eca363396c7e4ccfbf25d7b826f
|
|||||||
}
|
}
|
||||||
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 144b756fede8afcb42015a4b155801d6c3715a45..2dd370bf00b5ddf133c946b6e4d37b00be3ca5a5 100644
|
index b5f6a76c977bbb5dbb06fb3dd654f0b01aaba692..108430b3934a6f9757e7be50d77e760bbade669c 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
|
||||||
@@ -2026,6 +2026,22 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -2094,6 +2094,22 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
return this.lastClimbablePos;
|
return this.lastClimbablePos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Reduce chunk loading & lookups
|
|||||||
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
||||||
|
|
||||||
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 4b5ffd278e0e9d47100e5452949e8d757bbfece4..e2f1623b977889d31407d060b8e0bf911a80049e 100644
|
index ab7f7846d3fc0252c6f71277b3e67d7a785a96b5..8ac90690bd3fb7b5bf8798a4ca5c900e8bc7acb3 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
|
||||||
@@ -309,11 +309,28 @@ public class EnderMan extends Monster implements NeutralMob {
|
@@ -300,11 +300,28 @@ 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);
|
||||||
|
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] InstantBlockUpdater Reintroduced
|
|||||||
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
|
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
|
||||||
|
|
||||||
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 2bbebb4335d927f240abcac67a5b423e38dc33d7..1c7f7747725f95fe3cb92d26745ada7a9784b407 100644
|
index 013ed7dbe2309f562f63e66203179a90566e8115..12a63f75d878fcdad83847b20f5a57f7936c7779 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
|
||||||
@@ -888,7 +888,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -873,7 +873,13 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||||
this.thread = Thread.currentThread();
|
this.thread = Thread.currentThread();
|
||||||
this.biomeManager = new BiomeManager(this, biomeZoomSeed);
|
this.biomeManager = new BiomeManager(this, biomeZoomSeed);
|
||||||
this.isDebug = isDebug;
|
this.isDebug = isDebug;
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
||||||
Date: Mon, 3 Feb 2025 13:03:42 +0800
|
|
||||||
Subject: [PATCH] BBOR Protocol
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
|
||||||
index 43759c08630fce13199cc3dda1841c52088b615e..a79f83991aa50d45695beeeb018f203c6d7ae6d8 100644
|
|
||||||
--- a/net/minecraft/server/players/PlayerList.java
|
|
||||||
+++ b/net/minecraft/server/players/PlayerList.java
|
|
||||||
@@ -1443,6 +1443,7 @@ public abstract class PlayerList {
|
|
||||||
serverPlayer.connection.send(clientboundUpdateRecipesPacket);
|
|
||||||
serverPlayer.getRecipeBook().sendInitialRecipeBook(serverPlayer);
|
|
||||||
}
|
|
||||||
+ org.leavesmc.leaves.protocol.BBORProtocol.onDataPackReload(); // Leaves - bbor
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAllowCommandsForAllPlayers() {
|
|
||||||
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
|
||||||
index 761fdcd4a4e18f45547afd8edff44f61c6eeacb4..1776b79309ffd9a8a52f27a144606ed9a441251e 100644
|
|
||||||
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
|
||||||
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
|
||||||
@@ -739,6 +739,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
||||||
|
|
||||||
public void setLoaded(boolean loaded) {
|
|
||||||
this.loaded = loaded;
|
|
||||||
+ // Leaves start - bbor
|
|
||||||
+ if (loaded) {
|
|
||||||
+ org.leavesmc.leaves.protocol.BBORProtocol.onChunkLoaded(this);
|
|
||||||
+ }
|
|
||||||
+ // Leaves end - bbor
|
|
||||||
}
|
|
||||||
|
|
||||||
public Level getLevel() {
|
|
||||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Random flatten triangular distribution
|
|||||||
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
|
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
|
||||||
|
|
||||||
diff --git a/net/minecraft/util/RandomSource.java b/net/minecraft/util/RandomSource.java
|
diff --git a/net/minecraft/util/RandomSource.java b/net/minecraft/util/RandomSource.java
|
||||||
index 98a54bc4de251014342cda6d0951b7fea79ce553..17a79cef7dac1b407e4e62883b4a943d172fa6b9 100644
|
index 8516d47b0ba79d91638837199e7ae0fb6cb44a79..49a70e860eafdeca28ca3684a75bd3c8c4668b9c 100644
|
||||||
--- a/net/minecraft/util/RandomSource.java
|
--- a/net/minecraft/util/RandomSource.java
|
||||||
+++ b/net/minecraft/util/RandomSource.java
|
+++ b/net/minecraft/util/RandomSource.java
|
||||||
@@ -52,13 +52,25 @@ public interface RandomSource {
|
@@ -52,13 +52,25 @@ public interface RandomSource {
|
||||||
@@ -14,23 +14,23 @@ index 98a54bc4de251014342cda6d0951b7fea79ce553..17a79cef7dac1b407e4e62883b4a943d
|
|||||||
double nextGaussian();
|
double nextGaussian();
|
||||||
|
|
||||||
+ // Leaves start - flattenTriangularDistribution
|
+ // Leaves start - flattenTriangularDistribution
|
||||||
default double triangle(double center, double maxDeviation) {
|
default double triangle(double min, double max) {
|
||||||
- return center + maxDeviation * (this.nextDouble() - this.nextDouble());
|
- return min + max * (this.nextDouble() - this.nextDouble());
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.modify.flattenTriangularDistribution) {
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.flattenTriangularDistribution) {
|
||||||
+ this.nextDouble();
|
+ this.nextDouble();
|
||||||
+ return center + maxDeviation * (-1 + this.nextDouble() * 2);
|
+ return min + max * (-1 + this.nextDouble() * 2);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ return center + maxDeviation * (this.nextDouble() - this.nextDouble());
|
+ return min + max * (this.nextDouble() - this.nextDouble());
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
||||||
default float triangle(float center, float maxDeviation) {
|
default float triangle(float min, float max) {
|
||||||
- return center + maxDeviation * (this.nextFloat() - this.nextFloat());
|
- return min + max * (this.nextFloat() - this.nextFloat());
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.modify.flattenTriangularDistribution) {
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.flattenTriangularDistribution) {
|
||||||
+ this.nextFloat();
|
+ this.nextFloat();
|
||||||
+ return center + maxDeviation * (-1 + this.nextFloat() * 2);
|
+ return min + max * (-1 + this.nextFloat() * 2);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ return center + maxDeviation * (this.nextFloat() - this.nextFloat());
|
+ return min + max * (this.nextFloat() - this.nextFloat());
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
+ // Leaves end - flattenTriangularDistribution
|
+ // Leaves end - flattenTriangularDistribution
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||||
|
Date: Mon, 3 Feb 2025 13:03:42 +0800
|
||||||
|
Subject: [PATCH] BBOR Protocol
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
|
index 5d3fc807221392d378fec283bfdefb8747fb8376..bf731da711ce629c0f9250a7bd4025d363623773 100644
|
||||||
|
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
|
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
|
@@ -743,6 +743,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||||
|
|
||||||
|
public void setLoaded(boolean loaded) {
|
||||||
|
this.loaded = loaded;
|
||||||
|
+ // Leaves start - bbor
|
||||||
|
+ if (loaded) {
|
||||||
|
+ org.leavesmc.leaves.protocol.BBORProtocol.onChunkLoaded(this);
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - bbor
|
||||||
|
}
|
||||||
|
|
||||||
|
public Level getLevel() {
|
||||||
@@ -6,26 +6,28 @@ Subject: [PATCH] PCA sync protocol
|
|||||||
This patch is Powered by plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition)
|
This patch is Powered by plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
diff --git a/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||||
index d52a8315f1e6876c26c732f4c4caa47bc6bebf6e..8f287d11ab9ce493d34bf70780964c0f9a7faaa0 100644
|
index 7c473eea481f5e055cc70512027726f41f0c6f67..3165d1eaa46f2adceba28d4aef95fda3f05ee5e3 100644
|
||||||
--- a/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
--- a/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||||
+++ b/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
+++ b/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||||
@@ -422,6 +422,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
@@ -303,6 +303,13 @@ public abstract class AbstractHorse extends Animal implements HasCustomInventory
|
||||||
|
public void createInventory() {
|
||||||
@Override
|
SimpleContainer simpleContainer = this.inventory;
|
||||||
public void containerChanged(Container invBasic) {
|
this.inventory = new SimpleContainer(this.getInventorySize(), (org.bukkit.entity.AbstractHorse) this.getBukkitEntity()); // CraftBukkit
|
||||||
+ // Leaves start - pca
|
+ // Leaves start - pca
|
||||||
|
+ this.inventory.addListener(inv -> {
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) {
|
+ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) {
|
||||||
+ org.leavesmc.leaves.protocol.PcaSyncProtocol.syncEntityToClient(this);
|
+ org.leavesmc.leaves.protocol.PcaSyncProtocol.syncEntityToClient(this);
|
||||||
+ }
|
+ }
|
||||||
|
+ });
|
||||||
+ // Leaves end - pca
|
+ // Leaves end - pca
|
||||||
boolean isSaddled = this.isSaddled();
|
if (simpleContainer != null) {
|
||||||
this.syncSaddleToClients();
|
int min = Math.min(simpleContainer.getContainerSize(), this.inventory.getContainerSize());
|
||||||
if (this.tickCount > 20 && !isSaddled && this.isSaddled()) {
|
|
||||||
diff --git a/net/minecraft/world/entity/npc/AbstractVillager.java b/net/minecraft/world/entity/npc/AbstractVillager.java
|
diff --git a/net/minecraft/world/entity/npc/AbstractVillager.java b/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||||
index a71d16d968bb90fd7aca6f01a3dd56df4f9a7ce6..18a087a52070b9bdee4d02ff3fc6a3c063e444d4 100644
|
index 1d3381f1481bb2b192bb78462c85c2a185d94ad5..a375fad192cc09ba83775d5e37c1bb351730e6c4 100644
|
||||||
--- a/net/minecraft/world/entity/npc/AbstractVillager.java
|
--- a/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||||
+++ b/net/minecraft/world/entity/npc/AbstractVillager.java
|
+++ b/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||||
@@ -65,6 +65,15 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
@@ -48,6 +48,15 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
||||||
super(entityType, level);
|
super(entityType, level);
|
||||||
this.setPathfindingMalus(PathType.DANGER_FIRE, 16.0F);
|
this.setPathfindingMalus(PathType.DANGER_FIRE, 16.0F);
|
||||||
this.setPathfindingMalus(PathType.DAMAGE_FIRE, -1.0F);
|
this.setPathfindingMalus(PathType.DAMAGE_FIRE, -1.0F);
|
||||||
@@ -42,7 +44,7 @@ index a71d16d968bb90fd7aca6f01a3dd56df4f9a7ce6..18a087a52070b9bdee4d02ff3fc6a3c0
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
diff --git a/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||||
index 516b230769fb9ddaa49adca9b6aa64d4510810da..c279e2cdafbb710b799a730e5cf7056dd2142d3b 100644
|
index a7e2f23ed3279801504f99fc3c5f972e8c1b984f..4509b1a68273effa30d1befafc9104220d02fe8b 100644
|
||||||
--- a/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
--- a/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||||
+++ b/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
+++ b/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
|
||||||
@@ -64,6 +64,11 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
|
@@ -64,6 +64,11 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
|
||||||
@@ -58,10 +60,10 @@ index 516b230769fb9ddaa49adca9b6aa64d4510810da..c279e2cdafbb710b799a730e5cf7056d
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
index cb4b8567c029e3a53aafda2755e3773ea8b95af7..77e7188180cce9ef881de64b263c704b219b610a 100644
|
index c5b3b5e5f621f8db152aa190374ae0fe567d6828..7729c33cad94cf2b4162324be75713650fc9d378 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
@@ -434,6 +434,16 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
@@ -429,6 +429,16 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,10 +81,10 @@ index cb4b8567c029e3a53aafda2755e3773ea8b95af7..77e7188180cce9ef881de64b263c704b
|
|||||||
public void setRecipeUsed(@Nullable RecipeHolder<?> recipe) {
|
public void setRecipeUsed(@Nullable RecipeHolder<?> recipe) {
|
||||||
if (recipe != null) {
|
if (recipe != null) {
|
||||||
diff --git a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||||
index 0f808855f58281578c2758513787f0f7330c9291..e31f55ad12160c8406c0ab719f593d4c35ac9100 100644
|
index 027502d0af5512c31878978c4d05c52fa3029cca..b3da250aa326d05a4e95c7b749c8ae8975dfd804 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||||
@@ -120,6 +120,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
@@ -121,6 +121,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||||
this.items = items;
|
this.items = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,10 +102,10 @@ index 0f808855f58281578c2758513787f0f7330c9291..e31f55ad12160c8406c0ab719f593d4c
|
|||||||
protected Component getDefaultName() {
|
protected Component getDefaultName() {
|
||||||
return Component.translatable("container.barrel");
|
return Component.translatable("container.barrel");
|
||||||
diff --git a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||||
index fbde2680b405b9fa7ed2fe70046b77e971b53e48..c3d02d115282bd6dff8b5616f1ce5571e678949d 100644
|
index 331eb5416307378162e39e20192ba06a047b70ea..69419e74c308e46509cc40fde9ed05583964a1ca 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||||
@@ -151,6 +151,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
@@ -144,6 +144,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||||
super.setChanged();
|
super.setChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +117,7 @@ index fbde2680b405b9fa7ed2fe70046b77e971b53e48..c3d02d115282bd6dff8b5616f1ce5571
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,6 +213,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
@@ -201,6 +206,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||||
this.level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(bee, this.getBlockState()));
|
this.level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(bee, this.getBlockState()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +129,7 @@ index fbde2680b405b9fa7ed2fe70046b77e971b53e48..c3d02d115282bd6dff8b5616f1ce5571
|
|||||||
bee.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.ENTER_BLOCK); // CraftBukkit - add Bukkit remove cause
|
bee.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.ENTER_BLOCK); // CraftBukkit - add Bukkit remove cause
|
||||||
super.setChanged();
|
super.setChanged();
|
||||||
}
|
}
|
||||||
@@ -329,6 +339,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
@@ -322,6 +332,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||||
if (releaseOccupant(level, pos, state, beeData.toOccupant(), null, beeReleaseStatus, savedFlowerPos)) {
|
if (releaseOccupant(level, pos, state, beeData.toOccupant(), null, beeReleaseStatus, savedFlowerPos)) {
|
||||||
flag = true;
|
flag = true;
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
@@ -139,10 +141,10 @@ index fbde2680b405b9fa7ed2fe70046b77e971b53e48..c3d02d115282bd6dff8b5616f1ce5571
|
|||||||
}
|
}
|
||||||
// Paper start - Fix bees aging inside; use exitTickCounter to keep actual bee life
|
// Paper start - Fix bees aging inside; use exitTickCounter to keep actual bee life
|
||||||
else if (level.paperConfig().entities.behavior.cooldownFailedBeehiveReleases) {
|
else if (level.paperConfig().entities.behavior.cooldownFailedBeehiveReleases) {
|
||||||
@@ -372,6 +387,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
@@ -355,6 +370,11 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||||
this.maxBees = tag.getInt("Bukkit.MaxEntities");
|
tag.read("bees", BeehiveBlockEntity.Occupant.LIST_CODEC).orElse(List.of()).forEach(this::storeBee);
|
||||||
}
|
this.savedFlowerPos = tag.read("flower_pos", BlockPos.CODEC).orElse(null);
|
||||||
// CraftBukkit end
|
this.maxBees = tag.getIntOr("Bukkit.MaxEntities", MAX_OCCUPANTS); // Paper - persist max bukkit occupants
|
||||||
+ // Leaves start - pca
|
+ // Leaves start - pca
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) {
|
+ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) {
|
||||||
+ org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this);
|
+ org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this);
|
||||||
@@ -152,10 +154,10 @@ index fbde2680b405b9fa7ed2fe70046b77e971b53e48..c3d02d115282bd6dff8b5616f1ce5571
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||||
index 94f9477e78600eded6eecc4c961576501001d187..a9a85655aac78a0be91100e8b411a28eb066162d 100644
|
index 2e369167d4d1664df1f0b375597bb12b728c5c62..e13a2845efc88bd68ee96cbc1b58bf4f7fb77845 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||||
@@ -324,4 +324,14 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
@@ -331,4 +331,14 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
||||||
protected AbstractContainerMenu createMenu(int id, Inventory player) {
|
protected AbstractContainerMenu createMenu(int id, Inventory player) {
|
||||||
return new BrewingStandMenu(id, player, this, this.dataAccess);
|
return new BrewingStandMenu(id, player, this, this.dataAccess);
|
||||||
}
|
}
|
||||||
@@ -171,10 +173,10 @@ index 94f9477e78600eded6eecc4c961576501001d187..a9a85655aac78a0be91100e8b411a28e
|
|||||||
+ // Leaves end - pca
|
+ // Leaves end - pca
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||||
index fd1075eadf39359c55162cf28cad2e3b08086d4a..4489db4f765a6154246be6127ff376244e8889a7 100644
|
index a7a095cc0ffdf7b0daf7b4d19c3e78bc4399fa7c..faac046a95a7db5f5fd456bd8f768b0aaab1db5e 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
||||||
@@ -198,6 +198,16 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
|
@@ -202,6 +202,16 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
|
||||||
otherChest.setItems(items);
|
otherChest.setItems(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,11 +194,11 @@ index fd1075eadf39359c55162cf28cad2e3b08086d4a..4489db4f765a6154246be6127ff37624
|
|||||||
protected AbstractContainerMenu createMenu(int id, Inventory player) {
|
protected AbstractContainerMenu createMenu(int id, Inventory player) {
|
||||||
return ChestMenu.threeRows(id, player, this);
|
return ChestMenu.threeRows(id, player, this);
|
||||||
diff --git a/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java b/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java b/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java
|
||||||
index d3bff18645f4d3c5b71a9ee232b8e51fa8aaaaa0..2922ce789b7ae5bcd4adb70ab153ecb19355e030 100644
|
index d0119f3df52fe26c85d8b67ee59e24adf7b427ac..18ff2cd322168f57f3a1b3b4c0e9a02560cb9965 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java
|
||||||
@@ -24,6 +24,16 @@ public class ComparatorBlockEntity extends BlockEntity {
|
@@ -25,6 +25,16 @@ public class ComparatorBlockEntity extends BlockEntity {
|
||||||
this.output = tag.getInt("OutputSignal");
|
this.output = tag.getIntOr("OutputSignal", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Leaves start - pca
|
+ // Leaves start - pca
|
||||||
@@ -213,10 +215,10 @@ index d3bff18645f4d3c5b71a9ee232b8e51fa8aaaaa0..2922ce789b7ae5bcd4adb70ab153ecb1
|
|||||||
return this.output;
|
return this.output;
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/level/block/entity/DispenserBlockEntity.java b/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/DispenserBlockEntity.java b/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||||
index 33ca79c5713961a657d3a7af1f53b89e9449eba9..3c62662e626d3f0e309d2a973c73e6ac1055cae3 100644
|
index 3fb7a7b9f182062ebed778e7bb9ba239ae9f179c..a8256fd0d14655fe480b6e04ce32814e54f9d9c6 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/DispenserBlockEntity.java
|
||||||
@@ -99,6 +99,16 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity {
|
@@ -104,6 +104,16 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity {
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,10 +236,10 @@ index 33ca79c5713961a657d3a7af1f53b89e9449eba9..3c62662e626d3f0e309d2a973c73e6ac
|
|||||||
protected Component getDefaultName() {
|
protected Component getDefaultName() {
|
||||||
return Component.translatable("container.dispenser");
|
return Component.translatable("container.dispenser");
|
||||||
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
index 5cd1326ad5d046c88b2b3449d610a78fa880b4cd..42a29e700d2549de7cd905c373212e9757bcfcf1 100644
|
index 15d4f60942c0cc612c1468b4c0fda886867a67cb..212a1a1410550a2456a88a948f377048447a1fc8 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
@@ -118,6 +118,16 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
@@ -122,6 +122,16 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||||
this.facing = blockState.getValue(HopperBlock.FACING);
|
this.facing = blockState.getValue(HopperBlock.FACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +256,7 @@ index 5cd1326ad5d046c88b2b3449d610a78fa880b4cd..42a29e700d2549de7cd905c373212e97
|
|||||||
@Override
|
@Override
|
||||||
protected Component getDefaultName() {
|
protected Component getDefaultName() {
|
||||||
return Component.translatable("container.hopper");
|
return Component.translatable("container.hopper");
|
||||||
@@ -194,6 +204,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
@@ -198,6 +208,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||||
if (flag) {
|
if (flag) {
|
||||||
blockEntity.setCooldown(level.spigotConfig.hopperTransfer); // Spigot
|
blockEntity.setCooldown(level.spigotConfig.hopperTransfer); // Spigot
|
||||||
setChanged(level, pos, state);
|
setChanged(level, pos, state);
|
||||||
@@ -267,10 +269,10 @@ index 5cd1326ad5d046c88b2b3449d610a78fa880b4cd..42a29e700d2549de7cd905c373212e97
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
index a2ae4b47d742e7fb9809cfc4575517c06400ec61..cc8781c0a357eebc2bff936b4e7be53cc316716d 100644
|
index 87ebdb6deb66662a38b3eec0dae27eaf859ecabb..5e58113b3401268e0432235dc10b2734dbbd8b71 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
@@ -258,6 +258,16 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
@@ -267,6 +267,16 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||||
this.itemStacks = items;
|
this.itemStacks = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9,10 +9,10 @@ MasaGadget(https://github.com/plusls/MasaGadget)
|
|||||||
litematica(https://github.com/maruohon/litematica)
|
litematica(https://github.com/maruohon/litematica)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
|
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
|
||||||
index 68e50c6ade879d263424f244070677cb81c34c33..e619a872d51bf0be64ff594c916c89a5bbf1d3fc 100644
|
index 2fbbbac9f1472354bd507926a85c25f48291edfe..98c94e0957933828be79e6326d782af6aa738dd9 100644
|
||||||
--- a/net/minecraft/world/item/BlockItem.java
|
--- a/net/minecraft/world/item/BlockItem.java
|
||||||
+++ b/net/minecraft/world/item/BlockItem.java
|
+++ b/net/minecraft/world/item/BlockItem.java
|
||||||
@@ -158,6 +158,27 @@ public class BlockItem extends Item {
|
@@ -151,6 +151,27 @@ public class BlockItem extends Item {
|
||||||
@Nullable
|
@Nullable
|
||||||
protected BlockState getPlacementState(BlockPlaceContext context) {
|
protected BlockState getPlacementState(BlockPlaceContext context) {
|
||||||
BlockState stateForPlacement = this.getBlock().getStateForPlacement(context);
|
BlockState stateForPlacement = this.getBlock().getStateForPlacement(context);
|
||||||
@@ -62,10 +62,10 @@ index 12c6c8aeec89a0a55633c62fe98f5a3aa75fd476..1f0e7c391d02b18e2c89700025713ec3
|
|||||||
blockState = blockState1;
|
blockState = blockState1;
|
||||||
break;
|
break;
|
||||||
diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
|
diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
|
||||||
index 37f561ae2eca0d118c63f519fabdcfe9cb710826..43e338e75b7ded9f80e4ff2ce1a7dac043c93ea1 100644
|
index f289e37f77e1c9d3b0f6c29da1b99f0d5f156e37..848409f44e766ce2a5b74563bf2fd4a6b5d63d33 100644
|
||||||
--- a/net/minecraft/world/level/block/Block.java
|
--- a/net/minecraft/world/level/block/Block.java
|
||||||
+++ b/net/minecraft/world/level/block/Block.java
|
+++ b/net/minecraft/world/level/block/Block.java
|
||||||
@@ -392,6 +392,33 @@ public class Block extends BlockBehaviour implements ItemLike {
|
@@ -439,6 +439,33 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||||
public void stepOn(Level level, BlockPos pos, BlockState state, Entity entity) {
|
public void stepOn(Level level, BlockPos pos, BlockState state, Entity entity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Jade Protocol
|
|||||||
This patch is Powered by Jade(https://github.com/Snownee/Jade)
|
This patch is Powered by Jade(https://github.com/Snownee/Jade)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||||
index dfdbcb31458095a71c187efc2774ecc4945dd11b..cbcd0b7d2107f7ddd353b2bc2d51a0af32450c57 100644
|
index b72e07ad954efa7f26f876a59f428086b40d9bb2..102746fc84ca9c8899db971fc1490060ea016b7e 100644
|
||||||
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||||
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||||
@@ -61,7 +61,7 @@ public class Armadillo extends Animal {
|
@@ -62,7 +62,7 @@ public class Armadillo extends Animal {
|
||||||
public final AnimationState rollOutAnimationState = new AnimationState();
|
public final AnimationState rollOutAnimationState = new AnimationState();
|
||||||
public final AnimationState rollUpAnimationState = new AnimationState();
|
public final AnimationState rollUpAnimationState = new AnimationState();
|
||||||
public final AnimationState peekAnimationState = new AnimationState();
|
public final AnimationState peekAnimationState = new AnimationState();
|
||||||
@@ -19,10 +19,10 @@ index dfdbcb31458095a71c187efc2774ecc4945dd11b..cbcd0b7d2107f7ddd353b2bc2d51a0af
|
|||||||
|
|
||||||
public Armadillo(EntityType<? extends Animal> entityType, Level level) {
|
public Armadillo(EntityType<? extends Animal> entityType, Level level) {
|
||||||
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||||
index 97adf8142cdd322c4873c420ed760e9dee34da23..cd04199fa8861025e92884f9ec2d3c721c50ad75 100644
|
index ebdfd3fb6c0de48982d392bb2aa415f3676c6056..9d5acb2559143358b1258cbb674191bdddb331e3 100644
|
||||||
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
|
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||||
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||||
@@ -253,7 +253,7 @@ public class Tadpole extends AbstractFish {
|
@@ -252,7 +252,7 @@ public class Tadpole extends AbstractFish {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,11 +45,11 @@ index 29ad43245a310756c4227acd7532e905f7f8b8ee..ad422817593449b8e914628b51d760e7
|
|||||||
private final Predicate<LootContext> compositeCondition;
|
private final Predicate<LootContext> compositeCondition;
|
||||||
private final List<LootItemFunction> functions;
|
private final List<LootItemFunction> functions;
|
||||||
diff --git a/net/minecraft/world/level/storage/loot/LootTable.java b/net/minecraft/world/level/storage/loot/LootTable.java
|
diff --git a/net/minecraft/world/level/storage/loot/LootTable.java b/net/minecraft/world/level/storage/loot/LootTable.java
|
||||||
index f95d0f2da3d958519d28278079555c800aad02f8..bebffd07047e41c53b9e4f1ad5917680b8e8c796 100644
|
index 7a8eb1e8b07647e1124594f78652d34731e4fda6..6cfe7ef8c81f506bce9c971b597cc4e902bcabbe 100644
|
||||||
--- a/net/minecraft/world/level/storage/loot/LootTable.java
|
--- a/net/minecraft/world/level/storage/loot/LootTable.java
|
||||||
+++ b/net/minecraft/world/level/storage/loot/LootTable.java
|
+++ b/net/minecraft/world/level/storage/loot/LootTable.java
|
||||||
@@ -45,7 +45,7 @@ public class LootTable {
|
@@ -49,7 +49,7 @@ public class LootTable {
|
||||||
public static final Codec<Holder<LootTable>> CODEC = RegistryFileCodec.create(Registries.LOOT_TABLE, DIRECT_CODEC);
|
public static final LootTable EMPTY = new LootTable(LootContextParamSets.EMPTY, Optional.empty(), List.of(), List.of());
|
||||||
private final ContextKeySet paramSet;
|
private final ContextKeySet paramSet;
|
||||||
private final Optional<ResourceLocation> randomSequence;
|
private final Optional<ResourceLocation> randomSequence;
|
||||||
- private final List<LootPool> pools;
|
- private final List<LootPool> pools;
|
||||||
@@ -84,10 +84,10 @@ index e0e933245e038b7229eeddbda272b081161ab603..c5e3834fa970ac909cefea4342037839
|
|||||||
|
|
||||||
protected LootPoolEntryContainer(List<LootItemCondition> conditions) {
|
protected LootPoolEntryContainer(List<LootItemCondition> conditions) {
|
||||||
diff --git a/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java b/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java
|
diff --git a/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java b/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java
|
||||||
index d5e697a0cf6091a7f37c68e3c2a52851535735b1..a8a5a872a8647896e80f91cb5a89adead4005cf7 100644
|
index f7b647e81ca99040bae8161a2bc0dcacf5bd537f..069df530b1db72bd4a2b1b80b2570dca545dfd20 100644
|
||||||
--- a/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java
|
--- a/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java
|
||||||
+++ b/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java
|
+++ b/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java
|
||||||
@@ -25,7 +25,7 @@ public class NestedLootTable extends LootPoolSingletonContainer {
|
@@ -22,7 +22,7 @@ public class NestedLootTable extends LootPoolSingletonContainer {
|
||||||
.and(singletonFields(instance))
|
.and(singletonFields(instance))
|
||||||
.apply(instance, NestedLootTable::new)
|
.apply(instance, NestedLootTable::new)
|
||||||
);
|
);
|
||||||
@@ -6,13 +6,13 @@ Subject: [PATCH] Player operation limiter
|
|||||||
This patch is Powered by plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition)
|
This patch is Powered by plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition)
|
||||||
|
|
||||||
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 339cec1f040d47bb37834c6ebe0633b7c991e0cd..b18a818e4d795b6fb269ad57ffb49840c8d879ab 100644
|
index 01687ea3acf449c49cbc615887a7dbdd3a693613..988992a181e35a3856817419cb4941c73a9c31f2 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
|
||||||
@@ -400,6 +400,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -420,6 +420,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
public 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 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
|
||||||
+ // Leaves start - player operation limiter
|
+ // Leaves start - player operation limiter
|
||||||
+ private int instaBreakCountPerTick = 0;
|
+ private int instaBreakCountPerTick = 0;
|
||||||
+ private int placeBlockCountPerTick = 0;
|
+ private int placeBlockCountPerTick = 0;
|
||||||
@@ -20,7 +20,7 @@ index 339cec1f040d47bb37834c6ebe0633b7c991e0cd..b18a818e4d795b6fb269ad57ffb49840
|
|||||||
|
|
||||||
// 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;
|
||||||
@@ -805,6 +809,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -744,6 +748,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
this.tickClientLoadTimeout();
|
this.tickClientLoadTimeout();
|
||||||
@@ -28,7 +28,7 @@ index 339cec1f040d47bb37834c6ebe0633b7c991e0cd..b18a818e4d795b6fb269ad57ffb49840
|
|||||||
this.gameMode.tick();
|
this.gameMode.tick();
|
||||||
this.wardenSpawnTracker.tick();
|
this.wardenSpawnTracker.tick();
|
||||||
if (this.invulnerableTime > 0) {
|
if (this.invulnerableTime > 0) {
|
||||||
@@ -3090,4 +3095,31 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -2933,4 +2938,31 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
|
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -61,10 +61,10 @@ index 339cec1f040d47bb37834c6ebe0633b7c991e0cd..b18a818e4d795b6fb269ad57ffb49840
|
|||||||
+ // Leaves end - player operation limiter
|
+ // Leaves end - player operation limiter
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayerGameMode.java b/net/minecraft/server/level/ServerPlayerGameMode.java
|
diff --git a/net/minecraft/server/level/ServerPlayerGameMode.java b/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||||
index 623c069f1fe079e020c6391a3db1a3d95cd3dbf5..d2b2290c73826278a89eb02ab81ee503ee41a4a2 100644
|
index b604cba2490a747661d6819251bc3b9a1d35c7d4..5e54d6de0430cd137fbe13ca8f17dc487ce52ff3 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
|
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
|
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||||
@@ -303,6 +303,19 @@ public class ServerPlayerGameMode {
|
@@ -300,6 +300,19 @@ public class ServerPlayerGameMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroyAndAck(BlockPos pos, int sequence, String message) {
|
public void destroyAndAck(BlockPos pos, int sequence, String message) {
|
||||||
@@ -85,10 +85,10 @@ index 623c069f1fe079e020c6391a3db1a3d95cd3dbf5..d2b2290c73826278a89eb02ab81ee503
|
|||||||
this.debugLogging(pos, true, sequence, message);
|
this.debugLogging(pos, true, sequence, message);
|
||||||
} else {
|
} else {
|
||||||
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
|
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
|
||||||
index e619a872d51bf0be64ff594c916c89a5bbf1d3fc..1f4a3d2610abfa2ea2b1d5feba9606b806d6d416 100644
|
index 3f58574069f22d83298a77f253255b25724890ad..0c67e5481a43bf7c02bb54a8ea1abca77d53a292 100644
|
||||||
--- a/net/minecraft/world/item/BlockItem.java
|
--- a/net/minecraft/world/item/BlockItem.java
|
||||||
+++ b/net/minecraft/world/item/BlockItem.java
|
+++ b/net/minecraft/world/item/BlockItem.java
|
||||||
@@ -72,6 +72,21 @@ public class BlockItem extends Item {
|
@@ -65,6 +65,21 @@ public class BlockItem extends Item {
|
||||||
final org.bukkit.block.BlockState oldBukkitState = bukkitState != null ? bukkitState : org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(blockPlaceContext.getLevel(), blockPlaceContext.getClickedPos()); // Paper - Reset placed block on exception
|
final org.bukkit.block.BlockState oldBukkitState = bukkitState != null ? bukkitState : org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(blockPlaceContext.getLevel(), blockPlaceContext.getClickedPos()); // Paper - Reset placed block on exception
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Renewable Elytra
|
|||||||
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
|
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||||
index a91aba11ecda561d117c9d8db85c92cdcd81887e..d4123b93cec95daeb9991cf20b1d2c8701474606 100644
|
index 483b0499f1f70b3aa8862e6cd8e512748492bee0..896c6fe4ee76708f09022934056cd9de74c5e851 100644
|
||||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||||
@@ -242,6 +242,20 @@ public class Phantom extends FlyingMob implements Enemy {
|
@@ -231,6 +231,20 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||||
return targetingConditions.test(level, this, entity);
|
return targetingConditions.test(level, this, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] MC Technical Survival Mode
|
|||||||
Will automatically overwrite some configuration after startup
|
Will automatically overwrite some configuration after startup
|
||||||
|
|
||||||
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 b18a818e4d795b6fb269ad57ffb49840c8d879ab..0df1160ce4e027cc1c1bf7071a4d8730aaa7fde6 100644
|
index 988992a181e35a3856817419cb4941c73a9c31f2..66110486725de7967e55839043b9fc9690e4c0f5 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
|
||||||
@@ -1687,7 +1687,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1614,7 +1614,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
public boolean isInvulnerableTo(ServerLevel level, DamageSource damageSource) {
|
public boolean isInvulnerableTo(ServerLevel level, DamageSource damageSource) {
|
||||||
return (super.isInvulnerableTo(level, damageSource) // Paper - disable player cramming;
|
return (super.isInvulnerableTo(level, damageSource) // Paper - disable player cramming;
|
||||||
|| this.isChangingDimension() && !damageSource.is(DamageTypes.ENDER_PEARL)
|
|| this.isChangingDimension() && !damageSource.is(DamageTypes.ENDER_PEARL)
|
||||||
@@ -19,7 +19,7 @@ index b18a818e4d795b6fb269ad57ffb49840c8d879ab..0df1160ce4e027cc1c1bf7071a4d8730
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
diff --git a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
||||||
index ff1c84d37db48e1bd0283a900e199647c0e8eba1..cefa4c03b1d3722bb3a7872eb75a9f47517fe040 100644
|
index d813427cf20117014bc42af0eb7cdee037fbcd9c..35f8644a9b4704363f6fe1ca19135566a45ef835 100644
|
||||||
--- a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
--- a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
||||||
+++ b/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
+++ b/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
||||||
@@ -64,7 +64,7 @@ public class EndCrystal extends Entity {
|
@@ -64,7 +64,7 @@ public class EndCrystal extends Entity {
|
||||||
@@ -28,14 +28,14 @@ index ff1c84d37db48e1bd0283a900e199647c0e8eba1..cefa4c03b1d3722bb3a7872eb75a9f47
|
|||||||
// Paper start - Fix invulnerable end crystals
|
// Paper start - Fix invulnerable end crystals
|
||||||
- if (this.level().paperConfig().unsupportedSettings.fixInvulnerableEndCrystalExploit && this.generatedByDragonFight && this.isInvulnerable()) {
|
- if (this.level().paperConfig().unsupportedSettings.fixInvulnerableEndCrystalExploit && this.generatedByDragonFight && this.isInvulnerable()) {
|
||||||
+ if (!org.leavesmc.leaves.LeavesConfig.modify.mcTechnicalMode && this.level().paperConfig().unsupportedSettings.fixInvulnerableEndCrystalExploit && this.generatedByDragonFight && this.isInvulnerable()) { // Leaves - mc technical survival mode
|
+ if (!org.leavesmc.leaves.LeavesConfig.modify.mcTechnicalMode && this.level().paperConfig().unsupportedSettings.fixInvulnerableEndCrystalExploit && this.generatedByDragonFight && this.isInvulnerable()) { // Leaves - mc technical survival mode
|
||||||
if (!java.util.Objects.equals(((ServerLevel) this.level()).uuid, this.getOriginWorld())
|
if (!java.util.Objects.equals(((ServerLevel) this.level()).uuid, this.originWorld)
|
||||||
|| ((ServerLevel) this.level()).getDragonFight() == null
|
|| ((ServerLevel) this.level()).getDragonFight() == null
|
||||||
|| ((ServerLevel) this.level()).getDragonFight().respawnStage == null
|
|| ((ServerLevel) this.level()).getDragonFight().respawnStage == null
|
||||||
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
|
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
index 40da052e7fea1306a007b3cb5c9daa33e0ef523e..583864d73999e4e25f6c26920c0bf9a7504d8463 100644
|
index 5d23d8754b304d5e2fd54400cc81c7fe5c14a804..0f28b1befd42a85ffa5462e86d5cde142f9d1196 100644
|
||||||
--- a/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -98,7 +98,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -101,7 +101,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
@@ -45,10 +45,10 @@ index 40da052e7fea1306a007b3cb5c9daa33e0ef523e..583864d73999e4e25f6c26920c0bf9a7
|
|||||||
this.applyGravity();
|
this.applyGravity();
|
||||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
this.move(MoverType.SELF, this.getDeltaMovement());
|
||||||
diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java
|
diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java
|
||||||
index 17ce115e887cbbb06ad02ab7ddb488e27342c0e4..8fd9c191e5b14fc7dd90e8f7229acd6de97e0f9e 100644
|
index 14a2514a408a66a83f7b5fb43b4c4dc8f23fd5f4..5427f5e1f0416a8dfa3e9c38c3ce69d6e2bd37a6 100644
|
||||||
--- a/net/minecraft/world/level/NaturalSpawner.java
|
--- a/net/minecraft/world/level/NaturalSpawner.java
|
||||||
+++ b/net/minecraft/world/level/NaturalSpawner.java
|
+++ b/net/minecraft/world/level/NaturalSpawner.java
|
||||||
@@ -88,7 +88,7 @@ public final class NaturalSpawner {
|
@@ -82,7 +82,7 @@ public final class NaturalSpawner {
|
||||||
MobCategory category = entity.getType().getCategory();
|
MobCategory category = entity.getType().getCategory();
|
||||||
if (category != MobCategory.MISC) {
|
if (category != MobCategory.MISC) {
|
||||||
// Paper start - Only count natural spawns
|
// Paper start - Only count natural spawns
|
||||||
@@ -58,10 +58,10 @@ index 17ce115e887cbbb06ad02ab7ddb488e27342c0e4..8fd9c191e5b14fc7dd90e8f7229acd6d
|
|||||||
entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
|
entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
|
||||||
continue;
|
continue;
|
||||||
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
index 3122753c96e98e57fa900cd15005ab4874e4b1db..50bc72f736e9e7a9839a853254a81f9add03bacf 100644
|
index 212a1a1410550a2456a88a948f377048447a1fc8..2d979850378c05ce569782d8e04a452f986612a7 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
@@ -271,7 +271,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
@@ -275,7 +275,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||||
origItemStack.setCount(originalItemCount);
|
origItemStack.setCount(originalItemCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ index 3122753c96e98e57fa900cd15005ab4874e4b1db..50bc72f736e9e7a9839a853254a81f9a
|
|||||||
hopper.setCooldown(level.spigotConfig.hopperTransfer);
|
hopper.setCooldown(level.spigotConfig.hopperTransfer);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -312,7 +312,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
@@ -316,7 +316,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||||
}
|
}
|
||||||
origItemStack.setCount(originalItemCount);
|
origItemStack.setCount(originalItemCount);
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ index 643797124fe5a4489d0b7419b7e600c04f283ef2..51971a4ef18ab048dc576c26652982d5
|
|||||||
|
|
||||||
public String serialize(HolderLookup.Provider levelRegistry) {
|
public String serialize(HolderLookup.Provider levelRegistry) {
|
||||||
diff --git a/net/minecraft/server/commands/GiveCommand.java b/net/minecraft/server/commands/GiveCommand.java
|
diff --git a/net/minecraft/server/commands/GiveCommand.java b/net/minecraft/server/commands/GiveCommand.java
|
||||||
index 8b7af734ca4ed3cafa810460b2cea6c1e6342a69..10d20e945a8f9e676137e752e357ad71b2ab1122 100644
|
index b81f98738ef166336e4cc3092b6ba63f385b68e3..e800abc1149db77bc9b7ee1aabd17526ebda377c 100644
|
||||||
--- a/net/minecraft/server/commands/GiveCommand.java
|
--- a/net/minecraft/server/commands/GiveCommand.java
|
||||||
+++ b/net/minecraft/server/commands/GiveCommand.java
|
+++ b/net/minecraft/server/commands/GiveCommand.java
|
||||||
@@ -52,7 +52,7 @@ public class GiveCommand {
|
@@ -52,7 +52,7 @@ public class GiveCommand {
|
||||||
@@ -39,19 +39,19 @@ index 8b7af734ca4ed3cafa810460b2cea6c1e6342a69..10d20e945a8f9e676137e752e357ad71
|
|||||||
if (count > i) {
|
if (count > i) {
|
||||||
source.sendFailure(Component.translatable("commands.give.failed.toomanyitems", i, itemStack.getDisplayName()));
|
source.sendFailure(Component.translatable("commands.give.failed.toomanyitems", i, itemStack.getDisplayName()));
|
||||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 876d207996724727ca26b139af759eab2e6f4131..c1d55857e4238e78703eebf62af8bf59c660e9ea 100644
|
index 9041830c19e2899479e1519488faba5c416ccd88..ca814ebdb05ca3af138bf087f26d2cf50baf3b9c 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
|
||||||
@@ -2987,7 +2987,7 @@ public class ServerGamePacketListenerImpl
|
@@ -2974,7 +2974,7 @@ public class ServerGamePacketListenerImpl
|
||||||
} else if (slot.mayPlace(cursor)) {
|
} else if (slot.mayPlace(cursor)) {
|
||||||
if (ItemStack.isSameItemSameComponents(clickedItem, cursor)) {
|
if (ItemStack.isSameItemSameComponents(clickedItem, cursor)) {
|
||||||
int toPlace = packet.getButtonNum() == 0 ? cursor.getCount() : 1;
|
int toPlace = packet.buttonNum() == 0 ? cursor.getCount() : 1;
|
||||||
- toPlace = Math.min(toPlace, clickedItem.getMaxStackSize() - clickedItem.getCount());
|
- toPlace = Math.min(toPlace, clickedItem.getMaxStackSize() - clickedItem.getCount());
|
||||||
+ toPlace = Math.min(toPlace, org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(clickedItem) - clickedItem.getCount()); // Leaves - stackable shulker boxes
|
+ toPlace = Math.min(toPlace, org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(clickedItem) - clickedItem.getCount()); // Leaves - stackable shulker boxes
|
||||||
toPlace = Math.min(toPlace, slot.container.getMaxStackSize() - clickedItem.getCount());
|
toPlace = Math.min(toPlace, slot.container.getMaxStackSize() - clickedItem.getCount());
|
||||||
if (toPlace == 1) {
|
if (toPlace == 1) {
|
||||||
action = InventoryAction.PLACE_ONE;
|
action = InventoryAction.PLACE_ONE;
|
||||||
@@ -3023,7 +3023,7 @@ public class ServerGamePacketListenerImpl
|
@@ -3010,7 +3010,7 @@ public class ServerGamePacketListenerImpl
|
||||||
}
|
}
|
||||||
} else if (ItemStack.isSameItemSameComponents(cursor, clickedItem)) {
|
} else if (ItemStack.isSameItemSameComponents(cursor, clickedItem)) {
|
||||||
if (clickedItem.getCount() >= 0) {
|
if (clickedItem.getCount() >= 0) {
|
||||||
@@ -60,15 +60,15 @@ index 876d207996724727ca26b139af759eab2e6f4131..c1d55857e4238e78703eebf62af8bf59
|
|||||||
// As of 1.5, this is result slots only
|
// As of 1.5, this is result slots only
|
||||||
action = InventoryAction.PICKUP_ALL;
|
action = InventoryAction.PICKUP_ALL;
|
||||||
}
|
}
|
||||||
@@ -3283,6 +3283,7 @@ public class ServerGamePacketListenerImpl
|
@@ -3269,6 +3269,7 @@ public class ServerGamePacketListenerImpl
|
||||||
this.player.containerMenu.broadcastFullState();
|
this.player.containerMenu.broadcastFullState();
|
||||||
} else {
|
} else {
|
||||||
this.player.containerMenu.broadcastChanges();
|
this.player.containerMenu.broadcastChanges();
|
||||||
+ this.player.containerMenu.broadcastCarriedItem(); // Leaves - stackable shulker boxes - force send carried item
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.shulkerBoxStackSize > 1) this.player.containerMenu.broadcastCarriedItem(); // Leaves - stackable shulker boxes - force send carried item
|
||||||
}
|
}
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes.
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdates(); // Paper - Force update attributes.
|
||||||
}
|
}
|
||||||
@@ -3395,7 +3396,7 @@ public class ServerGamePacketListenerImpl
|
@@ -3381,7 +3382,7 @@ public class ServerGamePacketListenerImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean flag1 = packet.slotNum() >= 1 && packet.slotNum() <= 45;
|
boolean flag1 = packet.slotNum() >= 1 && packet.slotNum() <= 45;
|
||||||
@@ -76,12 +76,20 @@ index 876d207996724727ca26b139af759eab2e6f4131..c1d55857e4238e78703eebf62af8bf59
|
|||||||
+ boolean flag2 = itemStack.isEmpty() || itemStack.getCount() <= org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(itemStack); // Leaves - stackable shulker boxes
|
+ boolean flag2 = itemStack.isEmpty() || itemStack.getCount() <= org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(itemStack); // Leaves - stackable shulker boxes
|
||||||
if (flag || (flag1 && !ItemStack.matches(this.player.inventoryMenu.getSlot(packet.slotNum()).getItem(), packet.itemStack()))) { // Insist on valid slot
|
if (flag || (flag1 && !ItemStack.matches(this.player.inventoryMenu.getSlot(packet.slotNum()).getItem(), packet.itemStack()))) { // Insist on valid slot
|
||||||
// CraftBukkit start - Call click event
|
// CraftBukkit start - Call click event
|
||||||
InventoryView inventory = this.player.inventoryMenu.getBukkitView();
|
org.bukkit.inventory.InventoryView inventory = this.player.inventoryMenu.getBukkitView();
|
||||||
|
@@ -3423,6 +3424,7 @@ public class ServerGamePacketListenerImpl
|
||||||
|
this.player.inventoryMenu.getSlot(packet.slotNum()).setByPlayer(itemStack);
|
||||||
|
this.player.inventoryMenu.setRemoteSlot(packet.slotNum(), itemStack);
|
||||||
|
this.player.inventoryMenu.broadcastChanges();
|
||||||
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.shulkerBoxStackSize > 1) this.player.containerMenu.sendSingleSlot(packet.slotNum(), itemStack); // Leaves - stackable shulker boxes - force send carried item
|
||||||
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdates(); // Paper - Force update attributes.
|
||||||
|
} else if (flag && flag2) {
|
||||||
|
if (this.dropSpamThrottler.isUnderThreshold()) {
|
||||||
diff --git a/net/minecraft/world/Container.java b/net/minecraft/world/Container.java
|
diff --git a/net/minecraft/world/Container.java b/net/minecraft/world/Container.java
|
||||||
index 2d3721e311851c1801b090e99d4f9d0daf4e5f99..f779d27603e6d81435c061214a2db3a14a31c11e 100644
|
index b382665cc125b8b5c0938e5e55984e4bf91d37ff..f575b464a8ce430646cb872ae6206a9a0677736b 100644
|
||||||
--- a/net/minecraft/world/Container.java
|
--- a/net/minecraft/world/Container.java
|
||||||
+++ b/net/minecraft/world/Container.java
|
+++ b/net/minecraft/world/Container.java
|
||||||
@@ -30,6 +30,12 @@ public interface Container extends Clearable {
|
@@ -32,6 +32,12 @@ public interface Container extends Clearable, Iterable<ItemStack> {
|
||||||
return Math.min(this.getMaxStackSize(), stack.getMaxStackSize());
|
return Math.min(this.getMaxStackSize(), stack.getMaxStackSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,10 +103,10 @@ index 2d3721e311851c1801b090e99d4f9d0daf4e5f99..f779d27603e6d81435c061214a2db3a1
|
|||||||
|
|
||||||
boolean stillValid(Player player);
|
boolean stillValid(Player player);
|
||||||
diff --git a/net/minecraft/world/SimpleContainer.java b/net/minecraft/world/SimpleContainer.java
|
diff --git a/net/minecraft/world/SimpleContainer.java b/net/minecraft/world/SimpleContainer.java
|
||||||
index 190190463086f2fcbe28f00fa2f23795bf11f279..f6ec7accba090aac87eeefba333440ceaf7e7c20 100644
|
index 133e042371bcf84f1935903ec57d204e3b7abd84..201599988e20219b6a99bf1594ad6c0c19e09038 100644
|
||||||
--- a/net/minecraft/world/SimpleContainer.java
|
--- a/net/minecraft/world/SimpleContainer.java
|
||||||
+++ b/net/minecraft/world/SimpleContainer.java
|
+++ b/net/minecraft/world/SimpleContainer.java
|
||||||
@@ -205,7 +205,7 @@ public class SimpleContainer implements Container, StackedContentsCompatible {
|
@@ -211,7 +211,7 @@ public class SimpleContainer implements Container, StackedContentsCompatible {
|
||||||
@Override
|
@Override
|
||||||
public void setItem(int index, ItemStack stack) {
|
public void setItem(int index, ItemStack stack) {
|
||||||
this.items.set(index, stack);
|
this.items.set(index, stack);
|
||||||
@@ -107,7 +115,7 @@ index 190190463086f2fcbe28f00fa2f23795bf11f279..f6ec7accba090aac87eeefba333440ce
|
|||||||
this.setChanged();
|
this.setChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +280,7 @@ public class SimpleContainer implements Container, StackedContentsCompatible {
|
@@ -286,7 +286,7 @@ public class SimpleContainer implements Container, StackedContentsCompatible {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void moveItemsBetweenStacks(ItemStack stack, ItemStack other) {
|
private void moveItemsBetweenStacks(ItemStack stack, ItemStack other) {
|
||||||
@@ -117,10 +125,10 @@ index 190190463086f2fcbe28f00fa2f23795bf11f279..f6ec7accba090aac87eeefba333440ce
|
|||||||
if (min > 0) {
|
if (min > 0) {
|
||||||
other.grow(min);
|
other.grow(min);
|
||||||
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 52a7ed0d991758bad0dcedcb7f97fb15ac6c6d04..d2d258246e7f7332c0420077e33c05e222bda46d 100644
|
index 6c0ebfb2be4e8b884456a2aa3d5fdc87e45a0e3c..b0e60d1d2a44bb35c87c35e82a172a38406b6c54 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
|
||||||
@@ -274,10 +274,52 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
@@ -281,10 +281,52 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||||
|
|
||||||
private boolean isMergable() {
|
private boolean isMergable() {
|
||||||
ItemStack item = this.getItem();
|
ItemStack item = this.getItem();
|
||||||
@@ -175,10 +183,10 @@ index 52a7ed0d991758bad0dcedcb7f97fb15ac6c6d04..d2d258246e7f7332c0420077e33c05e2
|
|||||||
ItemStack item1 = itemEntity.getItem();
|
ItemStack item1 = itemEntity.getItem();
|
||||||
if (Objects.equals(this.target, itemEntity.target) && areMergable(item, item1)) {
|
if (Objects.equals(this.target, itemEntity.target) && areMergable(item, item1)) {
|
||||||
diff --git a/net/minecraft/world/entity/player/Inventory.java b/net/minecraft/world/entity/player/Inventory.java
|
diff --git a/net/minecraft/world/entity/player/Inventory.java b/net/minecraft/world/entity/player/Inventory.java
|
||||||
index 839cbb67d3d38960d9114a4db5bab911b66a573c..9b628d553d3206a4881ed5e07fa6d2552b710cea 100644
|
index d9cb4f0ed0c4f63362c837aeef3c4194911455c9..57bf2819271b3293a065b58d31b609f8463811b4 100644
|
||||||
--- a/net/minecraft/world/entity/player/Inventory.java
|
--- a/net/minecraft/world/entity/player/Inventory.java
|
||||||
+++ b/net/minecraft/world/entity/player/Inventory.java
|
+++ b/net/minecraft/world/entity/player/Inventory.java
|
||||||
@@ -97,10 +97,12 @@ public class Inventory implements Container, Nameable {
|
@@ -148,10 +148,12 @@ public class Inventory implements Container, Nameable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasRemainingSpaceForItem(ItemStack destination, ItemStack origin) {
|
private boolean hasRemainingSpaceForItem(ItemStack destination, ItemStack origin) {
|
||||||
@@ -193,7 +201,7 @@ index 839cbb67d3d38960d9114a4db5bab911b66a573c..9b628d553d3206a4881ed5e07fa6d255
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start - Watch method above! :D
|
// CraftBukkit start - Watch method above! :D
|
||||||
@@ -113,7 +115,7 @@ public class Inventory implements Container, Nameable {
|
@@ -164,7 +166,7 @@ public class Inventory implements Container, Nameable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasRemainingSpaceForItem(itemInSlot, itemStack)) {
|
if (this.hasRemainingSpaceForItem(itemInSlot, itemStack)) {
|
||||||
@@ -202,16 +210,16 @@ index 839cbb67d3d38960d9114a4db5bab911b66a573c..9b628d553d3206a4881ed5e07fa6d255
|
|||||||
}
|
}
|
||||||
if (remains <= 0) {
|
if (remains <= 0) {
|
||||||
return itemStack.getCount();
|
return itemStack.getCount();
|
||||||
@@ -122,7 +124,7 @@ public class Inventory implements Container, Nameable {
|
@@ -173,7 +175,7 @@ public class Inventory implements Container, Nameable {
|
||||||
|
|
||||||
ItemStack itemInOffhand = this.getItem(this.items.size() + this.armor.size());
|
ItemStack itemInOffhand = this.equipment.get(EquipmentSlot.OFFHAND);
|
||||||
if (this.hasRemainingSpaceForItem(itemInOffhand, itemStack)) {
|
if (this.hasRemainingSpaceForItem(itemInOffhand, itemStack)) {
|
||||||
- remains -= (itemInOffhand.getMaxStackSize() < this.getMaxStackSize() ? itemInOffhand.getMaxStackSize() : this.getMaxStackSize()) - itemInOffhand.getCount();
|
- remains -= (itemInOffhand.getMaxStackSize() < this.getMaxStackSize() ? itemInOffhand.getMaxStackSize() : this.getMaxStackSize()) - itemInOffhand.getCount();
|
||||||
+ remains -= (org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(itemInOffhand) < this.getMaxStackSize() ? org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(itemInOffhand) : this.getMaxStackSize()) - itemInOffhand.getCount(); // Leaves - stackable shulker boxes
|
+ remains -= (org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(itemInOffhand) < this.getMaxStackSize() ? org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(itemInOffhand) : this.getMaxStackSize()) - itemInOffhand.getCount(); // Leaves - stackable shulker boxes
|
||||||
}
|
}
|
||||||
if (remains <= 0) {
|
if (remains <= 0) {
|
||||||
return itemStack.getCount();
|
return itemStack.getCount();
|
||||||
@@ -252,7 +254,7 @@ public class Inventory implements Container, Nameable {
|
@@ -297,7 +299,7 @@ public class Inventory implements Container, Nameable {
|
||||||
this.setItem(slot, item);
|
this.setItem(slot, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +228,7 @@ index 839cbb67d3d38960d9114a4db5bab911b66a573c..9b628d553d3206a4881ed5e07fa6d255
|
|||||||
int min = Math.min(count, i);
|
int min = Math.min(count, i);
|
||||||
if (min == 0) {
|
if (min == 0) {
|
||||||
return count;
|
return count;
|
||||||
@@ -359,7 +361,7 @@ public class Inventory implements Container, Nameable {
|
@@ -403,7 +405,7 @@ public class Inventory implements Container, Nameable {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,10 +251,10 @@ index 83ccde54c625d40dc595e000c533f60aa929bd5a..1b92676459468d42931b84e5ceb19e8d
|
|||||||
|
|
||||||
public void accountStack(ItemStack stack, int maxStackSize) {
|
public void accountStack(ItemStack stack, int maxStackSize) {
|
||||||
diff --git a/net/minecraft/world/entity/vehicle/ContainerEntity.java b/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
diff --git a/net/minecraft/world/entity/vehicle/ContainerEntity.java b/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||||
index c18aea2bb5ddddadbc858b253ff4c08d82178a18..6a24b442a21298ef3bdbcb76de9bdcf006890c5d 100644
|
index feebd1610ebd3c26a337259c14f5c774dc72b937..7df6ff842e41763aec2d88d1f8a5f7503932d905 100644
|
||||||
--- a/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
--- a/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||||
+++ b/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
+++ b/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||||
@@ -164,7 +164,7 @@ public interface ContainerEntity extends Container, MenuProvider {
|
@@ -163,7 +163,7 @@ public interface ContainerEntity extends Container, MenuProvider {
|
||||||
default void setChestVehicleItem(int slot, ItemStack stack) {
|
default void setChestVehicleItem(int slot, ItemStack stack) {
|
||||||
this.unpackChestVehicleLootTable(null);
|
this.unpackChestVehicleLootTable(null);
|
||||||
this.getItemStacks().set(slot, stack);
|
this.getItemStacks().set(slot, stack);
|
||||||
@@ -256,10 +264,24 @@ index c18aea2bb5ddddadbc858b253ff4c08d82178a18..6a24b442a21298ef3bdbcb76de9bdcf0
|
|||||||
|
|
||||||
default SlotAccess getChestVehicleSlot(final int index) {
|
default SlotAccess getChestVehicleSlot(final int index) {
|
||||||
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 b4721c4e81cc2ae989765d86bd51ebf0be41758c..d03348c8139c398b65a2f4e4f960832c797e0443 100644
|
index 2a4763c951ddc78c9d8a39e661e59bbffc5cf109..8aa689129334f75986fb7a18895e2c3fb3c365c8 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
|
||||||
@@ -427,7 +427,7 @@ public abstract class AbstractContainerMenu {
|
@@ -271,6 +271,13 @@ public abstract class AbstractContainerMenu {
|
||||||
|
this.sendAllDataToRemote();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Leaves start - stackable shulker boxes
|
||||||
|
+ public void sendSingleSlot(int slotIndex, ItemStack item) {
|
||||||
|
+ if (this.synchronizer != null) {
|
||||||
|
+ this.synchronizer.sendSlotChange(this, slotIndex, item);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - stackable shulker boxes
|
||||||
|
private void updateDataSlotListeners(int slotIndex, int value) {
|
||||||
|
for (ContainerListener containerListener : this.containerListeners) {
|
||||||
|
containerListener.dataChanged(this, slotIndex, value);
|
||||||
|
@@ -428,7 +435,7 @@ public abstract class AbstractContainerMenu {
|
||||||
&& (this.quickcraftType == 2 || carried1.getCount() >= this.quickcraftSlots.size())
|
&& (this.quickcraftType == 2 || carried1.getCount() >= this.quickcraftSlots.size())
|
||||||
&& this.canDragTo(slot1)) {
|
&& this.canDragTo(slot1)) {
|
||||||
int i2 = slot1.hasItem() ? slot1.getItem().getCount() : 0;
|
int i2 = slot1.hasItem() ? slot1.getItem().getCount() : 0;
|
||||||
@@ -268,16 +290,16 @@ index b4721c4e81cc2ae989765d86bd51ebf0be41758c..d03348c8139c398b65a2f4e4f960832c
|
|||||||
int min1 = Math.min(getQuickCraftPlaceCount(this.quickcraftSlots, this.quickcraftType, itemStack) + i2, min);
|
int min1 = Math.min(getQuickCraftPlaceCount(this.quickcraftSlots, this.quickcraftType, itemStack) + i2, min);
|
||||||
count -= min1 - i2;
|
count -= min1 - i2;
|
||||||
// slot1.setByPlayer(itemStack.copyWithCount(min1));
|
// slot1.setByPlayer(itemStack.copyWithCount(min1));
|
||||||
@@ -541,7 +541,7 @@ public abstract class AbstractContainerMenu {
|
@@ -542,7 +549,7 @@ public abstract class AbstractContainerMenu {
|
||||||
slot.setByPlayer(carried2);
|
slot.setByPlayer(carried2);
|
||||||
}
|
}
|
||||||
} else if (ItemStack.isSameItemSameComponents(carried, carried2)) {
|
} else if (ItemStack.isSameItemSameComponents(carried, carried2)) {
|
||||||
- Optional<ItemStack> optional1 = slot.tryRemove(carried.getCount(), carried2.getMaxStackSize() - carried2.getCount(), player);
|
- Optional<ItemStack> optional1 = slot.tryRemove(carried.getCount(), carried2.getMaxStackSize() - carried2.getCount(), player);
|
||||||
+ Optional<ItemStack> optional1 = slot.tryRemove(carried.getCount(), org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(carried2) - carried2.getCount(), player); // Leaves - stackable shulker boxes
|
+ Optional<ItemStack> optional1 = slot.tryRemove(carried.getCount(), org.leavesmc.leaves.util.ShulkerBoxUtils.getItemStackMaxCount(carried2) - carried2.getCount(), player); // Leaves - stackable shulker boxes
|
||||||
optional1.ifPresent(stack -> {
|
optional1.ifPresent(itemStack2 -> {
|
||||||
carried2.grow(stack.getCount());
|
carried2.grow(itemStack2.getCount());
|
||||||
slot.onTake(player, stack);
|
slot.onTake(player, itemStack2);
|
||||||
@@ -603,7 +603,7 @@ public abstract class AbstractContainerMenu {
|
@@ -604,7 +611,7 @@ public abstract class AbstractContainerMenu {
|
||||||
Slot slot2 = this.slots.get(slotId);
|
Slot slot2 = this.slots.get(slotId);
|
||||||
if (slot2.hasItem()) {
|
if (slot2.hasItem()) {
|
||||||
ItemStack itemStack = slot2.getItem();
|
ItemStack itemStack = slot2.getItem();
|
||||||
@@ -286,7 +308,7 @@ index b4721c4e81cc2ae989765d86bd51ebf0be41758c..d03348c8139c398b65a2f4e4f960832c
|
|||||||
}
|
}
|
||||||
} else if (clickType == ClickType.THROW && this.getCarried().isEmpty() && slotId >= 0) {
|
} else if (clickType == ClickType.THROW && this.getCarried().isEmpty() && slotId >= 0) {
|
||||||
Slot slot2 = this.slots.get(slotId);
|
Slot slot2 = this.slots.get(slotId);
|
||||||
@@ -634,15 +634,15 @@ public abstract class AbstractContainerMenu {
|
@@ -635,15 +642,15 @@ public abstract class AbstractContainerMenu {
|
||||||
int maxStackSize = button == 0 ? 1 : -1;
|
int maxStackSize = button == 0 ? 1 : -1;
|
||||||
|
|
||||||
for (int i3 = 0; i3 < 2; i3++) {
|
for (int i3 = 0; i3 < 2; i3++) {
|
||||||
@@ -305,7 +327,7 @@ index b4721c4e81cc2ae989765d86bd51ebf0be41758c..d03348c8139c398b65a2f4e4f960832c
|
|||||||
itemStack.grow(itemStack1.getCount());
|
itemStack.grow(itemStack1.getCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -760,7 +760,7 @@ public abstract class AbstractContainerMenu {
|
@@ -761,7 +768,7 @@ public abstract class AbstractContainerMenu {
|
||||||
i = endIndex - 1;
|
i = endIndex - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,7 +336,7 @@ index b4721c4e81cc2ae989765d86bd51ebf0be41758c..d03348c8139c398b65a2f4e4f960832c
|
|||||||
while (!stack.isEmpty() && (reverseDirection ? i >= startIndex : i < endIndex)) {
|
while (!stack.isEmpty() && (reverseDirection ? i >= startIndex : i < endIndex)) {
|
||||||
Slot slot = this.slots.get(i);
|
Slot slot = this.slots.get(i);
|
||||||
ItemStack item = slot.getItem();
|
ItemStack item = slot.getItem();
|
||||||
@@ -861,7 +861,7 @@ public abstract class AbstractContainerMenu {
|
@@ -862,7 +869,7 @@ public abstract class AbstractContainerMenu {
|
||||||
public static boolean canItemQuickReplace(@Nullable Slot slot, ItemStack stack, boolean stackSizeMatters) {
|
public static boolean canItemQuickReplace(@Nullable Slot slot, ItemStack stack, boolean stackSizeMatters) {
|
||||||
boolean flag = slot == null || !slot.hasItem();
|
boolean flag = slot == null || !slot.hasItem();
|
||||||
return !flag && ItemStack.isSameItemSameComponents(stack, slot.getItem())
|
return !flag && ItemStack.isSameItemSameComponents(stack, slot.getItem())
|
||||||
@@ -323,7 +345,7 @@ index b4721c4e81cc2ae989765d86bd51ebf0be41758c..d03348c8139c398b65a2f4e4f960832c
|
|||||||
: flag;
|
: flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -869,7 +869,7 @@ public abstract class AbstractContainerMenu {
|
@@ -870,7 +877,7 @@ public abstract class AbstractContainerMenu {
|
||||||
return switch (type) {
|
return switch (type) {
|
||||||
case 0 -> Mth.floor((float)stack.getCount() / slots.size());
|
case 0 -> Mth.floor((float)stack.getCount() / slots.size());
|
||||||
case 1 -> 1;
|
case 1 -> 1;
|
||||||
@@ -332,7 +354,7 @@ index b4721c4e81cc2ae989765d86bd51ebf0be41758c..d03348c8139c398b65a2f4e4f960832c
|
|||||||
default -> stack.getCount();
|
default -> stack.getCount();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -891,7 +891,7 @@ public abstract class AbstractContainerMenu {
|
@@ -892,7 +899,7 @@ public abstract class AbstractContainerMenu {
|
||||||
for (int i = 0; i < container.getContainerSize(); i++) {
|
for (int i = 0; i < container.getContainerSize(); i++) {
|
||||||
ItemStack item = container.getItem(i);
|
ItemStack item = container.getItem(i);
|
||||||
if (!item.isEmpty()) {
|
if (!item.isEmpty()) {
|
||||||
@@ -342,7 +364,7 @@ index b4721c4e81cc2ae989765d86bd51ebf0be41758c..d03348c8139c398b65a2f4e4f960832c
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/inventory/MerchantContainer.java b/net/minecraft/world/inventory/MerchantContainer.java
|
diff --git a/net/minecraft/world/inventory/MerchantContainer.java b/net/minecraft/world/inventory/MerchantContainer.java
|
||||||
index a1576c3be00bdb19d02d52658c4b1818ea5c32db..be2f047bf1daab82473105865cd95955d4661a2a 100644
|
index 1e5dfb1f9e371fa23cdfa9280797aa0e183d4cd2..cf87267130c0aebd38206556261929d6f6383bc9 100644
|
||||||
--- a/net/minecraft/world/inventory/MerchantContainer.java
|
--- a/net/minecraft/world/inventory/MerchantContainer.java
|
||||||
+++ b/net/minecraft/world/inventory/MerchantContainer.java
|
+++ b/net/minecraft/world/inventory/MerchantContainer.java
|
||||||
@@ -109,7 +109,7 @@ public class MerchantContainer implements Container {
|
@@ -109,7 +109,7 @@ public class MerchantContainer implements Container {
|
||||||
@@ -368,34 +390,10 @@ index 5ceb8964476b40db4511bec91ff13c4f522a1357..371bad86218971d6e031c6d74307b2ab
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||||
index 76f50437396f8f856381d0fbef52953ef7c263f6..889a947cec81683cb7caa447dbf28b701fb38d0b 100644
|
index 24ecca78dc1140b6fc47d59f2acefca6bc2b0220..649d17dcd7856e3b1344192d8ea4b2e9f73fc03b 100644
|
||||||
--- a/net/minecraft/world/item/ItemStack.java
|
--- a/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/net/minecraft/world/item/ItemStack.java
|
+++ b/net/minecraft/world/item/ItemStack.java
|
||||||
@@ -151,16 +151,19 @@ public final class ItemStack implements DataComponentHolder {
|
@@ -165,7 +165,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
if (value.isEmpty() || value.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem()
|
|
||||||
buffer.writeVarInt(0);
|
|
||||||
} else {
|
|
||||||
- buffer.writeVarInt(io.papermc.paper.util.ItemComponentSanitizer.sanitizeCount(io.papermc.paper.util.ItemObfuscationSession.currentSession(), value, value.getCount())); // Paper - potentially sanitize count
|
|
||||||
- ITEM_STREAM_CODEC.encode(buffer, value.getItemHolder());
|
|
||||||
+ // Leaves start - stackable shulker boxes
|
|
||||||
+ final ItemStack itemStack = org.leavesmc.leaves.util.ShulkerBoxUtils.correctItemStackMaxStackSize(value.copy());
|
|
||||||
+ buffer.writeVarInt(io.papermc.paper.util.ItemComponentSanitizer.sanitizeCount(io.papermc.paper.util.ItemObfuscationSession.currentSession(), itemStack, itemStack.getCount())); // Paper - potentially sanitize count
|
|
||||||
+ ITEM_STREAM_CODEC.encode(buffer, itemStack.getItemHolder());
|
|
||||||
// Spigot start - filter
|
|
||||||
// value = value.copy();
|
|
||||||
// CraftItemStack.setItemMeta(value, CraftItemStack.getItemMeta(value)); // Paper - This is no longer with raw NBT being handled in metadata
|
|
||||||
// Paper start - adventure; conditionally render translatable components
|
|
||||||
boolean prev = net.minecraft.network.chat.ComponentSerialization.DONT_RENDER_TRANSLATABLES.get();
|
|
||||||
- try (final io.papermc.paper.util.SafeAutoClosable ignored = io.papermc.paper.util.ItemObfuscationSession.withContext(c -> c.itemStack(value))) { // pass the itemstack as context to the obfuscation session
|
|
||||||
+ try (final io.papermc.paper.util.SafeAutoClosable ignored = io.papermc.paper.util.ItemObfuscationSession.withContext(c -> c.itemStack(itemStack))) { // pass the itemstack as context to the obfuscation session // Leaves - stackable shulker boxes
|
|
||||||
net.minecraft.network.chat.ComponentSerialization.DONT_RENDER_TRANSLATABLES.set(true);
|
|
||||||
- DataComponentPatch.STREAM_CODEC.encode(buffer, value.components.asPatch());
|
|
||||||
+ DataComponentPatch.STREAM_CODEC.encode(buffer, itemStack.components.asPatch());
|
|
||||||
+ // Leaves end - stackable shulker boxes
|
|
||||||
} finally {
|
|
||||||
net.minecraft.network.chat.ComponentSerialization.DONT_RENDER_TRANSLATABLES.set(prev);
|
|
||||||
}
|
|
||||||
@@ -199,7 +202,7 @@ public final class ItemStack implements DataComponentHolder {
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Nullable
|
@Nullable
|
||||||
private Item item;
|
private Item item;
|
||||||
@@ -404,7 +402,37 @@ index 76f50437396f8f856381d0fbef52953ef7c263f6..889a947cec81683cb7caa447dbf28b70
|
|||||||
@Nullable
|
@Nullable
|
||||||
private Entity entityRepresentation;
|
private Entity entityRepresentation;
|
||||||
|
|
||||||
@@ -299,7 +302,7 @@ public final class ItemStack implements DataComponentHolder {
|
@@ -192,7 +192,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
|
} else {
|
||||||
|
Holder<Item> holder = Item.STREAM_CODEC.decode(buffer);
|
||||||
|
DataComponentPatch dataComponentPatch = codec.decode(buffer);
|
||||||
|
- return new ItemStack(holder, varInt, dataComponentPatch);
|
||||||
|
+ ItemStack itemStack = new ItemStack(holder, varInt, dataComponentPatch);
|
||||||
|
+ return org.leavesmc.leaves.util.ShulkerBoxUtils.decodeMaxStackSize(itemStack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -201,13 +202,15 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
|
if (value.isEmpty() || value.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem()
|
||||||
|
buffer.writeVarInt(0);
|
||||||
|
} else {
|
||||||
|
- buffer.writeVarInt(io.papermc.paper.util.sanitizer.ItemComponentSanitizer.sanitizeCount(io.papermc.paper.util.sanitizer.ItemObfuscationSession.currentSession(), value, value.getCount())); // Paper - potentially sanitize count
|
||||||
|
- Item.STREAM_CODEC.encode(buffer, value.getItemHolder());
|
||||||
|
+ // Leaves start - stackable shulker boxes
|
||||||
|
+ final ItemStack itemStack = org.leavesmc.leaves.util.ShulkerBoxUtils.encodeMaxStackSize(value.copy());
|
||||||
|
+ buffer.writeVarInt(io.papermc.paper.util.sanitizer.ItemComponentSanitizer.sanitizeCount(io.papermc.paper.util.sanitizer.ItemObfuscationSession.currentSession(), itemStack, itemStack.getCount())); // Paper - potentially sanitize count
|
||||||
|
+ Item.STREAM_CODEC.encode(buffer, itemStack.getItemHolder());
|
||||||
|
// Paper start - adventure; conditionally render translatable components
|
||||||
|
boolean prev = net.minecraft.network.chat.ComponentSerialization.DONT_RENDER_TRANSLATABLES.get();
|
||||||
|
- try (final io.papermc.paper.util.SafeAutoClosable ignored = io.papermc.paper.util.sanitizer.ItemObfuscationSession.withContext(c -> c.itemStack(value))) { // pass the itemstack as context to the obfuscation session
|
||||||
|
+ try (final io.papermc.paper.util.SafeAutoClosable ignored = io.papermc.paper.util.sanitizer.ItemObfuscationSession.withContext(c -> c.itemStack(itemStack))) { // pass the itemstack as context to the obfuscation session
|
||||||
|
net.minecraft.network.chat.ComponentSerialization.DONT_RENDER_TRANSLATABLES.set(true);
|
||||||
|
- codec.encode(buffer, value.components.asPatch());
|
||||||
|
+ codec.encode(buffer, itemStack.components.asPatch());
|
||||||
|
} finally {
|
||||||
|
net.minecraft.network.chat.ComponentSerialization.DONT_RENDER_TRANSLATABLES.set(prev);
|
||||||
|
}
|
||||||
|
@@ -302,7 +305,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
|
|
||||||
for (ItemStack itemStack : itemContainerContents.nonEmptyItems()) {
|
for (ItemStack itemStack : itemContainerContents.nonEmptyItems()) {
|
||||||
int count = itemStack.getCount();
|
int count = itemStack.getCount();
|
||||||
@@ -414,10 +442,10 @@ index 76f50437396f8f856381d0fbef52953ef7c263f6..889a947cec81683cb7caa447dbf28b70
|
|||||||
return DataResult.error(() -> "Item stack with count of " + count + " was larger than maximum: " + maxStackSize);
|
return DataResult.error(() -> "Item stack with count of " + count + " was larger than maximum: " + maxStackSize);
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/level/block/AbstractCauldronBlock.java b/net/minecraft/world/level/block/AbstractCauldronBlock.java
|
diff --git a/net/minecraft/world/level/block/AbstractCauldronBlock.java b/net/minecraft/world/level/block/AbstractCauldronBlock.java
|
||||||
index 648d22cdfcf261494038d589f5a5e32704083076..47e480515715376f568b7cb7468edf2bff3d4307 100644
|
index ad3f32888afd8b5f0038445a1b0fcc8cacec9fe2..18b7b7fe68c54a400f269f5ff1d09fe9e3d519b8 100644
|
||||||
--- a/net/minecraft/world/level/block/AbstractCauldronBlock.java
|
--- a/net/minecraft/world/level/block/AbstractCauldronBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/AbstractCauldronBlock.java
|
+++ b/net/minecraft/world/level/block/AbstractCauldronBlock.java
|
||||||
@@ -58,9 +58,27 @@ public abstract class AbstractCauldronBlock extends Block {
|
@@ -62,9 +62,27 @@ public abstract class AbstractCauldronBlock extends Block {
|
||||||
ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult
|
ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult
|
||||||
) {
|
) {
|
||||||
CauldronInteraction cauldronInteraction = this.interactions.map().get(stack.getItem());
|
CauldronInteraction cauldronInteraction = this.interactions.map().get(stack.getItem());
|
||||||
@@ -447,10 +475,10 @@ index 648d22cdfcf261494038d589f5a5e32704083076..47e480515715376f568b7cb7468edf2b
|
|||||||
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
|
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
diff --git a/net/minecraft/world/level/block/CrafterBlock.java b/net/minecraft/world/level/block/CrafterBlock.java
|
diff --git a/net/minecraft/world/level/block/CrafterBlock.java b/net/minecraft/world/level/block/CrafterBlock.java
|
||||||
index 5f5966278faf86ed9b28955c80ba845c0cb75595..dcc503b3dca65ec2a72f6f3dc29589c6c295b181 100644
|
index 38b03c7b02bdfc579e5e126c12de3d878e26d188..33e24f2c3b63b2d3b55dfae2f2e55869abeed055 100644
|
||||||
--- a/net/minecraft/world/level/block/CrafterBlock.java
|
--- a/net/minecraft/world/level/block/CrafterBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/CrafterBlock.java
|
+++ b/net/minecraft/world/level/block/CrafterBlock.java
|
||||||
@@ -200,7 +200,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
@@ -192,7 +192,7 @@ public class CrafterBlock extends BaseEntityBlock {
|
||||||
Direction direction = state.getValue(ORIENTATION).front();
|
Direction direction = state.getValue(ORIENTATION).front();
|
||||||
Container containerAt = HopperBlockEntity.getContainerAt(level, pos.relative(direction));
|
Container containerAt = HopperBlockEntity.getContainerAt(level, pos.relative(direction));
|
||||||
ItemStack itemStack = stack.copy();
|
ItemStack itemStack = stack.copy();
|
||||||
@@ -460,10 +488,10 @@ index 5f5966278faf86ed9b28955c80ba845c0cb75595..dcc503b3dca65ec2a72f6f3dc29589c6
|
|||||||
org.bukkit.craftbukkit.inventory.CraftItemStack oitemstack = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack);
|
org.bukkit.craftbukkit.inventory.CraftItemStack oitemstack = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack);
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
index 77e7188180cce9ef881de64b263c704b219b610a..2f5fa4310f475ecbb29e69c0461c7d3276f8536d 100644
|
index 7729c33cad94cf2b4162324be75713650fc9d378..78b3bdb668320e9cf2fb09b59929fac43cf56aca 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||||
@@ -414,7 +414,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
@@ -409,7 +409,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||||
ItemStack itemStack = this.items.get(index);
|
ItemStack itemStack = this.items.get(index);
|
||||||
boolean flag = !stack.isEmpty() && ItemStack.isSameItemSameComponents(itemStack, stack);
|
boolean flag = !stack.isEmpty() && ItemStack.isSameItemSameComponents(itemStack, stack);
|
||||||
this.items.set(index, stack);
|
this.items.set(index, stack);
|
||||||
@@ -473,10 +501,10 @@ index 77e7188180cce9ef881de64b263c704b219b610a..2f5fa4310f475ecbb29e69c0461c7d32
|
|||||||
this.cookingTotalTime = getTotalCookTime(serverLevel, this, this.recipeType, this.cookSpeedMultiplier); // Paper - cook speed multiplier API
|
this.cookingTotalTime = getTotalCookTime(serverLevel, this, this.recipeType, this.cookSpeedMultiplier); // Paper - cook speed multiplier API
|
||||||
this.cookingTimer = 0;
|
this.cookingTimer = 0;
|
||||||
diff --git a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||||
index 26db603ed681a6c302596627d4dd5bf8a9bafc4e..9fcb70b5bf1912a5499aa7daeaa089adbe60cc55 100644
|
index c63370fd458fb4f7190b79b1a8174fcc92d88f9c..4cca3fbbb93bb76d5d501dfad6997d909211809e 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||||
@@ -146,7 +146,7 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
|
@@ -148,7 +148,7 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
|
||||||
@Override
|
@Override
|
||||||
public void setItem(int slot, ItemStack stack) {
|
public void setItem(int slot, ItemStack stack) {
|
||||||
this.getItems().set(slot, stack);
|
this.getItems().set(slot, stack);
|
||||||
@@ -486,10 +514,10 @@ index 26db603ed681a6c302596627d4dd5bf8a9bafc4e..9fcb70b5bf1912a5499aa7daeaa089ad
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
index 42a29e700d2549de7cd905c373212e9757bcfcf1..3122753c96e98e57fa900cd15005ab4874e4b1db 100644
|
index 2d979850378c05ce569782d8e04a452f986612a7..a2fe5fdf50ae731e423821a0d1c52141b478e0be 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||||
@@ -109,7 +109,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
@@ -113,7 +113,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||||
public void setItem(int index, ItemStack stack) {
|
public void setItem(int index, ItemStack stack) {
|
||||||
this.unpackLootTable(null);
|
this.unpackLootTable(null);
|
||||||
this.getItems().set(index, stack);
|
this.getItems().set(index, stack);
|
||||||
@@ -498,7 +526,7 @@ index 42a29e700d2549de7cd905c373212e9757bcfcf1..3122753c96e98e57fa900cd15005ab48
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -688,9 +688,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
@@ -692,9 +692,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||||
if (item.isEmpty()) {
|
if (item.isEmpty()) {
|
||||||
// Spigot start - SPIGOT-6693, SimpleContainer#setItem
|
// Spigot start - SPIGOT-6693, SimpleContainer#setItem
|
||||||
ItemStack leftover = ItemStack.EMPTY; // Paper - Make hoppers respect inventory max stack size
|
ItemStack leftover = ItemStack.EMPTY; // Paper - Make hoppers respect inventory max stack size
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Return nether portal fix
|
|||||||
This patch is powered by NetherPortalFix(https://github.com/TwelveIterationMods/NetherPortalFix)
|
This patch is powered by NetherPortalFix(https://github.com/TwelveIterationMods/NetherPortalFix)
|
||||||
|
|
||||||
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 0df1160ce4e027cc1c1bf7071a4d8730aaa7fde6..eba1717566a8ea534bbf149e0593cc7656df2db9 100644
|
index 66110486725de7967e55839043b9fc9690e4c0f5..f144a8bd5eb55ce093ad92ffd1304860dc52c1b1 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
|
||||||
@@ -1484,6 +1484,21 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1428,6 +1428,21 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
org.bukkit.event.player.PlayerChangedWorldEvent changeEvent = new org.bukkit.event.player.PlayerChangedWorldEvent(this.getBukkitEntity(), serverLevel.getWorld());
|
org.bukkit.event.player.PlayerChangedWorldEvent changeEvent = new org.bukkit.event.player.PlayerChangedWorldEvent(this.getBukkitEntity(), serverLevel.getWorld());
|
||||||
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
|
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -32,10 +32,10 @@ index 0df1160ce4e027cc1c1bf7071a4d8730aaa7fde6..eba1717566a8ea534bbf149e0593cc76
|
|||||||
if (this.isBlocking()) {
|
if (this.isBlocking()) {
|
||||||
this.stopUsingItem();
|
this.stopUsingItem();
|
||||||
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 a79f83991aa50d45695beeeb018f203c6d7ae6d8..46d93b9c063cb056f3051ebe0f3558f5b4f55bea 100644
|
index b4a4ba86fd6023db33b2ee9cb02ec41f9733a813..3b612c02ddbf25c6dcfe5df14fca027986e6f252 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
|
||||||
@@ -852,6 +852,20 @@ public abstract class PlayerList {
|
@@ -860,6 +860,20 @@ public abstract class PlayerList {
|
||||||
if (fromWorld != level) {
|
if (fromWorld != level) {
|
||||||
org.bukkit.event.player.PlayerChangedWorldEvent event = new org.bukkit.event.player.PlayerChangedWorldEvent(player.getBukkitEntity(), fromWorld.getWorld());
|
org.bukkit.event.player.PlayerChangedWorldEvent event = new org.bukkit.event.player.PlayerChangedWorldEvent(player.getBukkitEntity(), fromWorld.getWorld());
|
||||||
this.server.server.getPluginManager().callEvent(event);
|
this.server.server.getPluginManager().callEvent(event);
|
||||||
@@ -57,10 +57,10 @@ index a79f83991aa50d45695beeeb018f203c6d7ae6d8..46d93b9c063cb056f3051ebe0f3558f5
|
|||||||
|
|
||||||
// Save player file again if they were disconnected
|
// Save player file again if they were disconnected
|
||||||
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 35a00a30a726294d6c6e3d879cfec9fcc7d10028..d1f25cc8efe38b152bb1a0e8886c8024da3ba840 100644
|
index 108430b3934a6f9757e7be50d77e760bbade669c..6893ca36cd4ae9a62fecedb1167cc6cf797a7f8f 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
|
||||||
@@ -274,7 +274,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -245,7 +245,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
protected ItemStack useItem = ItemStack.EMPTY;
|
protected ItemStack useItem = ItemStack.EMPTY;
|
||||||
public int useItemRemaining;
|
public int useItemRemaining;
|
||||||
protected int fallFlyTicks;
|
protected int fallFlyTicks;
|
||||||
@@ -70,10 +70,10 @@ index 35a00a30a726294d6c6e3d879cfec9fcc7d10028..d1f25cc8efe38b152bb1a0e8886c8024
|
|||||||
@Nullable
|
@Nullable
|
||||||
private DamageSource lastDamageSource;
|
private DamageSource lastDamageSource;
|
||||||
diff --git a/net/minecraft/world/level/block/NetherPortalBlock.java b/net/minecraft/world/level/block/NetherPortalBlock.java
|
diff --git a/net/minecraft/world/level/block/NetherPortalBlock.java b/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||||
index e2eb693b0130513115392cb0cb5a829ede5be8c5..fd6e228e5943c7004a595b5e154b7606ed330ea5 100644
|
index 2f08780430fc643991ffb4aeba1f1ae8e78944d2..171b383efabbbe849aff28832c47076f85a46307 100644
|
||||||
--- a/net/minecraft/world/level/block/NetherPortalBlock.java
|
--- a/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/NetherPortalBlock.java
|
+++ b/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||||
@@ -183,7 +183,18 @@ public class NetherPortalBlock extends Block implements Portal {
|
@@ -184,7 +184,18 @@ public class NetherPortalBlock extends Block implements Portal {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private TeleportTransition getExitPortal(ServerLevel level, Entity entity, BlockPos pos, BlockPos exitPos, boolean isNether, WorldBorder worldBorder, int searchRadius, boolean canCreatePortal, int createRadius) { // CraftBukkit
|
private TeleportTransition getExitPortal(ServerLevel level, Entity entity, BlockPos pos, BlockPos exitPos, boolean isNether, WorldBorder worldBorder, int searchRadius, boolean canCreatePortal, int createRadius) { // CraftBukkit
|
||||||
@@ -18,7 +18,7 @@ index 8c3151c25c172b846f0d028b5100718ada2d09d7..d59d05f8894481fb5ebe1aeb8ee7a162
|
|||||||
private final String baseUrl;
|
private final String baseUrl;
|
||||||
private final URL joinUrl;
|
private final URL joinUrl;
|
||||||
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
||||||
index 9aa664537cc37e44db46d5a2a64ae3116938c681..1a5a8ad60240c0864875f6314e01adab4a283ddf 100644
|
index 9c9b601a3f903bebb0dd1bda0e24745587229727..4cde785a679dccc3dfa42272e6094328e9ce98c1 100644
|
||||||
--- a/net/minecraft/server/Main.java
|
--- a/net/minecraft/server/Main.java
|
||||||
+++ b/net/minecraft/server/Main.java
|
+++ b/net/minecraft/server/Main.java
|
||||||
@@ -177,7 +177,7 @@ public class Main {
|
@@ -177,7 +177,7 @@ public class Main {
|
||||||
@@ -31,10 +31,10 @@ index 9aa664537cc37e44db46d5a2a64ae3116938c681..1a5a8ad60240c0864875f6314e01adab
|
|||||||
String string = Optional.ofNullable((String) optionSet.valueOf("world")).orElse(dedicatedServerSettings.getProperties().levelName);
|
String string = Optional.ofNullable((String) optionSet.valueOf("world")).orElse(dedicatedServerSettings.getProperties().levelName);
|
||||||
LevelStorageSource levelStorageSource = LevelStorageSource.createDefault(file.toPath());
|
LevelStorageSource levelStorageSource = LevelStorageSource.createDefault(file.toPath());
|
||||||
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 09fc1c1923f7cc4470cca3b703810fb165c4ca15..1ce3afe6c3e3b7c0aad2706215d75a265d892070 100644
|
index 105c207b8db2c505f256f4104642af5929b50aa9..50f73905e6785d87a0faf886802d956a1c7b9751 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
|
||||||
@@ -245,7 +245,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -244,7 +244,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
private boolean isDemo;
|
private boolean isDemo;
|
||||||
private volatile boolean isReady;
|
private volatile boolean isReady;
|
||||||
private long lastOverloadWarningNanos;
|
private long lastOverloadWarningNanos;
|
||||||
@@ -5,20 +5,20 @@ Subject: [PATCH] Configurable 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 ea808042e8fc647603c213cc1bea2fa16d22e749..bf316830f199c3f83dc2fccccf51885431729389 100644
|
index 632a1cb5eee13d7287915433e9e646ec4a3a1a09..0e5c4aa2b8856c7b88ff90031715a55c4a1bf89e 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
|
||||||
@@ -255,7 +255,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -261,7 +261,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
public double yOld;
|
||||||
public double zOld;
|
public double zOld;
|
||||||
public boolean noPhysics;
|
public boolean noPhysics;
|
||||||
private boolean wasOnFire;
|
|
||||||
- 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 = org.leavesmc.leaves.LeavesConfig.modify.useVanillaRandom ? RandomSource.create() : SHARED_RANDOM; // Paper - Share random for entities to make them more random // Leaves - but mojang use it, optimize? no!
|
+ public final RandomSource random = org.leavesmc.leaves.LeavesConfig.modify.useVanillaRandom ? RandomSource.create() : SHARED_RANDOM; // Paper - Share random for entities to make them more random // Leaves - but mojang use it, optimize? no!
|
||||||
public int tickCount;
|
public int tickCount;
|
||||||
private int remainingFireTicks = -this.getFireImmuneTicks();
|
private int remainingFireTicks = -this.getFireImmuneTicks();
|
||||||
public boolean wasTouchingWater;
|
public boolean wasTouchingWater;
|
||||||
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
|
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
|
||||||
index 94244b148533ef026bf5c56abbc2bb5cfa83c938..91725b42a01790e0ac7d00bdc4a132ebb942a787 100644
|
index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..9007128a4619ab6130424786ae81c23ae38e55e9 100644
|
||||||
--- a/net/minecraft/world/entity/animal/Bee.java
|
--- a/net/minecraft/world/entity/animal/Bee.java
|
||||||
+++ b/net/minecraft/world/entity/animal/Bee.java
|
+++ b/net/minecraft/world/entity/animal/Bee.java
|
||||||
@@ -801,7 +801,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
@@ -801,7 +801,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
@@ -40,7 +40,7 @@ index 94244b148533ef026bf5c56abbc2bb5cfa83c938..91725b42a01790e0ac7d00bdc4a132eb
|
|||||||
BeeGoToKnownFlowerGoal() {
|
BeeGoToKnownFlowerGoal() {
|
||||||
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
|
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
|
||||||
diff --git a/net/minecraft/world/entity/animal/Squid.java b/net/minecraft/world/entity/animal/Squid.java
|
diff --git a/net/minecraft/world/entity/animal/Squid.java b/net/minecraft/world/entity/animal/Squid.java
|
||||||
index 687ac3f50ed517a0b4df70c0c0a01215691ac718..dd3a0b30ab99d3a6680243c1dfb6dbddd7af2dbc 100644
|
index 58e1bc90cbc32669fa6c66d214119f0c459ff38c..ea41360af5e5d49c96ca24e9c36bd52cfdd7d40c 100644
|
||||||
--- a/net/minecraft/world/entity/animal/Squid.java
|
--- a/net/minecraft/world/entity/animal/Squid.java
|
||||||
+++ b/net/minecraft/world/entity/animal/Squid.java
|
+++ b/net/minecraft/world/entity/animal/Squid.java
|
||||||
@@ -46,7 +46,7 @@ public class Squid extends AgeableWaterCreature {
|
@@ -46,7 +46,7 @@ public class Squid extends AgeableWaterCreature {
|
||||||
@@ -53,10 +53,10 @@ index 687ac3f50ed517a0b4df70c0c0a01215691ac718..dd3a0b30ab99d3a6680243c1dfb6dbdd
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 d2d258246e7f7332c0420077e33c05e222bda46d..4f5db8203189a413f410fe7648e4995bae171918 100644
|
index b0e60d1d2a44bb35c87c35e82a172a38406b6c54..0cb2d5cd37171cd6e01748ed3d2ce99da1a15e3f 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
|
||||||
@@ -63,7 +63,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
@@ -70,7 +70,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||||
// Paper start - Don't use level random in entity constructors (to make them thread-safe)
|
// Paper start - Don't use level random in entity constructors (to make them thread-safe)
|
||||||
this(EntityType.ITEM, level);
|
this(EntityType.ITEM, level);
|
||||||
this.setPos(posX, posY, posZ);
|
this.setPos(posX, posY, posZ);
|
||||||
@@ -72,10 +72,10 @@ index d2d258246e7f7332c0420077e33c05e222bda46d..4f5db8203189a413f410fe7648e4995b
|
|||||||
// Paper end - Don't use level random in entity constructors
|
// Paper end - Don't use level random in entity constructors
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
|
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
index 583864d73999e4e25f6c26920c0bf9a7504d8463..717d96fa6459c77db9274c9cb3bedec4a4ff1a90 100644
|
index 0f28b1befd42a85ffa5462e86d5cde142f9d1196..8cbcae0ef84b160d08b677972dc70cabfb5b6c5f 100644
|
||||||
--- a/net/minecraft/world/entity/item/PrimedTnt.java
|
--- a/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
|
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
|
||||||
@@ -66,7 +66,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
@@ -69,7 +69,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
||||||
public PrimedTnt(Level level, double x, double y, double z, @Nullable LivingEntity owner) {
|
public PrimedTnt(Level level, double x, double y, double z, @Nullable LivingEntity owner) {
|
||||||
this(EntityType.TNT, level);
|
this(EntityType.TNT, level);
|
||||||
this.setPos(x, y, z);
|
this.setPos(x, y, z);
|
||||||
@@ -20,10 +20,10 @@ index 4535858701b2bb232b9d2feb2af6551526232ddc..2a51acd97afc525170e8001b76f57ad1
|
|||||||
if (var4 instanceof ReportedException reportedException && reportedException.getCause() instanceof OutOfMemoryError) {
|
if (var4 instanceof ReportedException reportedException && reportedException.getCause() instanceof OutOfMemoryError) {
|
||||||
throw makeReportedException(var4, packet, processor);
|
throw makeReportedException(var4, packet, processor);
|
||||||
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 1ce3afe6c3e3b7c0aad2706215d75a265d892070..de9b2b92456466376186737914706df22e1578f5 100644
|
index 50f73905e6785d87a0faf886802d956a1c7b9751..5652336b01fc7a1a0eb8a86b2a1d921872d60c2a 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
|
||||||
@@ -1727,6 +1727,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1725,6 +1725,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
try {
|
try {
|
||||||
serverLevel.tick(hasTimeLeft);
|
serverLevel.tick(hasTimeLeft);
|
||||||
@@ -35,10 +35,10 @@ index 1ce3afe6c3e3b7c0aad2706215d75a265d892070..de9b2b92456466376186737914706df2
|
|||||||
CrashReport crashReport = CrashReport.forThrowable(var7, "Exception ticking world");
|
CrashReport crashReport = CrashReport.forThrowable(var7, "Exception ticking world");
|
||||||
serverLevel.fillReportDetails(crashReport);
|
serverLevel.fillReportDetails(crashReport);
|
||||||
diff --git a/net/minecraft/world/level/block/ShulkerBoxBlock.java b/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
diff --git a/net/minecraft/world/level/block/ShulkerBoxBlock.java b/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||||
index cdf835ff107bc1eadde706d69384e687626fce70..7794e66211af34ecca8524d3ca7e0d928f0ab0eb 100644
|
index 49bac7af90b0a7c490141be6357563447783c6ca..fef902077b69830b570d1adf86603f45b4f6a839 100644
|
||||||
--- a/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
--- a/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
+++ b/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||||
@@ -234,7 +234,17 @@ public class ShulkerBoxBlock extends BaseEntityBlock {
|
@@ -183,7 +183,17 @@ public class ShulkerBoxBlock extends BaseEntityBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getAnalogOutputSignal(BlockState blockState, Level level, BlockPos pos) {
|
protected int getAnalogOutputSignal(BlockState blockState, Level level, BlockPos pos) {
|
||||||
@@ -57,11 +57,44 @@ index cdf835ff107bc1eadde706d69384e687626fce70..7794e66211af34ecca8524d3ca7e0d92
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Block getBlockByColor(@Nullable DyeColor color) {
|
public static Block getBlockByColor(@Nullable DyeColor color) {
|
||||||
|
diff --git a/net/minecraft/world/level/block/state/StateHolder.java b/net/minecraft/world/level/block/state/StateHolder.java
|
||||||
|
index 9b9842462b210b0407279ee8a8e9ccecf3ead005..ce809dc4997aa1b9c8802208679462c8f9763a19 100644
|
||||||
|
--- a/net/minecraft/world/level/block/state/StateHolder.java
|
||||||
|
+++ b/net/minecraft/world/level/block/state/StateHolder.java
|
||||||
|
@@ -104,6 +104,7 @@ public abstract class StateHolder<O, S> implements ca.spottedleaf.moonrise.patch
|
||||||
|
if (ret != null) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.updateSuppressionCrashFix) throw new org.leavesmc.leaves.util.UpdateSuppressionException(null, null); // Leaves - fix update suppression crash
|
||||||
|
throw new IllegalArgumentException("Cannot get property " + property + " as it does not exist in " + this.owner);
|
||||||
|
// Paper end - optimise blockstate property access
|
||||||
|
}
|
||||||
|
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
|
index bf731da711ce629c0f9250a7bd4025d363623773..845319dd3e355f739cce70b7df3172dd146601b1 100644
|
||||||
|
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
|
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
|
@@ -371,7 +371,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||||
|
if (blockState == state) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
- Block block = state.getBlock();
|
||||||
|
+ Block block = state.getBlock(); try { // Leaves start - fix update suppression crash
|
||||||
|
this.heightmaps.get(Heightmap.Types.MOTION_BLOCKING).update(i, y, i2, state);
|
||||||
|
this.heightmaps.get(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES).update(i, y, i2, state);
|
||||||
|
this.heightmaps.get(Heightmap.Types.OCEAN_FLOOR).update(i, y, i2, state);
|
||||||
|
@@ -443,6 +443,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||||
|
this.markUnsaved();
|
||||||
|
return blockState;
|
||||||
|
}
|
||||||
|
+ } catch (org.leavesmc.leaves.util.UpdateSuppressionException e) {throw new org.leavesmc.leaves.util.UpdateSuppressionException(pos, block);} // Leaves end - fix update suppression crash
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
diff --git a/net/minecraft/world/level/redstone/NeighborUpdater.java b/net/minecraft/world/level/redstone/NeighborUpdater.java
|
diff --git a/net/minecraft/world/level/redstone/NeighborUpdater.java b/net/minecraft/world/level/redstone/NeighborUpdater.java
|
||||||
index 26c15c60d358273a3b369c286771c81d6f0979dd..1c75e37bf1fa2cc5d80add2bcf00b95defd0079d 100644
|
index 332b33a004ab11150cca0cc2cefc26d0286648f5..263bf2b795057c2d5218bf9cfb684e526601aa77 100644
|
||||||
--- a/net/minecraft/world/level/redstone/NeighborUpdater.java
|
--- a/net/minecraft/world/level/redstone/NeighborUpdater.java
|
||||||
+++ b/net/minecraft/world/level/redstone/NeighborUpdater.java
|
+++ b/net/minecraft/world/level/redstone/NeighborUpdater.java
|
||||||
@@ -63,9 +63,17 @@ public interface NeighborUpdater {
|
@@ -60,9 +60,17 @@ public interface NeighborUpdater {
|
||||||
state.handleNeighborChanged(level, pos, neighborBlock, orientation, movedByPiston);
|
state.handleNeighborChanged(level, pos, neighborBlock, orientation, movedByPiston);
|
||||||
// Spigot start
|
// Spigot start
|
||||||
} catch (StackOverflowError ex) {
|
} catch (StackOverflowError ex) {
|
||||||
@@ -69,7 +102,7 @@ index 26c15c60d358273a3b369c286771c81d6f0979dd..1c75e37bf1fa2cc5d80add2bcf00b95d
|
|||||||
+ if (org.leavesmc.leaves.LeavesConfig.modify.updateSuppressionCrashFix) {
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.updateSuppressionCrashFix) {
|
||||||
+ throw new org.leavesmc.leaves.util.UpdateSuppressionException(pos, neighborBlock);
|
+ throw new org.leavesmc.leaves.util.UpdateSuppressionException(pos, neighborBlock);
|
||||||
+ }
|
+ }
|
||||||
level.lastPhysicsProblem = new BlockPos(pos);
|
level.lastPhysicsProblem = pos.immutable();
|
||||||
// Spigot end
|
// Spigot end
|
||||||
} catch (Throwable var9) {
|
} catch (Throwable var9) {
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.modify.updateSuppressionCrashFix) {
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.updateSuppressionCrashFix) {
|
||||||
@@ -5,22 +5,22 @@ Subject: [PATCH] Bedrock break list
|
|||||||
|
|
||||||
|
|
||||||
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 de9b2b92456466376186737914706df22e1578f5..7822cecf362cd8d430d90c0daac6e97c8a8d124b 100644
|
index f12b397901c0a2f779221e6694cecaced7069c9e..ca4fdcabbe6c0c57bfa13ef6d83bcd560baae8fc 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
|
||||||
@@ -1754,6 +1754,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1752,6 +1752,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
profilerFiller.popPush("server gui refresh");
|
profilerFiller.popPush("server gui refresh");
|
||||||
|
|
||||||
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleTick(); // Leaves - protocol
|
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleTick(tickCount); // Leaves - protocol
|
||||||
+ org.leavesmc.leaves.util.BreakBedrockList.endTick(); // Leaves - break bedrock list
|
+ org.leavesmc.leaves.util.BreakBedrockList.endTick(); // Leaves - break bedrock list
|
||||||
|
|
||||||
for (int i = 0; i < this.tickables.size(); i++) {
|
for (int i = 0; i < this.tickables.size(); i++) {
|
||||||
this.tickables.get(i).run();
|
this.tickables.get(i).run();
|
||||||
diff --git a/net/minecraft/server/ServerScoreboard.java b/net/minecraft/server/ServerScoreboard.java
|
diff --git a/net/minecraft/server/ServerScoreboard.java b/net/minecraft/server/ServerScoreboard.java
|
||||||
index 16c3bace00357f67a1bc050d95f5a27ec165de93..8c85455783b2b5e9e58b40fa0b3c2cf23de0e2b2 100644
|
index 9e22e93b1fab6822e0e9c1122024a88942c8679e..75fe9d99d22b1e89ad8011632d636772e118b0a8 100644
|
||||||
--- a/net/minecraft/server/ServerScoreboard.java
|
--- a/net/minecraft/server/ServerScoreboard.java
|
||||||
+++ b/net/minecraft/server/ServerScoreboard.java
|
+++ b/net/minecraft/server/ServerScoreboard.java
|
||||||
@@ -150,6 +150,7 @@ public class ServerScoreboard extends Scoreboard {
|
@@ -154,6 +154,7 @@ public class ServerScoreboard extends Scoreboard {
|
||||||
@Override
|
@Override
|
||||||
public void onObjectiveAdded(Objective objective) {
|
public void onObjectiveAdded(Objective objective) {
|
||||||
super.onObjectiveAdded(objective);
|
super.onObjectiveAdded(objective);
|
||||||
@@ -28,7 +28,7 @@ index 16c3bace00357f67a1bc050d95f5a27ec165de93..8c85455783b2b5e9e58b40fa0b3c2cf2
|
|||||||
this.setDirty();
|
this.setDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,6 +167,7 @@ public class ServerScoreboard extends Scoreboard {
|
@@ -170,6 +171,7 @@ public class ServerScoreboard extends Scoreboard {
|
||||||
@Override
|
@Override
|
||||||
public void onObjectiveRemoved(Objective objective) {
|
public void onObjectiveRemoved(Objective objective) {
|
||||||
super.onObjectiveRemoved(objective);
|
super.onObjectiveRemoved(objective);
|
||||||
@@ -37,10 +37,10 @@ index 16c3bace00357f67a1bc050d95f5a27ec165de93..8c85455783b2b5e9e58b40fa0b3c2cf2
|
|||||||
this.stopTrackingObjective(objective);
|
this.stopTrackingObjective(objective);
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
diff --git a/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||||
index 2b1d5328072710784d2399b523afcbcfb1d7f0cd..080b5611f7e71d4c18837fdacb2cc959ce0a442d 100644
|
index 10484ee85482e86be5e0a09d8202df600a32092e..16aa9f5996dc6eda95541fddb01e00e41305357a 100644
|
||||||
--- a/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
--- a/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
+++ b/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||||
@@ -97,6 +97,11 @@ public class PistonBaseBlock extends DirectionalBlock {
|
@@ -74,6 +74,11 @@ public class PistonBaseBlock extends DirectionalBlock {
|
||||||
@Override
|
@Override
|
||||||
public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
|
public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
|
||||||
if (!level.isClientSide) {
|
if (!level.isClientSide) {
|
||||||
@@ -52,7 +52,7 @@ index 2b1d5328072710784d2399b523afcbcfb1d7f0cd..080b5611f7e71d4c18837fdacb2cc959
|
|||||||
this.checkIfExtend(level, pos, state);
|
this.checkIfExtend(level, pos, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,7 +257,13 @@ public class PistonBaseBlock extends DirectionalBlock {
|
@@ -229,7 +234,13 @@ public class PistonBaseBlock extends DirectionalBlock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end - Fix sticky pistons and BlockPistonRetractEvent
|
// Paper end - Fix sticky pistons and BlockPistonRetractEvent
|
||||||
@@ -67,10 +67,10 @@ index 2b1d5328072710784d2399b523afcbcfb1d7f0cd..080b5611f7e71d4c18837fdacb2cc959
|
|||||||
} else {
|
} else {
|
||||||
this.moveBlocks(level, pos, direction, false);
|
this.moveBlocks(level, pos, direction, false);
|
||||||
}
|
}
|
||||||
@@ -261,6 +272,11 @@ public class PistonBaseBlock extends DirectionalBlock {
|
@@ -238,6 +249,11 @@ public class PistonBaseBlock extends DirectionalBlock {
|
||||||
// Paper start - Protect Bedrock and End Portal/Frames from being destroyed; fix headless pistons breaking blocks
|
// Paper start - Protect Bedrock and End Portal/Frames from being destroyed; fix headless pistons breaking blocks
|
||||||
BlockPos headPos = pos.relative(direction);
|
BlockPos headPos = pos.relative(direction);
|
||||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPermanentBlockBreakExploits || level.getBlockState(headPos) == Blocks.PISTON_HEAD.defaultBlockState().setValue(FACING, direction)) { // double check to make sure we're not a headless piston.
|
if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPermanentBlockBreakExploits || level.getBlockState(headPos) == Blocks.PISTON_HEAD.defaultBlockState().setValue(FACING, direction)) { // double check to make sure we're not a headless piston
|
||||||
+ // Leaves start - break bedrock list
|
+ // Leaves start - break bedrock list
|
||||||
+ if (level.getBlockState(headPos).getBlock() == Blocks.BEDROCK) {
|
+ if (level.getBlockState(headPos).getBlock() == Blocks.BEDROCK) {
|
||||||
+ org.leavesmc.leaves.util.BreakBedrockList.onPistonBreakBedrock(level, headPos);
|
+ org.leavesmc.leaves.util.BreakBedrockList.onPistonBreakBedrock(level, headPos);
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix trapdoor feature
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/block/TrapDoorBlock.java b/net/minecraft/world/level/block/TrapDoorBlock.java
|
diff --git a/net/minecraft/world/level/block/TrapDoorBlock.java b/net/minecraft/world/level/block/TrapDoorBlock.java
|
||||||
index 46c23990e78ce77b188052672778bdef560a0d13..c6aad768cad0f0eccbe5405f41c4fa34583970ba 100644
|
index a2140d22dc58aa2df1afbeb5170d04fd65739d55..fcea4fa82e97fc262726cfcf9c4f8002b66700f5 100644
|
||||||
--- a/net/minecraft/world/level/block/TrapDoorBlock.java
|
--- a/net/minecraft/world/level/block/TrapDoorBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/TrapDoorBlock.java
|
+++ b/net/minecraft/world/level/block/TrapDoorBlock.java
|
||||||
@@ -160,6 +160,8 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW
|
@@ -139,6 +139,8 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW
|
||||||
hasNeighborSignal = eventRedstone.getNewCurrent() > 0;
|
hasNeighborSignal = eventRedstone.getNewCurrent() > 0;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -16,8 +16,8 @@ index 46c23990e78ce77b188052672778bdef560a0d13..c6aad768cad0f0eccbe5405f41c4fa34
|
|||||||
+ /* Leaves - it is feature, not bug!
|
+ /* Leaves - it is feature, not bug!
|
||||||
// Paper start - break redstone on trapdoors early
|
// Paper start - break redstone on trapdoors early
|
||||||
boolean open = state.getValue(TrapDoorBlock.OPEN) != hasNeighborSignal;
|
boolean open = state.getValue(TrapDoorBlock.OPEN) != hasNeighborSignal;
|
||||||
// note: this must run before any state for this block/its neighborus are written to the world
|
// note: this must run before any state for this block/its neighbours are written to the world
|
||||||
@@ -178,8 +180,9 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW
|
@@ -157,8 +159,9 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,6 +26,6 @@ index 46c23990e78ce77b188052672778bdef560a0d13..c6aad768cad0f0eccbe5405f41c4fa34
|
|||||||
+ */
|
+ */
|
||||||
+
|
+
|
||||||
+ if (state.getValue(TrapDoorBlock.OPEN) != hasNeighborSignal) {
|
+ if (state.getValue(TrapDoorBlock.OPEN) != hasNeighborSignal) {
|
||||||
state = state.setValue(OPEN, Boolean.valueOf(hasNeighborSignal));
|
state = state.setValue(OPEN, hasNeighborSignal);
|
||||||
this.playSound(null, level, pos, hasNeighborSignal);
|
this.playSound(null, level, pos, hasNeighborSignal);
|
||||||
}
|
}
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable distance check for UseItemOnPacket
|
|||||||
|
|
||||||
|
|
||||||
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 771abbc4aeea227b99b069d9d6f58a6b8df4ee5d..19d8998ca4e2a61bcc5c33b2a6fff6ee8deb56c4 100644
|
index 72e1265509a00376515e963499099c0765104ea2..878d80d0cb9fddeb7916a34d39c34119d65fbe00 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
|
||||||
@@ -1929,7 +1929,7 @@ public class ServerGamePacketListenerImpl
|
@@ -1991,7 +1991,7 @@ public class ServerGamePacketListenerImpl
|
||||||
if (this.player.canInteractWithBlock(blockPos, 1.0)) {
|
if (this.player.canInteractWithBlock(blockPos, 1.0)) {
|
||||||
Vec3 vec3 = location.subtract(Vec3.atCenterOf(blockPos));
|
Vec3 vec3 = location.subtract(Vec3.atCenterOf(blockPos));
|
||||||
double d = 1.0000001;
|
double d = 1.0000001;
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] No feather falling trample
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/block/FarmBlock.java b/net/minecraft/world/level/block/FarmBlock.java
|
diff --git a/net/minecraft/world/level/block/FarmBlock.java b/net/minecraft/world/level/block/FarmBlock.java
|
||||||
index 47c9b32c89e7e6f84a279c2f6098ada77dc58b6b..9aafef742de9e833cc772da679127cd02cb8c1cb 100644
|
index a31ac95237515b874f59941ec24c74e2c357b3d8..d18a4a7a41bc3a685f9621f9e6f5480bd0d390bc 100644
|
||||||
--- a/net/minecraft/world/level/block/FarmBlock.java
|
--- a/net/minecraft/world/level/block/FarmBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/FarmBlock.java
|
+++ b/net/minecraft/world/level/block/FarmBlock.java
|
||||||
@@ -116,6 +116,13 @@ public class FarmBlock extends Block {
|
@@ -116,6 +116,13 @@ public class FarmBlock extends Block {
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable packet limit
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
|
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
|
||||||
index fd490f139e901c2ac598f1eab7aa8d50c65ef864..284cdbd6034ec8962409abba6da37eab311018cc 100644
|
index 364ddf9f25ef3cb97ba788c469fee9dd495b84a7..7af8b2cf9ccfeadac1cc60541da31ba6f4dc0edb 100644
|
||||||
--- a/net/minecraft/network/Connection.java
|
--- a/net/minecraft/network/Connection.java
|
||||||
+++ b/net/minecraft/network/Connection.java
|
+++ b/net/minecraft/network/Connection.java
|
||||||
@@ -244,8 +244,8 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
@@ -243,8 +243,8 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||||
if (this.stopReadingPackets) {
|
if (this.stopReadingPackets) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -20,10 +20,10 @@ index fd490f139e901c2ac598f1eab7aa8d50c65ef864..284cdbd6034ec8962409abba6da37eab
|
|||||||
synchronized (PACKET_LIMIT_LOCK) {
|
synchronized (PACKET_LIMIT_LOCK) {
|
||||||
if (this.allPacketCounts != null) {
|
if (this.allPacketCounts != null) {
|
||||||
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 a2c35011153daa3b171119b9c0b2e71a7f9a1788..a2be014d33d9ac6189fb7a79af674f2db0fe27cf 100644
|
index 878d80d0cb9fddeb7916a34d39c34119d65fbe00..2ed38800fb3e3a1f4fb04c781321c642e402a854 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
|
||||||
@@ -791,7 +791,7 @@ public class ServerGamePacketListenerImpl
|
@@ -780,7 +780,7 @@ public class ServerGamePacketListenerImpl
|
||||||
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
|
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
|
||||||
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async
|
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -32,7 +32,7 @@ index a2c35011153daa3b171119b9c0b2e71a7f9a1788..a2be014d33d9ac6189fb7a79af674f2d
|
|||||||
this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause // Paper - add proper async disconnect
|
this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause // Paper - add proper async disconnect
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1897,6 +1897,7 @@ public class ServerGamePacketListenerImpl
|
@@ -1955,6 +1955,7 @@ public class ServerGamePacketListenerImpl
|
||||||
private static int getSpamThreshold() { return io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.incomingPacketThreshold; } // Paper - Configurable threshold
|
private static int getSpamThreshold() { return io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.incomingPacketThreshold; } // Paper - Configurable threshold
|
||||||
|
|
||||||
private boolean checkLimit(long timestamp) {
|
private boolean checkLimit(long timestamp) {
|
||||||
@@ -40,7 +40,7 @@ index a2c35011153daa3b171119b9c0b2e71a7f9a1788..a2be014d33d9ac6189fb7a79af674f2d
|
|||||||
if (this.lastLimitedPacket != -1 && timestamp - this.lastLimitedPacket < getSpamThreshold() && this.limitedPackets++ >= 8) { // Paper - Configurable threshold; raise packet limit to 8
|
if (this.lastLimitedPacket != -1 && timestamp - this.lastLimitedPacket < getSpamThreshold() && this.limitedPackets++ >= 8) { // Paper - Configurable threshold; raise packet limit to 8
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2511,6 +2512,7 @@ public class ServerGamePacketListenerImpl
|
@@ -2492,6 +2493,7 @@ public class ServerGamePacketListenerImpl
|
||||||
|
|
||||||
// Spigot start - spam exclusions
|
// Spigot start - spam exclusions
|
||||||
private void detectRateSpam(String message) {
|
private void detectRateSpam(String message) {
|
||||||
@@ -48,7 +48,7 @@ index a2c35011153daa3b171119b9c0b2e71a7f9a1788..a2be014d33d9ac6189fb7a79af674f2d
|
|||||||
// CraftBukkit start - replaced with thread safe throttle
|
// CraftBukkit start - replaced with thread safe throttle
|
||||||
if (org.spigotmc.SpigotConfig.enableSpamExclusions) {
|
if (org.spigotmc.SpigotConfig.enableSpamExclusions) {
|
||||||
for (String exclude : org.spigotmc.SpigotConfig.spamExclusions) {
|
for (String exclude : org.spigotmc.SpigotConfig.spamExclusions) {
|
||||||
@@ -3298,7 +3300,7 @@ public class ServerGamePacketListenerImpl
|
@@ -3280,7 +3282,7 @@ public class ServerGamePacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
|
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
|
||||||
// Paper start - auto recipe limit
|
// Paper start - auto recipe limit
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
||||||
Date: Wed, 14 Jun 2023 12:07:07 +0800
|
|
||||||
Subject: [PATCH] Redstone wire dont connect if on trapdoor
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/block/RedStoneWireBlock.java b/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
||||||
index 12c9d60314c99fb65e640d255a2d0c6b7790ad4d..ff29671f78a4e896e70daf89f440f3b9425b0760 100644
|
|
||||||
--- a/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
||||||
+++ b/net/minecraft/world/level/block/RedStoneWireBlock.java
|
|
||||||
@@ -204,7 +204,7 @@ public class RedStoneWireBlock extends Block {
|
|
||||||
RandomSource random
|
|
||||||
) {
|
|
||||||
if (direction == Direction.DOWN) {
|
|
||||||
- return !this.canSurviveOn(level, neighborPos, neighborState) ? Blocks.AIR.defaultBlockState() : state;
|
|
||||||
+ return org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.redstoneDontCantOnTrapDoor ? state : !this.canSurviveOn(level, neighborPos, neighborState) ? Blocks.AIR.defaultBlockState() : state; // Leaves - behavior to 1.19
|
|
||||||
} else if (direction == Direction.UP) {
|
|
||||||
return this.getConnectionState(level, state, pos);
|
|
||||||
} else {
|
|
||||||
@@ -263,7 +263,7 @@ public class RedStoneWireBlock extends Block {
|
|
||||||
BlockPos blockPos = pos.relative(direction);
|
|
||||||
BlockState blockState = level.getBlockState(blockPos);
|
|
||||||
if (nonNormalCubeAbove) {
|
|
||||||
- boolean flag = blockState.getBlock() instanceof TrapDoorBlock || this.canSurviveOn(level, blockPos, blockState);
|
|
||||||
+ boolean flag = (!org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.redstoneDontCantOnTrapDoor && blockState.getBlock() instanceof TrapDoorBlock) || this.canSurviveOn(level, blockPos, blockState); // Leaves - behavior to 1.19
|
|
||||||
if (flag && shouldConnectTo(level.getBlockState(blockPos.above()))) {
|
|
||||||
if (blockState.isFaceSturdy(level, blockPos, direction.getOpposite())) {
|
|
||||||
return RedstoneSide.UP;
|
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Syncmatica Protocol
|
|||||||
This patch is Powered by Syncmatica(https://github.com/End-Tech/syncmatica)
|
This patch is Powered by Syncmatica(https://github.com/End-Tech/syncmatica)
|
||||||
|
|
||||||
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 19d8998ca4e2a61bcc5c33b2a6fff6ee8deb56c4..325300e7ad68b7ad377ff1269bc5d568d663ec3a 100644
|
index 2f4776fa065cb712afe9d8abc835c57777c963b7..f1372015cf5991ef80a07e7fcbd1fb9d65e9d74f 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
|
||||||
@@ -326,8 +326,11 @@ public class ServerGamePacketListenerImpl
|
@@ -319,8 +319,11 @@ public class ServerGamePacketListenerImpl
|
||||||
this.signedMessageDecoder = SignedMessageChain.Decoder.unsigned(player.getUUID(), server::enforceSecureProfile);
|
this.signedMessageDecoder = SignedMessageChain.Decoder.unsigned(player.getUUID(), server::enforceSecureProfile);
|
||||||
this.chatMessageChain = new FutureChain(server.chatExecutor); // CraftBukkit - async chat
|
this.chatMessageChain = new FutureChain(server.chatExecutor); // CraftBukkit - async chat
|
||||||
this.tickEndEvent = new io.papermc.paper.event.packet.ClientTickEndEvent(player.getBukkitEntity()); // Paper - add client tick end event
|
this.tickEndEvent = new io.papermc.paper.event.packet.ClientTickEndEvent(player.getBukkitEntity()); // Paper - add client tick end event
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Shared villager discounts
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/ai/gossip/GossipContainer.java b/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
diff --git a/net/minecraft/world/entity/ai/gossip/GossipContainer.java b/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
||||||
index b74a4ce1b629d440681a1f5c026997ccaf1d0373..4eb97c8265ed8346b208d06a37f8068004593944 100644
|
index 425ca1931fb0a5c33ba7aaf4f639409c9fea836f..c17ba3f76069f23b38de2aabf29b784049059144 100644
|
||||||
--- a/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
--- a/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
||||||
+++ b/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
+++ b/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
||||||
@@ -115,6 +115,16 @@ public class GossipContainer {
|
@@ -121,6 +121,16 @@ public class GossipContainer {
|
||||||
|
|
||||||
public int getReputation(UUID identifier, Predicate<GossipType> gossip) {
|
public int getReputation(UUID identifier, Predicate<GossipType> gossip) {
|
||||||
GossipContainer.EntityGossips entityGossips = this.gossips.get(identifier);
|
GossipContainer.EntityGossips entityGossips = this.gossips.get(identifier);
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||||
|
Date: Wed, 14 Jun 2023 12:07:07 +0800
|
||||||
|
Subject: [PATCH] Redstone ignore upwards update
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/level/block/ComparatorBlock.java b/net/minecraft/world/level/block/ComparatorBlock.java
|
||||||
|
index afecf6bb6152b4d9dfee4cd8c5b1d798cbf723b3..0e51c10987a7b1964d1be3b2942c28aa6b0eb8d9 100644
|
||||||
|
--- a/net/minecraft/world/level/block/ComparatorBlock.java
|
||||||
|
+++ b/net/minecraft/world/level/block/ComparatorBlock.java
|
||||||
|
@@ -58,6 +58,7 @@ public class ComparatorBlock extends DiodeBlock implements EntityBlock {
|
||||||
|
BlockState neighborState,
|
||||||
|
RandomSource random
|
||||||
|
) {
|
||||||
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.redstoneIgnoreUpwardsUpdate && direction == Direction.DOWN) return state; // Leaves - behavior to 1.20.1
|
||||||
|
return direction == Direction.DOWN && !this.canSurviveOn(level, neighborPos, neighborState)
|
||||||
|
? Blocks.AIR.defaultBlockState()
|
||||||
|
: super.updateShape(state, level, scheduledTickAccess, pos, direction, neighborPos, neighborState, random);
|
||||||
|
diff --git a/net/minecraft/world/level/block/RedStoneWireBlock.java b/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
|
index 1943a6aad888647953e2d9dbbeedb0bd81c6f9df..35dc47d5ba1a2659304ccc08010611438ccf04d8 100644
|
||||||
|
--- a/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
|
+++ b/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||||
|
@@ -179,7 +179,7 @@ public class RedStoneWireBlock extends Block {
|
||||||
|
RandomSource random
|
||||||
|
) {
|
||||||
|
if (direction == Direction.DOWN) {
|
||||||
|
- return !this.canSurviveOn(level, neighborPos, neighborState) ? Blocks.AIR.defaultBlockState() : state;
|
||||||
|
+ return org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.redstoneIgnoreUpwardsUpdate ? state : !this.canSurviveOn(level, neighborPos, neighborState) ? Blocks.AIR.defaultBlockState() : state; // Leaves - behavior to 1.19
|
||||||
|
} else if (direction == Direction.UP) {
|
||||||
|
return this.getConnectionState(level, state, pos);
|
||||||
|
} else {
|
||||||
|
@@ -238,7 +238,7 @@ public class RedStoneWireBlock extends Block {
|
||||||
|
BlockPos blockPos = pos.relative(direction);
|
||||||
|
BlockState blockState = level.getBlockState(blockPos);
|
||||||
|
if (nonNormalCubeAbove) {
|
||||||
|
- boolean flag = blockState.getBlock() instanceof TrapDoorBlock || this.canSurviveOn(level, blockPos, blockState);
|
||||||
|
+ boolean flag = (!org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.redstoneIgnoreUpwardsUpdate && blockState.getBlock() instanceof TrapDoorBlock) || this.canSurviveOn(level, blockPos, blockState); // Leaves - behavior to 1.19
|
||||||
|
if (flag && shouldConnectTo(level.getBlockState(blockPos.above()))) {
|
||||||
|
if (blockState.isFaceSturdy(level, blockPos, direction.getOpposite())) {
|
||||||
|
return RedstoneSide.UP;
|
||||||
|
diff --git a/net/minecraft/world/level/block/RepeaterBlock.java b/net/minecraft/world/level/block/RepeaterBlock.java
|
||||||
|
index 1d45564253258eebdf10470dd7eefa644a4151ae..13c1974dd368579f5c3d11b87e1c3eff02d69ac7 100644
|
||||||
|
--- a/net/minecraft/world/level/block/RepeaterBlock.java
|
||||||
|
+++ b/net/minecraft/world/level/block/RepeaterBlock.java
|
||||||
|
@@ -68,6 +68,7 @@ public class RepeaterBlock extends DiodeBlock {
|
||||||
|
BlockState neighborState,
|
||||||
|
RandomSource random
|
||||||
|
) {
|
||||||
|
+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.redstoneIgnoreUpwardsUpdate && direction == Direction.DOWN) return state; // Leaves - behavior to 1.20.1
|
||||||
|
if (direction == Direction.DOWN && !this.canSurviveOn(level, neighborPos, neighborState)) {
|
||||||
|
return Blocks.AIR.defaultBlockState();
|
||||||
|
} else {
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Despawn enderman with block
|
|||||||
|
|
||||||
|
|
||||||
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 e2f1623b977889d31407d060b8e0bf911a80049e..a2437f181602cc334dc8b590c1b63565b2e67054 100644
|
index 41c8fc535e7f0bd61e23f48ac250f362807fa062..775466831746b914947cd018d8def4b8bf1d6f15 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
|
||||||
@@ -457,7 +457,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
@@ -452,7 +452,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requiresCustomPersistence() {
|
public boolean requiresCustomPersistence() {
|
||||||
@@ -18,10 +18,10 @@ index f7bb979f08634a7e1b77c59040f59fb5e11aafa5..3cad7d6bca9af77bace18bfd7cc013ac
|
|||||||
for (int i1 = 0; i1 < this.height; i1++) {
|
for (int i1 = 0; i1 < this.height; i1++) {
|
||||||
for (int i2 = 0; i2 < this.depth; i2++) {
|
for (int i2 = 0; i2 < this.depth; i2++) {
|
||||||
diff --git a/net/minecraft/world/level/dimension/end/EndDragonFight.java b/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
diff --git a/net/minecraft/world/level/dimension/end/EndDragonFight.java b/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||||
index 6e7e87c32734b3aae354bc34459e5f207da5c78f..5a28a821bb401f8f1465b085c9ffda52ba9a0a9f 100644
|
index 8ccd40c70e150bd5a8d89818c229258642f2349e..18a567b676f0bfcd725f19c5ed9e3fdbc8e65573 100644
|
||||||
--- a/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
--- a/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||||
+++ b/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
+++ b/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||||
@@ -274,8 +274,68 @@ public class EndDragonFight {
|
@@ -273,8 +273,68 @@ public class EndDragonFight {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ index 6e7e87c32734b3aae354bc34459e5f207da5c78f..5a28a821bb401f8f1465b085c9ffda52
|
|||||||
ChunkPos chunkPos = new ChunkPos(this.origin);
|
ChunkPos chunkPos = new ChunkPos(this.origin);
|
||||||
|
|
||||||
for (int i = -8 + chunkPos.x; i <= 8 + chunkPos.x; i++) {
|
for (int i = -8 + chunkPos.x; i <= 8 + chunkPos.x; i++) {
|
||||||
@@ -571,6 +631,11 @@ public class EndDragonFight {
|
@@ -572,6 +632,11 @@ public class EndDragonFight {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean respawnDragon(List<EndCrystal> crystals) { // CraftBukkit - return boolean
|
public boolean respawnDragon(List<EndCrystal> crystals) { // CraftBukkit - return boolean
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Creative fly no clip
|
|||||||
|
|
||||||
|
|
||||||
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 6fa522d6935c277f2fc35bb772aa7b18b4adf6e3..39fc3ea891947ddd102f992e7b6c62f9367849e7 100644
|
index 2fe76bc1c26423ed5e39453ac1b27a2cc66b1f2e..3eb9a9f6d7f8d28d527941177a5faf2c97628594 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
|
||||||
@@ -262,8 +262,8 @@ public abstract class Player extends LivingEntity {
|
@@ -277,8 +277,8 @@ public abstract class Player extends LivingEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
@@ -19,16 +19,16 @@ index 6fa522d6935c277f2fc35bb772aa7b18b4adf6e3..39fc3ea891947ddd102f992e7b6c62f9
|
|||||||
this.setOnGround(false);
|
this.setOnGround(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,7 +470,7 @@ public abstract class Player extends LivingEntity {
|
@@ -471,7 +471,7 @@ public abstract class Player extends LivingEntity {
|
||||||
}
|
if (this.canPlayerFitWithinBlocksAndEntitiesWhen(Pose.SWIMMING)) {
|
||||||
|
Pose desiredPose = this.getDesiredPose();
|
||||||
Pose pose1;
|
Pose pose;
|
||||||
- if (this.isSpectator() || this.isPassenger() || this.canPlayerFitWithinBlocksAndEntitiesWhen(pose)) {
|
- if (this.isSpectator() || this.isPassenger() || this.canPlayerFitWithinBlocksAndEntitiesWhen(desiredPose)) {
|
||||||
+ if (this.isCreativeFlyOrSpectator() || this.isPassenger() || this.canPlayerFitWithinBlocksAndEntitiesWhen(pose)) { // Leaves - creative no clip
|
+ if (this.isCreativeFlyOrSpectator() || this.isPassenger() || this.canPlayerFitWithinBlocksAndEntitiesWhen(desiredPose)) { // Leaves - creative no clip
|
||||||
pose1 = pose;
|
pose = desiredPose;
|
||||||
} else if (this.canPlayerFitWithinBlocksAndEntitiesWhen(Pose.CROUCHING)) {
|
} else if (this.canPlayerFitWithinBlocksAndEntitiesWhen(Pose.CROUCHING)) {
|
||||||
pose1 = Pose.CROUCHING;
|
pose = Pose.CROUCHING;
|
||||||
@@ -604,7 +604,7 @@ public abstract class Player extends LivingEntity {
|
@@ -614,7 +614,7 @@ public abstract class Player extends LivingEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bob = this.bob + (f - this.bob) * 0.4F;
|
this.bob = this.bob + (f - this.bob) * 0.4F;
|
||||||
@@ -37,9 +37,9 @@ index 6fa522d6935c277f2fc35bb772aa7b18b4adf6e3..39fc3ea891947ddd102f992e7b6c62f9
|
|||||||
AABB aabb;
|
AABB aabb;
|
||||||
if (this.isPassenger() && !this.getVehicle().isRemoved()) {
|
if (this.isPassenger() && !this.getVehicle().isRemoved()) {
|
||||||
aabb = this.getBoundingBox().minmax(this.getVehicle().getBoundingBox()).inflate(1.0, 0.0, 1.0);
|
aabb = this.getBoundingBox().minmax(this.getVehicle().getBoundingBox()).inflate(1.0, 0.0, 1.0);
|
||||||
@@ -2044,6 +2044,21 @@ public abstract class Player extends LivingEntity {
|
@@ -1931,6 +1931,21 @@ public abstract class Player extends LivingEntity {
|
||||||
@Override
|
return this.gameMode() == GameType.SPECTATOR;
|
||||||
public abstract boolean isSpectator();
|
}
|
||||||
|
|
||||||
+ // Leaves start - creative no clip
|
+ // Leaves start - creative no clip
|
||||||
+ public boolean isCreativeFlyOrSpectator() {
|
+ public boolean isCreativeFlyOrSpectator() {
|
||||||
@@ -60,18 +60,20 @@ index 6fa522d6935c277f2fc35bb772aa7b18b4adf6e3..39fc3ea891947ddd102f992e7b6c62f9
|
|||||||
public boolean canBeHitByProjectile() {
|
public boolean canBeHitByProjectile() {
|
||||||
return !this.isSpectator() && super.canBeHitByProjectile();
|
return !this.isSpectator() && super.canBeHitByProjectile();
|
||||||
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
|
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
|
||||||
index 1f4a3d2610abfa2ea2b1d5feba9606b806d6d416..c74e09eed6b8fe2852b3cb592e1a1e628ba9f22a 100644
|
index 0c67e5481a43bf7c02bb54a8ea1abca77d53a292..5cbd5d04de525c33715bc45826bd2ed446355505 100644
|
||||||
--- a/net/minecraft/world/item/BlockItem.java
|
--- a/net/minecraft/world/item/BlockItem.java
|
||||||
+++ b/net/minecraft/world/item/BlockItem.java
|
+++ b/net/minecraft/world/item/BlockItem.java
|
||||||
@@ -216,7 +216,7 @@ public class BlockItem extends Item {
|
@@ -207,8 +207,9 @@ public class BlockItem extends Item {
|
||||||
CollisionContext collisionContext = player == null ? CollisionContext.empty() : CollisionContext.of(player);
|
protected boolean canPlace(BlockPlaceContext context, BlockState state) {
|
||||||
|
Player player = context.getPlayer();
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
+ CollisionContext collisionContext = player == null ? CollisionContext.empty() : CollisionContext.placementContext(player);
|
||||||
Level world = context.getLevel(); // Paper - Cancel hit for vanished players
|
Level world = context.getLevel(); // Paper - Cancel hit for vanished players
|
||||||
- boolean canBuild = (!this.mustSurvive() || state.canSurvive(world, context.getClickedPos())) && world.checkEntityCollision(state, player, collisionContext, context.getClickedPos(), true); // Paper - Cancel hit for vanished players
|
- boolean canBuild = (!this.mustSurvive() || state.canSurvive(world, context.getClickedPos())) && world.checkEntityCollision(state, player, CollisionContext.placementContext(player), context.getClickedPos(), true); // Paper - Cancel hit for vanished players
|
||||||
+ boolean canBuild = (!this.mustSurvive() || state.canSurvive(world, context.getClickedPos())) && ((org.leavesmc.leaves.LeavesConfig.modify.creativeNoClip && context.getPlayer() != null) ? context.getPlayer().canSpectatingPlace(world, state, context.getClickedPos(), collisionContext) : world.checkEntityCollision(state, player, collisionContext, context.getClickedPos(), true)); // Paper - Cancel hit for vanished players // Leaves - creative no clip
|
+ boolean canBuild = (!this.mustSurvive() || state.canSurvive(world, context.getClickedPos())) && ((org.leavesmc.leaves.LeavesConfig.modify.creativeNoClip && context.getPlayer() != null) ? context.getPlayer().canSpectatingPlace(world, state, context.getClickedPos(), collisionContext) : world.checkEntityCollision(state, player, collisionContext, context.getClickedPos(), true)); // Paper - Cancel hit for vanished players // Leaves - creative no clip
|
||||||
org.bukkit.entity.Player bukkitPlayer = (context.getPlayer() instanceof ServerPlayer) ? (org.bukkit.entity.Player) context.getPlayer().getBukkitEntity() : null;
|
org.bukkit.entity.Player bukkitPlayer = (context.getPlayer() instanceof ServerPlayer) ? (org.bukkit.entity.Player) context.getPlayer().getBukkitEntity() : null;
|
||||||
|
|
||||||
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(world, context.getClickedPos()), bukkitPlayer, CraftBlockData.fromData(state), canBuild, org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(context.getHand())); // Paper - Expose hand in BlockCanBuildEvent
|
org.bukkit.event.block.BlockCanBuildEvent event = new org.bukkit.event.block.BlockCanBuildEvent(
|
||||||
diff --git a/net/minecraft/world/item/StandingAndWallBlockItem.java b/net/minecraft/world/item/StandingAndWallBlockItem.java
|
diff --git a/net/minecraft/world/item/StandingAndWallBlockItem.java b/net/minecraft/world/item/StandingAndWallBlockItem.java
|
||||||
index 1f0e7c391d02b18e2c89700025713ec3d759f2ea..300ee12ca9584e53e9d72e3ebfd039beb3fab3b2 100644
|
index 1f0e7c391d02b18e2c89700025713ec3d759f2ea..300ee12ca9584e53e9d72e3ebfd039beb3fab3b2 100644
|
||||||
--- a/net/minecraft/world/item/StandingAndWallBlockItem.java
|
--- a/net/minecraft/world/item/StandingAndWallBlockItem.java
|
||||||
@@ -86,10 +88,10 @@ index 1f0e7c391d02b18e2c89700025713ec3d759f2ea..300ee12ca9584e53e9d72e3ebfd039be
|
|||||||
|
|
||||||
org.bukkit.event.block.BlockCanBuildEvent event = new org.bukkit.event.block.BlockCanBuildEvent(org.bukkit.craftbukkit.block.CraftBlock.at(context.getLevel(), clickedPos), player, org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(blockState), defaultReturn, org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(context.getHand())); // Paper - Expose hand in BlockCanBuildEvent
|
org.bukkit.event.block.BlockCanBuildEvent event = new org.bukkit.event.block.BlockCanBuildEvent(org.bukkit.craftbukkit.block.CraftBlock.at(context.getLevel(), clickedPos), player, org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(blockState), defaultReturn, org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(context.getHand())); // Paper - Expose hand in BlockCanBuildEvent
|
||||||
diff --git a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
index cc8781c0a357eebc2bff936b4e7be53cc316716d..f5264831b2dc1843b09599086f2bb586d041535d 100644
|
index 5e58113b3401268e0432235dc10b2734dbbd8b71..1f7c2d06952febd7a5d4e216b6e22794239b9325 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||||
@@ -147,7 +147,7 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
@@ -152,7 +152,7 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||||
List<Entity> entities = level.getEntities(null, progressDeltaAabb);
|
List<Entity> entities = level.getEntities(null, progressDeltaAabb);
|
||||||
if (!entities.isEmpty()) {
|
if (!entities.isEmpty()) {
|
||||||
for (Entity entity : entities) {
|
for (Entity entity : entities) {
|
||||||
@@ -99,10 +101,10 @@ index cc8781c0a357eebc2bff936b4e7be53cc316716d..f5264831b2dc1843b09599086f2bb586
|
|||||||
MoverType.SHULKER_BOX,
|
MoverType.SHULKER_BOX,
|
||||||
new Vec3(
|
new Vec3(
|
||||||
diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
index ee2f8e8deb35059824b5730a1442f383dc79f01c..841167f3f168ff3129b17e176df476ed7b9aaaf5 100644
|
index 8449545bd5278f5558567dd6b7c1522f63045f22..3d2770828d4fe1123b158e70bfe459d7cf16332a 100644
|
||||||
--- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
--- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
+++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
@@ -148,7 +148,7 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
@@ -152,7 +152,7 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
||||||
d3 = movementDirection.getStepZ();
|
d3 = movementDirection.getStepZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,11 +113,11 @@ index ee2f8e8deb35059824b5730a1442f383dc79f01c..841167f3f168ff3129b17e176df476ed
|
|||||||
// Paper - EAR items stuck in slime pushed by a piston
|
// Paper - EAR items stuck in slime pushed by a piston
|
||||||
entity.activatedTick = Math.max(entity.activatedTick, net.minecraft.server.MinecraftServer.currentTick + 10);
|
entity.activatedTick = Math.max(entity.activatedTick, net.minecraft.server.MinecraftServer.currentTick + 10);
|
||||||
entity.activatedImmunityTick = Math.max(entity.activatedImmunityTick, net.minecraft.server.MinecraftServer.currentTick + 10);
|
entity.activatedImmunityTick = Math.max(entity.activatedImmunityTick, net.minecraft.server.MinecraftServer.currentTick + 10);
|
||||||
@@ -184,6 +184,7 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
@@ -188,6 +188,7 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void moveEntityByPiston(Direction noClipDirection, Entity entity, double progress, Direction direction) {
|
private static void moveEntityByPiston(Direction noClipDirection, Entity entity, double progress, Direction direction) {
|
||||||
+ if (entity instanceof net.minecraft.world.entity.player.Player player && player.isCreativeFlyOrSpectator()) return; // Leaves - creative no clip
|
+ if (entity instanceof net.minecraft.world.entity.player.Player player && player.isCreativeFlyOrSpectator()) return; // Leaves - creative no clip
|
||||||
NOCLIP.set(noClipDirection);
|
NOCLIP.set(noClipDirection);
|
||||||
|
Vec3 vec3 = entity.position();
|
||||||
entity.move(MoverType.PISTON, new Vec3(progress * direction.getStepX(), progress * direction.getStepY(), progress * direction.getStepZ()));
|
entity.move(MoverType.PISTON, new Vec3(progress * direction.getStepX(), progress * direction.getStepY(), progress * direction.getStepZ()));
|
||||||
entity.applyEffectsFromBlocks();
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
||||||
Date: Sun, 2 Jul 2023 09:25:00 +0800
|
|
||||||
Subject: [PATCH] Elytra aeronautics no chunk load
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
|
|
||||||
index 36c0a690e7e9b301c5a3d63fae2c7cbe36ba6cdf..6b625fbd538e5a4073e86e22adfcd382e1efde86 100644
|
|
||||||
--- a/net/minecraft/server/level/ChunkMap.java
|
|
||||||
+++ b/net/minecraft/server/level/ChunkMap.java
|
|
||||||
@@ -792,7 +792,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean skipPlayer(ServerPlayer player) {
|
|
||||||
- return player.isSpectator() && !this.level.getGameRules().getBoolean(GameRules.RULE_SPECTATORSGENERATECHUNKS);
|
|
||||||
+ return (player.isSpectator() && !this.level.getGameRules().getBoolean(GameRules.RULE_SPECTATORSGENERATECHUNKS))
|
|
||||||
+ || (org.leavesmc.leaves.LeavesConfig.modify.elytraAeronautics.noChunk && player.elytraAeronauticsNoChunk); // Leaves - Elytra aeronautics
|
|
||||||
}
|
|
||||||
|
|
||||||
void updatePlayerStatus(ServerPlayer player, boolean track) {
|
|
||||||
@@ -826,6 +827,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
||||||
}
|
|
||||||
|
|
||||||
public void move(ServerPlayer player) {
|
|
||||||
+ if (player.elytraAeronauticsNoChunk) return; // Leaves - no chunk
|
|
||||||
// Paper - optimise entity tracker
|
|
||||||
|
|
||||||
SectionPos lastSectionPos = player.getLastSectionPos();
|
|
||||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
index 325300e7ad68b7ad377ff1269bc5d568d663ec3a..b3abfd93b7b4ce47e3382a9f81b82dbb2beb37ae 100644
|
|
||||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
@@ -549,7 +549,7 @@ public class ServerGamePacketListenerImpl
|
|
||||||
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
|
|
||||||
|
|
||||||
// Paper start - Prevent moving into unloaded chunks
|
|
||||||
- if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (
|
|
||||||
+ if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && !player.elytraAeronauticsNoChunk && ( // Leaves - no chunk load
|
|
||||||
!serverLevel.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position()))) ||
|
|
||||||
!serverLevel.areChunksLoadedForMove(rootVehicle.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(rootVehicle.position())))
|
|
||||||
)) {
|
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
|
||||||
index 25b7fe802216d805b6426a5b0098d8e41fe48a7d..7dc1aaaf590edcd1e7c6c6734c4baeecbfec93a7 100644
|
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
|
||||||
@@ -1109,7 +1109,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+ // Leaves start - elytra aeronautics
|
|
||||||
+ if (org.leavesmc.leaves.LeavesConfig.modify.elytraAeronautics.noChunk && this instanceof Player player) {
|
|
||||||
+ if (type == MoverType.PLAYER && player.isFallFlying()) {
|
|
||||||
+ org.leavesmc.leaves.util.ElytraAeronauticsHelper.flightBehaviour(player, movement);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ // Leaves end - elytra aeronautics
|
|
||||||
ProfilerFiller profilerFiller = Profiler.get();
|
|
||||||
profilerFiller.push("move");
|
|
||||||
if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7) {
|
|
||||||
@@ -2059,6 +2065,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
||||||
this.yo = y;
|
|
||||||
this.zo = d1;
|
|
||||||
this.setPos(d, y, d1);
|
|
||||||
+ if (this instanceof Player player && player.elytraAeronauticsNoChunk) return; // Leaves - elytra aeronautics
|
|
||||||
if (this.valid) this.level.getChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4); // CraftBukkit
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
|
||||||
index 39fc3ea891947ddd102f992e7b6c62f9367849e7..9a2ab505fda1c59df99ef384af5fb8bc5d1bf68c 100644
|
|
||||||
--- a/net/minecraft/world/entity/player/Player.java
|
|
||||||
+++ b/net/minecraft/world/entity/player/Player.java
|
|
||||||
@@ -200,6 +200,7 @@ public abstract class Player extends LivingEntity {
|
|
||||||
private int currentImpulseContextResetGraceTime;
|
|
||||||
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 boolean elytraAeronauticsNoChunk = false; // Leaves - Elytra aeronautics
|
|
||||||
|
|
||||||
// CraftBukkit start
|
|
||||||
public boolean fauxSleeping;
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user