mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-22 16:29:26 +00:00
1.21 work
This commit is contained in:
@@ -61,3 +61,7 @@ Additional thanks and friendly greetings go out to the following forks and other
|
||||
Paperweight files are licensed under MIT.
|
||||
Patches are licensed under GPL-3.0, unless indicated differently in their header.
|
||||
Binaries are licensed under GPL-3.0.
|
||||
|
||||
## TODO
|
||||
check Simpler ShapelessRecipe comparison for vanilla patch
|
||||
check fix MC-26304 (needs tryParse? or just parse)
|
||||
@@ -57,7 +57,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.10.2:fat")
|
||||
remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
|
||||
decompiler("org.vineflower:vineflower:1.10.1")
|
||||
paperclip("io.papermc:paperclip:3.0.3")
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
group=org.galemc.gale
|
||||
version=1.20.6-R0.1-SNAPSHOT
|
||||
version=1.21-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion=1.20.6
|
||||
paperRef=9e7f6c3f7e6c0017ac440023518e48cca7550163
|
||||
mcVersion=1.21
|
||||
paperRef=56b5b7d452e8173ee005c941010632aeb6dbecaf
|
||||
|
||||
org.gradle.caching=true
|
||||
updatingMinecraft=true
|
||||
|
||||
org.gradle.caching=false
|
||||
org.gradle.parallel=true
|
||||
org.gradle.vfs.watch=false
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
2
gradlew
vendored
2
gradlew
vendored
@@ -55,7 +55,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
@@ -13,10 +13,10 @@ As part of: Paper (https://github.com/PaperMC/Paper)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 30cbe3bdc7142769019765b03cc4fe1f9ba1ddb4..d13d4c0971b79d2447f42d395a1ba4d1bf00c38a 100644
|
||||
index bbc4d7d3ca84642828f9a3f788ca26bba900d15b..17aaca2d039eb9c0816a9bdde0876a4debcaeb9d 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2255,6 +2255,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2249,6 +2249,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 6c327a07bf8a6aa11a2d7dad12b2830acc539484..2d63d61fcfe87c4f07b1d752facbb1bae6f2b0ca 100644
|
||||
index 7c56182acaf827f4b1a986a61cea8e9960604c98..328c34dee07311193d41f36c0976ed09135ab448 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2108,6 +2108,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2113,6 +2113,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
boolean listPlayer(@NotNull Player other);
|
||||
// Paper end
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 71f1c361ebccbe83193c37ec3a90faa4085001c3..0c44d54bc9a63fa351f84dec3b7f62b69c086f0d 100644
|
||||
index b9b751ea0d11381e846d5f35f39f285c075c171a..3157818826a08fc64e6aafa269cb53a0797f3a4d 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2377,6 +2377,37 @@ public final class Bukkit {
|
||||
@@ -2371,6 +2371,37 @@ public final class Bukkit {
|
||||
return server.getTPS();
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ index 71f1c361ebccbe83193c37ec3a90faa4085001c3..0c44d54bc9a63fa351f84dec3b7f62b6
|
||||
* Get a sample of the servers last tick times (in nanos)
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index b50f6fb3b45678374348778388d18f15b2d8d3e7..3d93593c2e2114a0415529bbc0e8c2733ca79e1d 100644
|
||||
index 17aaca2d039eb9c0816a9bdde0876a4debcaeb9d..d8e78424809ee1e1107e37a32552d57c24fa48b0 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2034,6 +2034,31 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2028,6 +2028,31 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@NotNull
|
||||
public double[] getTPS();
|
||||
|
||||
|
||||
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 0c44d54bc9a63fa351f84dec3b7f62b69c086f0d..d627e3f8ffd37eb79affdce0c06f3d8624e90833 100644
|
||||
index 3157818826a08fc64e6aafa269cb53a0797f3a4d..4e2e5b2727ccfdd2f029ad786e0165f37f7e2144 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2377,8 +2377,30 @@ public final class Bukkit {
|
||||
@@ -2371,8 +2371,30 @@ public final class Bukkit {
|
||||
return server.getTPS();
|
||||
}
|
||||
|
||||
@@ -72,10 +72,10 @@ index 0c44d54bc9a63fa351f84dec3b7f62b69c086f0d..d627e3f8ffd37eb79affdce0c06f3d86
|
||||
* Gets the average server TPS over the last 1 minute
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 3d93593c2e2114a0415529bbc0e8c2733ca79e1d..7b31498b03f1ea44d7533cfc8c8afdac9d2898b6 100644
|
||||
index d8e78424809ee1e1107e37a32552d57c24fa48b0..9c032132d242c61facb89efe89b548ff051a2977 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2034,8 +2034,27 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2028,8 +2028,27 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@NotNull
|
||||
public double[] getTPS();
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 2cb2b7bb87f91d0500872215bfdb2fefba549d6f..dec4ad04ac3dc2e869ea78f354cdf37d7a305a55 100644
|
||||
index 4e2e5b2727ccfdd2f029ad786e0165f37f7e2144..1ea2a7f598c6a214a6562ce6ad2e49e83c7149ab 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2962,6 +2962,20 @@ public final class Bukkit {
|
||||
@@ -2956,6 +2956,20 @@ public final class Bukkit {
|
||||
}
|
||||
// Paper end - Folia region threading API
|
||||
|
||||
@@ -48,10 +48,10 @@ index 2cb2b7bb87f91d0500872215bfdb2fefba549d6f..dec4ad04ac3dc2e869ea78f354cdf37d
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index fb754abc50e79030497a178c443421da1cb88e7f..6d77d7989e757f18ba5d72b07e3b82016a5e28a2 100644
|
||||
index 9c032132d242c61facb89efe89b548ff051a2977..2732389405c054d34cf030ce46323ceaf899b61b 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2599,4 +2599,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2593,4 +2593,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
|
||||
// Paper end - Folia region threading API
|
||||
|
||||
@@ -34,7 +34,7 @@ index b0d26b0eadb2a43924629424a6c13198aace8f69..bcba8224b9a210bced04ff370a73b306
|
||||
|
||||
for (T executionCommandSource2 : list) {
|
||||
diff --git a/src/main/java/net/minecraft/util/ExtraCodecs.java b/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||
index 4f206e32477d84f4ba16e49d5abd3c28da5cab8f..3c8f05a13d4fb10ac1e0ed444f1bfe665a077033 100644
|
||||
index 68dda6a3257ca18c1e6c7659d62455da46d187e2..24a478c0e874692964fb1c670277aca94f273749 100644
|
||||
--- a/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||
+++ b/src/main/java/net/minecraft/util/ExtraCodecs.java
|
||||
@@ -224,7 +224,7 @@ public class ExtraCodecs {
|
||||
@@ -56,7 +56,7 @@ index 4f206e32477d84f4ba16e49d5abd3c28da5cab8f..3c8f05a13d4fb10ac1e0ed444f1bfe66
|
||||
|
||||
public <T> DataResult<T> coApply(DynamicOps<T> dynamicOps, A object, DataResult<T> dataResult) {
|
||||
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/ChunkProtoTickListFix.java b/src/main/java/net/minecraft/util/datafix/fixes/ChunkProtoTickListFix.java
|
||||
index c9101a3bf0cb2c9e49e0e768b379e8dd816012de..ec7f8ef7bcd0a6cf72d032714c3e1057704260e9 100644
|
||||
index 2942534d265416a3693848d76538c04735bc14fa..1665e457bbfea822f5822c31f6c93f3a0d6fa7a3 100644
|
||||
--- a/src/main/java/net/minecraft/util/datafix/fixes/ChunkProtoTickListFix.java
|
||||
+++ b/src/main/java/net/minecraft/util/datafix/fixes/ChunkProtoTickListFix.java
|
||||
@@ -18,6 +18,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
|
||||
@@ -67,17 +67,17 @@ index c9101a3bf0cb2c9e49e0e768b379e8dd816012de..ec7f8ef7bcd0a6cf72d032714c3e1057
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
@@ -183,7 +184,7 @@ public class ChunkProtoTickListFix extends DataFix {
|
||||
int o = l >>> 8 & 15;
|
||||
String string = function.apply(supplier != null ? supplier.get().get(m, n, o) : null);
|
||||
return dynamic.createMap(
|
||||
@@ -186,7 +187,7 @@ public class ChunkProtoTickListFix extends DataFix {
|
||||
int k = packedLocalPos >>> 8 & 15;
|
||||
String string = blockIdGetter.apply(sectionSupplier != null ? sectionSupplier.get().get(i, j, k) : null);
|
||||
return levelDynamic.createMap(
|
||||
- ImmutableMap.builder()
|
||||
+ (Map) ImmutableMap.builder() // Gale - dev import deobfuscation fixes
|
||||
.put(dynamic.createString("i"), dynamic.createString(string))
|
||||
.put(dynamic.createString("x"), dynamic.createInt(i * 16 + m))
|
||||
.put(dynamic.createString("y"), dynamic.createInt(j * 16 + n))
|
||||
.put(levelDynamic.createString("i"), levelDynamic.createString(string))
|
||||
.put(levelDynamic.createString("x"), levelDynamic.createInt(sectionX * 16 + i))
|
||||
.put(levelDynamic.createString("y"), levelDynamic.createInt(sectionY * 16 + j))
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java b/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java
|
||||
index 166b7d87ab88e28d465fb4a5d07c180c10464925..a506f3ef40ec34a89abb73a60cedf3b556585bee 100644
|
||||
index 9167bad12e1be3f4163f85987862b044a630b2eb..9df053ddff459d4aab478106c6e66a5fc3cda8f6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/SurfaceRules.java
|
||||
@@ -155,7 +155,7 @@ public class SurfaceRules {
|
||||
|
||||
@@ -7,11 +7,11 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 983b6fbc67cc6914b9bcfcd76b15197671750c21..96186b0795c5d74012e2e8eb241f8b7db3fed8e0 100644
|
||||
index a302242681e477aa8f0d243e3a0ecf9f31c27c0a..fcc026e9b5ebf892d86f8395f3571b0a7c5b8311 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -67,6 +67,15 @@ paperweight {
|
||||
craftBukkitPackageVersion.set("v1_20_R4") // also needs to be updated in MappingEnvironment
|
||||
craftBukkitPackageVersion.set("v1_21_R1") // also needs to be updated in MappingEnvironment
|
||||
}
|
||||
|
||||
+// Gale start - hide irrelevant compilation warnings
|
||||
|
||||
@@ -221,7 +221,7 @@ index 94a9ed024d3859793618152ea559a168bbcbb5e2..e60008693e017bec1b4eb49c84be3898
|
||||
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
+<https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index f43a0aff5d735e21ac63eeb0314f829bd3b83554..335cc8638d307fcd0dad44c431ec7f9d5376fc09 100644
|
||||
index fc4e25d39c309e3be83e9a380eb6f5f0b58f5191..8f97350aac2f19a0d19e35630261dacc7b46ce52 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -89,14 +89,14 @@ tasks.jar {
|
||||
@@ -463,25 +463,19 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..2596e0ee4df5b96f181e28a742ef3459
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3751c2a077bd13bac330b93c6efc2a640a17f4f2..edabecf0cdd5dca3cc40084f87f4af750ffe3507 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -956,7 +956,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
shutdownThread = Thread.currentThread();
|
||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||
if (!isSameThread()) {
|
||||
- MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER)");
|
||||
+ // Gale start - branding changes
|
||||
+ /*
|
||||
+ We do not want people to report thread issues to Paper,
|
||||
+ but we do want people to report thread issues to Gale.
|
||||
+ */
|
||||
+ MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER - If you think this is a Gale bug, please report it at https://github.com/GaleMC/Gale/issues )");
|
||||
+ // Gale end - branding changes
|
||||
while (this.getRunningThread().isAlive()) {
|
||||
this.getRunningThread().stop();
|
||||
try {
|
||||
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
index bb1a60180e58c1333e7bb33e8acf1b0225eda8a8..4d037e899e0b5548be406ad55acd2062603b7da1 100644
|
||||
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -67,7 +67,7 @@ public class DamageSource {
|
||||
|
||||
public DamageSource customEventDamager(Entity entity) {
|
||||
if (this.directEntity != null) {
|
||||
- throw new IllegalStateException("Cannot set custom event damager when direct entity is already set (report a bug to Paper)");
|
||||
+ throw new IllegalStateException("Cannot set custom event damager when direct entity is already set (report a bug to Paper, if you think this is a Gale bug, please report it at https://github.com/GaleMC/Gale/issues)"); // Gale - branding changes
|
||||
}
|
||||
DamageSource damageSource = this.cloneInstance();
|
||||
damageSource.customEventDamager = entity;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index e85b9bb3f9c225d289a4959921970b9963881199..79192e3a0f27d48f35c0378b58e587212ed2c305 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -496,7 +490,7 @@ index e85b9bb3f9c225d289a4959921970b9963881199..79192e3a0f27d48f35c0378b58e58721
|
||||
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index f99353a60e3f236735ef6e2e6f13381b50ae9b7b..2918b61675e16a0dd023d3ca10f232c4675bf4b0 100644
|
||||
index 5a04134973dd1db7f778a57ec5f185feec370990..84b7717bff0d8644a924955cfe5a82285109dff5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -504,7 +504,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -699,10 +693,10 @@ index 0000000000000000000000000000000000000000..3d674eca7d20202d8f811c5c3e3946a1
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 6db566e3111ec08a99aa429624979cb83a85e272..5e556d7f3e444a7b7d7de70fa4efd50ef2a6dc8b 100644
|
||||
index c68256c0c8e131497108f677c6b254c589ce67e2..8da63e1ff46ef2ec87080612510e43c10e5b372a 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -155,14 +155,20 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -80,14 +80,20 @@ public class WatchdogThread extends Thread
|
||||
if (isLongTimeout) {
|
||||
// Paper end
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
@@ -726,7 +720,7 @@ index 6db566e3111ec08a99aa429624979cb83a85e272..5e556d7f3e444a7b7d7de70fa4efd50e
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -184,12 +190,18 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -109,12 +115,18 @@ public class WatchdogThread extends Thread
|
||||
// Paper end
|
||||
} else
|
||||
{
|
||||
@@ -744,10 +738,10 @@ index 6db566e3111ec08a99aa429624979cb83a85e272..5e556d7f3e444a7b7d7de70fa4efd50e
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
|
||||
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Gale!):" ); // Paper // Gale - branding changes
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
|
||||
this.dumpTickingInfo(); // Paper - log detailed tick information
|
||||
ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
|
||||
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
|
||||
@@ -205,7 +217,13 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
@@ -129,7 +141,13 @@ public class WatchdogThread extends Thread
|
||||
WatchdogThread.dumpThread( thread, log );
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -6,11 +6,24 @@ Subject: [PATCH] Gale metrics
|
||||
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
|
||||
index f52e104b3e07825caf0d6d1bda2e45c8437d6e20..df73ba5fad91eada64cdb2425c0f788dbbd953b8 100644
|
||||
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
|
||||
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
|
||||
@@ -52,7 +52,7 @@ public final class ChunkTaskScheduler {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ChunkTaskScheduler.class);
|
||||
|
||||
- static int newChunkSystemIOThreads;
|
||||
+ public static int newChunkSystemIOThreads; // Gale - metrics - chunk system IO threads - package-private -> public
|
||||
static int newChunkSystemGenParallelism;
|
||||
static int newChunkSystemGenPopulationParallelism;
|
||||
static int newChunkSystemLoadParallelism;
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 4b002e8b75d117b726b0de274a76d3596fce015b..2868dab7b100d9c325b0e5056f86660d631dec4b 100644
|
||||
index 6aaed8e8bf8c721fc834da5c76ac72a4c3e92458..2d5688979f269fa887448fe910ea87a87d93d1dd 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -593,7 +593,7 @@ public class Metrics {
|
||||
@@ -588,7 +588,7 @@ public class Metrics {
|
||||
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
|
||||
// Only start Metrics, if it's enabled in the config
|
||||
if (config.getBoolean("enabled", true)) {
|
||||
@@ -19,7 +32,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..2868dab7b100d9c325b0e5056f86660d
|
||||
|
||||
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
||||
String minecraftVersion = Bukkit.getVersion();
|
||||
@@ -603,20 +603,20 @@ public class Metrics {
|
||||
@@ -598,20 +598,20 @@ public class Metrics {
|
||||
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : "offline"));
|
||||
@@ -46,7 +59,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..2868dab7b100d9c325b0e5056f86660d
|
||||
entry.put(javaVersion, 1);
|
||||
|
||||
// http://openjdk.java.net/jeps/223
|
||||
@@ -645,7 +645,7 @@ public class Metrics {
|
||||
@@ -640,7 +640,7 @@ public class Metrics {
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> {
|
||||
@@ -55,7 +68,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..2868dab7b100d9c325b0e5056f86660d
|
||||
|
||||
// count legacy plugins
|
||||
int legacy = 0;
|
||||
@@ -656,7 +656,7 @@ public class Metrics {
|
||||
@@ -651,7 +651,7 @@ public class Metrics {
|
||||
}
|
||||
|
||||
// insert real value as lower dimension
|
||||
@@ -64,7 +77,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..2868dab7b100d9c325b0e5056f86660d
|
||||
entry.put(String.valueOf(legacy), 1);
|
||||
|
||||
// create buckets as higher dimension
|
||||
@@ -676,6 +676,253 @@ public class Metrics {
|
||||
@@ -671,6 +671,253 @@ public class Metrics {
|
||||
|
||||
return map;
|
||||
}));
|
||||
@@ -203,7 +216,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..2868dab7b100d9c325b0e5056f86660d
|
||||
+ }));
|
||||
+ // Gale end - metrics - netty threads
|
||||
+
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("chunk_system_io_thread_count", () -> String.valueOf(io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.newChunkSystemIOThreads))); // Gale - metrics - chunk system IO threads
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("chunk_system_io_thread_count", () -> String.valueOf(ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.newChunkSystemIOThreads))); // Gale - metrics - chunk system IO threads
|
||||
+
|
||||
+ // Gale start - metrics - physical cores
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("physical_core_count", () -> {
|
||||
@@ -318,16 +331,3 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..2868dab7b100d9c325b0e5056f86660d
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
|
||||
index 17ce14f2dcbf900890efbc2351782bc6f8867068..fd099f8a7d95f46de7380c8280623bf5eb427eaa 100644
|
||||
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
|
||||
@@ -43,7 +43,7 @@ public final class ChunkTaskScheduler {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getClassLogger();
|
||||
|
||||
- static int newChunkSystemIOThreads;
|
||||
+ public static int newChunkSystemIOThreads; // Gale - metrics - chunk system IO threads - package-private -> public
|
||||
static int newChunkSystemWorkerThreads;
|
||||
static int newChunkSystemGenParallelism;
|
||||
static int newChunkSystemLoadParallelism;
|
||||
|
||||
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 2868dab7b100d9c325b0e5056f86660d631dec4b..2acad4c3fd58178b0f8b22bdb04eeeeb689d5afa 100644
|
||||
index 2d5688979f269fa887448fe910ea87a87d93d1dd..16ecdf3c56809100032ca627a1769e4e8c452f08 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -923,6 +923,16 @@ public class Metrics {
|
||||
@@ -918,6 +918,16 @@ public class Metrics {
|
||||
}));
|
||||
// Gale end - metrics - runtime max memory
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ index 7620c72a4c243cbeea245203ce03a97cbfa7d922..29796a404e210f7864f4b33b3367e025
|
||||
JSONObject object = new JSONObject();
|
||||
for (String key : config.getKeys(false)) {
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
index 96142deb42700f888ea08689ab62c27ef2b881fd..6f1ce6bfca1ab1cb64c6da381329349b7f1153c1 100644
|
||||
index 87e5f614ba988547a827486740db217e28585773..38d99d73a33911afa71d02a456bb4df62ce75166 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
|
||||
@@ -7,8 +7,11 @@ import io.papermc.paper.configuration.constraint.Constraint;
|
||||
@@ -189,7 +189,7 @@ index 8f23276796037d048eb114952891a01a40971b3e..ac9ceb54b894119cb30a22d37e035e2c
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index edabecf0cdd5dca3cc40084f87f4af750ffe3507..9bdd6a3db74cf5c5c069be88cf2135ebda08b2ef 100644
|
||||
index 7e32eecacf6f5e832dbfd0455e4bab1302a33d46..c7bb2416529a96614cdaf8e86e0c37690e69102e 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -3,9 +3,6 @@ package net.minecraft.server;
|
||||
@@ -202,7 +202,7 @@ index edabecf0cdd5dca3cc40084f87f4af750ffe3507..9bdd6a3db74cf5c5c069be88cf2135eb
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -144,6 +141,9 @@ import net.minecraft.world.level.levelgen.WorldOptions;
|
||||
@@ -149,6 +146,9 @@ import net.minecraft.world.level.levelgen.WorldOptions;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
|
||||
import net.minecraft.world.level.storage.WorldData;
|
||||
@@ -212,7 +212,7 @@ index edabecf0cdd5dca3cc40084f87f4af750ffe3507..9bdd6a3db74cf5c5c069be88cf2135eb
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -310,6 +310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -317,6 +317,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public final double[] recentTps = new double[ 3 ];
|
||||
// Spigot end
|
||||
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
|
||||
@@ -220,7 +220,7 @@ index edabecf0cdd5dca3cc40084f87f4af750ffe3507..9bdd6a3db74cf5c5c069be88cf2135eb
|
||||
public static long currentTickLong = 0L; // Paper - track current tick as a long
|
||||
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
|
||||
@@ -418,6 +419,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -430,6 +431,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
||||
// CraftBukkit end
|
||||
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
|
||||
@@ -274,32 +274,10 @@ index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..67d4a82f371a4772128cc2218fd0a18c
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index ad967cc2283f902c76e48a59d59cf0dbdacbb5e3..f5477b26d6e3eed4720a783e9557b1fafb92a7cf 100644
|
||||
index 0761d5bc5f2813bb4a9f664ac7a05b9744d0a778..87ec971241047314e7d505fb6b35be4a456727de 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -1,20 +1,15 @@
|
||||
package net.minecraft.server.dedicated;
|
||||
|
||||
-import com.google.common.collect.Lists;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.datafixers.DataFixer;
|
||||
import com.mojang.logging.LogUtils;
|
||||
-import java.io.BufferedReader;
|
||||
+
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
-import java.io.InputStreamReader;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Proxy;
|
||||
-import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
-import java.util.Collections;
|
||||
-import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.function.BooleanSupplier;
|
||||
@@ -222,6 +217,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -226,6 +226,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
@@ -311,23 +289,10 @@ index ad967cc2283f902c76e48a59d59cf0dbdacbb5e3..f5477b26d6e3eed4720a783e9557b1fa
|
||||
if (this.convertOldUsers()) {
|
||||
this.getProfileCache().save(false); // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..40db66b168b8927b3d3dd8ec2bf77c22212142ce 100644
|
||||
index fb0db51493e343c781876b9db773fa3fc9a8d666..1972203ee1bdd9966b74926bae6ef23d4a1cedef 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -138,12 +138,10 @@ import net.minecraft.world.level.chunk.storage.SimpleRegionStorage;
|
||||
import net.minecraft.world.level.dimension.BuiltinDimensionTypes;
|
||||
import net.minecraft.world.level.dimension.LevelStem;
|
||||
import net.minecraft.world.level.dimension.end.EndDragonFight;
|
||||
-import net.minecraft.world.level.entity.EntityPersistentStorage;
|
||||
import net.minecraft.world.level.entity.EntityTickList;
|
||||
import net.minecraft.world.level.entity.EntityTypeTest;
|
||||
import net.minecraft.world.level.entity.LevelCallback;
|
||||
import net.minecraft.world.level.entity.LevelEntityGetter;
|
||||
-import net.minecraft.world.level.entity.PersistentEntitySectionManager;
|
||||
import net.minecraft.world.level.gameevent.DynamicGameEventListener;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.level.gameevent.GameEventDispatcher;
|
||||
@@ -697,7 +695,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -503,7 +503,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
|
||||
|
||||
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
||||
@@ -337,7 +302,7 @@ index ca56a0b596976448da6bb2a0e82b3d5cd4133e12..40db66b168b8927b3d3dd8ec2bf77c22
|
||||
this.convertable = convertable_conversionsession;
|
||||
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 14281a4e72f49dc4eb2ca3da8479c1f81a3a175d..01453ffd7e47933dd65fddba9be8e71f3a51cc46 100644
|
||||
index 96ad3868a93964247790134fa5f4b18e5c07aea8..7d53bcbb62ed87d39dd1e47136343541cca2d547 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -12,7 +12,6 @@ import java.util.function.Supplier;
|
||||
@@ -348,7 +313,7 @@ index 14281a4e72f49dc4eb2ca3da8479c1f81a3a175d..01453ffd7e47933dd65fddba9be8e71f
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.Holder;
|
||||
@@ -41,8 +40,6 @@ import net.minecraft.world.TickRateManager;
|
||||
@@ -42,8 +41,6 @@ import net.minecraft.world.TickRateManager;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.damagesource.DamageSources;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
@@ -357,15 +322,15 @@ index 14281a4e72f49dc4eb2ca3da8479c1f81a3a175d..01453ffd7e47933dd65fddba9be8e71f
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
@@ -99,6 +96,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
@@ -100,6 +97,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
import org.bukkit.craftbukkit.util.CraftSpawnCategory;
|
||||
import org.bukkit.entity.SpawnCategory;
|
||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
+import org.galemc.gale.configuration.GaleWorldConfiguration;
|
||||
// CraftBukkit end
|
||||
|
||||
public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -169,6 +167,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel, ca.spottedleaf.moonrise.patches.chunk_system.world.ChunkSystemEntityGetter { // Paper - rewrite chunk system
|
||||
@@ -170,6 +168,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
return this.paperConfig;
|
||||
}
|
||||
// Paper end - add paper world config
|
||||
@@ -378,12 +343,12 @@ index 14281a4e72f49dc4eb2ca3da8479c1f81a3a175d..01453ffd7e47933dd65fddba9be8e71f
|
||||
|
||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
@@ -205,9 +209,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -258,9 +262,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
|
||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||
|
||||
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor
|
||||
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor // Gale - Gale configuration
|
||||
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray
|
||||
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
+ this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration
|
||||
@@ -391,10 +356,10 @@ index 14281a4e72f49dc4eb2ca3da8479c1f81a3a175d..01453ffd7e47933dd65fddba9be8e71f
|
||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5db08432b6afd3639688830e717f40ceaf599248..e4ab54277f7f21c41c07ce9b149431d96d794cd8 100644
|
||||
index caf6ff33b42472d30f28629470e12889f50490cc..eb4c9014afe2b59e991a2812c55eaa226925272c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1056,6 +1056,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1059,6 +1059,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
@@ -402,7 +367,7 @@ index 5db08432b6afd3639688830e717f40ceaf599248..e4ab54277f7f21c41c07ce9b149431d9
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -3053,6 +3054,14 @@ public final class CraftServer implements Server {
|
||||
@@ -2978,6 +2979,14 @@ public final class CraftServer implements Server {
|
||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ As part of: Paper (https://github.com/PaperMC/Paper)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 729663b324a7473a5da22f0a615ad20380c7374d..22e6faa71d4bca2f6e975d5be2d05e09300400d4 100644
|
||||
index 87ec971241047314e7d505fb6b35be4a456727de..f5510ec3ecdb51ca33b4e91ffd164d62b4f7c5dd 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -50,6 +50,7 @@ import net.minecraft.world.level.GameRules;
|
||||
@@ -57,6 +57,7 @@ import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.GameType;
|
||||
import net.minecraft.world.level.block.entity.SkullBlockEntity;
|
||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||
@@ -24,7 +24,7 @@ index 729663b324a7473a5da22f0a615ad20380c7374d..22e6faa71d4bca2f6e975d5be2d05e09
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -230,6 +231,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -239,6 +240,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
|
||||
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
|
||||
|
||||
@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index e02102280ed1dc300191d19bbca8f00e17701753..6224bb20a2e3919b5fb33e5cfb8babc1929460c2 100644
|
||||
index 6e1f92b45504cef0c4dcbbebf3df339ef4cad0a1..f4106b117c2b82a25616b590e7b0853f05864ea1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -2,6 +2,7 @@ package org.bukkit.craftbukkit;
|
||||
@@ -45,7 +45,7 @@ index e02102280ed1dc300191d19bbca8f00e17701753..6224bb20a2e3919b5fb33e5cfb8babc1
|
||||
public static void main(String[] args) {
|
||||
// Paper start
|
||||
final String warnWhenLegacyFormattingDetected = String.join(".", "net", "kyori", "adventure", "text", "warnWhenLegacyFormattingDetected");
|
||||
@@ -318,13 +339,13 @@ public class Main {
|
||||
@@ -288,13 +309,13 @@ public class Main {
|
||||
String javaInfo = "Java " + runtimeMX.getSpecVersion() + " (" + runtimeMX.getVmName() + " " + runtimeMX.getVmVersion() + ")";
|
||||
String osInfo = "Host: " + osMX.getName() + " " + osMX.getVersion() + " (" + osMX.getArch() + ")";
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ index 29796a404e210f7864f4b33b3367e02531bca2a0..73e503d0590964ac7f9ea15ac7ee7783
|
||||
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||
// Gale start - Gale configuration - include in timings
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
index 9d10cdacb3aed2c00dc60aeb6f2cbeb48905e21f..4323ffee716380bd67eb04a4a7bb62bc4ba2f7df 100644
|
||||
index d6431376184e5650b370cbab204e28bc31f4dac6..bfe9be2e329c2ea2c8c44458e88d22bc75520ed4 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
@@ -66,6 +66,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
@@ -67,6 +67,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
public final Difficulty difficulty;
|
||||
public final GameType gamemode;
|
||||
public final String levelName;
|
||||
@@ -38,7 +38,7 @@ index 9d10cdacb3aed2c00dc60aeb6f2cbeb48905e21f..4323ffee716380bd67eb04a4a7bb62bc
|
||||
public final int serverPort;
|
||||
@Nullable
|
||||
public final Boolean announcePlayerAchievements;
|
||||
@@ -99,13 +100,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
@@ -100,13 +101,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
public final boolean hideOnlinePlayers;
|
||||
public final int entityBroadcastRangePercentage;
|
||||
public final String textFilteringConfig;
|
||||
@@ -54,7 +54,7 @@ index 9d10cdacb3aed2c00dc60aeb6f2cbeb48905e21f..4323ffee716380bd67eb04a4a7bb62bc
|
||||
public final WorldOptions worldOptions;
|
||||
public boolean acceptsTransfers;
|
||||
|
||||
@@ -160,6 +162,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
@@ -161,6 +163,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
this.logIPs = this.get("log-ips", true);
|
||||
this.acceptsTransfers = this.get("accepts-transfers", false);
|
||||
String s = this.get("level-seed", "");
|
||||
@@ -62,7 +62,7 @@ index 9d10cdacb3aed2c00dc60aeb6f2cbeb48905e21f..4323ffee716380bd67eb04a4a7bb62bc
|
||||
boolean flag = this.get("generate-structures", true);
|
||||
long i = WorldOptions.parseSeed(s).orElse(WorldOptions.randomSeed());
|
||||
|
||||
@@ -169,7 +172,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
@@ -170,7 +173,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
}, new JsonObject()), (String) this.get("level-type", (s1) -> {
|
||||
return s1.toLowerCase(Locale.ROOT);
|
||||
}, WorldPresets.NORMAL.location().toString()));
|
||||
|
||||
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 729666f8d9fdb83bbc2b1baa3c61ecf02c10cc45..96830b6ec04d96f5108efbccdcbe45047e1230d7 100644
|
||||
index c7bb2416529a96614cdaf8e86e0c37690e69102e..fccf9d434f541ce07da19afed527e2fb6fa97c4d 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1562,7 +1562,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1471,7 +1471,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -19,7 +19,7 @@ index 729666f8d9fdb83bbc2b1baa3c61ecf02c10cc45..96830b6ec04d96f5108efbccdcbe4504
|
||||
long i = Util.getNanos();
|
||||
|
||||
// Paper start - move oversleep into full server tick
|
||||
@@ -1632,7 +1632,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1529,7 +1529,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.logTickMethodTime(i);
|
||||
this.profiler.pop();
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -99,10 +99,10 @@ public class Main {
|
||||
```
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
index e5c2e53388ff61e4aeae22a74b525d9a26ea0200..15dddb035c7ae3aca9b5cd5a5f56e0407641d9dd 100644
|
||||
index 4f5badb9429b34ed999183321c98b60978715638..015a6463875b5ae46da0491b358adc568ac9a174 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
@@ -168,13 +168,11 @@ public final class MCUtil {
|
||||
@@ -152,13 +152,11 @@ public final class MCUtil {
|
||||
}
|
||||
|
||||
public static int fastFloor(double x) {
|
||||
@@ -118,7 +118,7 @@ index e5c2e53388ff61e4aeae22a74b525d9a26ea0200..15dddb035c7ae3aca9b5cd5a5f56e040
|
||||
}
|
||||
|
||||
public static float normalizeYaw(float f) {
|
||||
@@ -235,11 +233,11 @@ public final class MCUtil {
|
||||
@@ -219,11 +217,11 @@ public final class MCUtil {
|
||||
}
|
||||
|
||||
public static int getChunkCoordinate(final double coordinate) {
|
||||
@@ -133,7 +133,7 @@ index e5c2e53388ff61e4aeae22a74b525d9a26ea0200..15dddb035c7ae3aca9b5cd5a5f56e040
|
||||
|
||||
public static long getBlockKey(final int x, final int y, final int z) {
|
||||
diff --git a/src/main/java/net/minecraft/util/Mth.java b/src/main/java/net/minecraft/util/Mth.java
|
||||
index 990ea96de8e940390b67e9462fcfd6025f2f5770..e102c109d01e0f992808a6096b5f6a323b52d970 100644
|
||||
index f298cdfcf1539e467f57f9f7789de3cf2ca54665..4150562f61fbb5962bf6c7d2727da43feed89036 100644
|
||||
--- a/src/main/java/net/minecraft/util/Mth.java
|
||||
+++ b/src/main/java/net/minecraft/util/Mth.java
|
||||
@@ -58,13 +58,11 @@ public class Mth {
|
||||
|
||||
@@ -37,10 +37,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
||||
index 3554109bcc4651ca93b6275c914e57e007e2204e..d7f11092148f2b4f1aa224906765ab1cbeb81a26 100644
|
||||
index 5740296b55827f11c0029e89a86eaab1a24f560c..23344dcb49e8bfd6338e1e9d204861b28ea1da11 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
||||
@@ -27,8 +27,15 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
|
||||
@@ -25,8 +25,15 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
|
||||
final CraftingBookCategory category;
|
||||
final ItemStack result;
|
||||
final NonNullList<Ingredient> ingredients;
|
||||
@@ -56,16 +56,17 @@ index 3554109bcc4651ca93b6275c914e57e007e2204e..d7f11092148f2b4f1aa224906765ab1c
|
||||
this.group = group;
|
||||
this.category = category;
|
||||
this.result = result;
|
||||
@@ -78,6 +85,28 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
|
||||
@@ -76,6 +83,29 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
|
||||
}
|
||||
|
||||
public boolean matches(CraftingContainer inventory, Level world) {
|
||||
public boolean matches(CraftingInput input, Level world) {
|
||||
+ // Gale start - Airplane - simpler ShapelessRecipe comparison for vanilla
|
||||
+ if (!this.isBukkit) {
|
||||
+ java.util.List<Ingredient> ingredients = com.google.common.collect.Lists.newArrayList(this.ingredients.toArray(new Ingredient[0]));
|
||||
+
|
||||
+ inventory: for (int index = 0; index < inventory.getContainerSize(); index++) {
|
||||
+ ItemStack itemStack = inventory.getItem(index);
|
||||
+ inventory:
|
||||
+ for (int index = 0; index < input.size(); index++) {
|
||||
+ ItemStack itemStack = input.getItem(index);
|
||||
+
|
||||
+ if (!itemStack.isEmpty()) {
|
||||
+ for (int i = 0; i < ingredients.size(); i++) {
|
||||
@@ -82,9 +83,9 @@ index 3554109bcc4651ca93b6275c914e57e007e2204e..d7f11092148f2b4f1aa224906765ab1c
|
||||
+ }
|
||||
+ // Gale end - Airplane - simpler ShapelessRecipe comparison for vanilla
|
||||
+
|
||||
StackedContents autorecipestackmanager = new StackedContents();
|
||||
autorecipestackmanager.initialize(this); // Paper - better exact choice recipes
|
||||
int i = 0;
|
||||
// Paper start - unwrap ternary & better exact choice recipes
|
||||
if (input.ingredientCount() != this.ingredients.size()) {
|
||||
return false;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
|
||||
index 96d772eb02f79f8c478f5e6f065e387aa7665b18..0d27792dcc3deb4cc7835512f4156b490223358d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java
|
||||
|
||||
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index 74c596264d4da551437bd2a23e1c70022cfc73fc..adb4cd2a926744182952d0702284f7c7b9e5d42c 100644
|
||||
index 5f7d152f41eb85f17bcded4bc8099b998e5a338b..e58c61b73e8a0a1701e6756408aafe81e52fb6f2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -46,6 +46,45 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -52,6 +52,45 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
super(type, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index 260202fab3ac300552c557b44dcf251f083c6a78..15b544bd0794e021ed4a9fde94883bcb5c6a3521 100644
|
||||
index 828c51477cd8f35d591367b30bf4feef6a250292..7b05ef99702af0e8a7d2a652984c4f8c15eefed8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -318,11 +318,17 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
@@ -320,11 +320,17 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
private boolean teleport(double x, double y, double z) {
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(x, y, z);
|
||||
|
||||
@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
index e1b6fe9ecda25f86431baf414f1bfd3a26a8b2bd..b5242f2d450f863a3eb774d8a14bb00cbe699a16 100644
|
||||
index e8aa27547e3fa1a42720889c7038d4fb0273e7b5..f053ee19875e6c1586ffe4ebb0284172af5fbb23 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.core.BlockPos;
|
||||
@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
index ca7fbe4f8c1e1d2fb90095aa35be4dda3029c23e..4ef55f51f98a4b5c164b40728efd82052c5bf762 100644
|
||||
index 6e66141dca61f777b354854b5d0bac2570b8bf3b..06104744bb778a922adaaee2d91252cd37080f8f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -643,6 +643,8 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -89,10 +89,10 @@ index ca7fbe4f8c1e1d2fb90095aa35be4dda3029c23e..4ef55f51f98a4b5c164b40728efd8205
|
||||
public void replaceWith(Inventory other) {
|
||||
for (int i = 0; i < this.getContainerSize(); ++i) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
index cf8ae635fce7ea66d4e1ab1dc05575f035fa95ef..973f1d2c1db383eed5fccb7ccbad8f9a6b81d824 100644
|
||||
index 17f33c83c6033564d6bf4fbd388b0b847c68adb3..73e546cc828850365dae0131bf8d997f58473823 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
@@ -294,7 +294,7 @@ public class MapItemSavedData extends SavedData {
|
||||
@@ -295,7 +295,7 @@ public class MapItemSavedData extends SavedData {
|
||||
|
||||
Predicate<ItemStack> predicate = MapItemSavedData.mapMatcher(stack);
|
||||
|
||||
@@ -101,7 +101,7 @@ index cf8ae635fce7ea66d4e1ab1dc05575f035fa95ef..973f1d2c1db383eed5fccb7ccbad8f9a
|
||||
this.removeDecoration(player.getName().getString());
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ public class MapItemSavedData extends SavedData {
|
||||
@@ -303,7 +303,7 @@ public class MapItemSavedData extends SavedData {
|
||||
MapItemSavedData.HoldingPlayer worldmap_worldmaphumantracker1 = (MapItemSavedData.HoldingPlayer) this.carriedBy.get(i);
|
||||
String s = worldmap_worldmaphumantracker1.player.getName().getString();
|
||||
|
||||
@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
index d2f0c3b26d4beedb49d86e0242d843590d469d02..68bc8699a9389d118411ea7134ea0e0588adf8dc 100644
|
||||
index aecb0ad814586bfc5e56755ee14379a69388b38c..4addcfe248dd4705be7e67551b258ce86c57e194 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
@@ -76,9 +76,18 @@ public class TargetingConditions {
|
||||
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index e4ab54277f7f21c41c07ce9b149431d96d794cd8..d1757b96dc4d27605ed1d0819c4b6246152ae1da 100644
|
||||
index eb4c9014afe2b59e991a2812c55eaa226925272c..e466142e52fe29505384bf5371a54b0976ebd7fe 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1148,6 +1148,13 @@ public final class CraftServer implements Server {
|
||||
@@ -1151,6 +1151,13 @@ public final class CraftServer implements Server {
|
||||
plugin.getPluginMeta().getDisplayName(),
|
||||
"This plugin is not properly shutting down its async tasks when it is being shut down. This task may throw errors during the final shutdown logs and might not complete before process dies."
|
||||
));
|
||||
@@ -186,7 +186,7 @@ index 0000000000000000000000000000000000000000..bf6a36c933b686f0e34591dff3d43b37
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
index 6d8ff6c06af5545634f255ed17dc1e489ece2548..05273fa3b59d67858abffcb1ff18a6ff5885c316 100644
|
||||
index 1c0712295695727ee9c4d430d4157b8e17cbd71f..0eac7bc0c56ac17c900737271a965cfc1ccd03d2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -45,6 +45,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -213,16 +213,16 @@ index 6d8ff6c06af5545634f255ed17dc1e489ece2548..05273fa3b59d67858abffcb1ff18a6ff
|
||||
private final Map<FluidState, VoxelShape> shapes = Maps.newIdentityHashMap();
|
||||
|
||||
public FlowingFluid() {}
|
||||
@@ -251,6 +261,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
return false;
|
||||
@@ -240,6 +250,8 @@ public abstract class FlowingFluid extends Fluid {
|
||||
}
|
||||
// Paper end - optimise collisions
|
||||
|
||||
private boolean canPassThroughWall(Direction face, BlockGetter world, BlockPos pos, BlockState state, BlockPos fromPos, BlockState fromState) {
|
||||
+ // Gale start - Airplane - improve fluid direction caching - modify to use our cache
|
||||
+ /*
|
||||
Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap;
|
||||
|
||||
if (!state.getBlock().hasDynamicShape() && !fromState.getBlock().hasDynamicShape()) {
|
||||
@@ -258,9 +270,16 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -247,9 +259,16 @@ public abstract class FlowingFluid extends Fluid {
|
||||
} else {
|
||||
object2bytelinkedopenhashmap = null;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ index 6d8ff6c06af5545634f255ed17dc1e489ece2548..05273fa3b59d67858abffcb1ff18a6ff
|
||||
if (object2bytelinkedopenhashmap != null) {
|
||||
block_a = new Block.BlockStatePairKey(state, fromState, face);
|
||||
byte b0 = object2bytelinkedopenhashmap.getAndMoveToFirst(block_a);
|
||||
@@ -271,11 +290,22 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -260,11 +279,22 @@ public abstract class FlowingFluid extends Fluid {
|
||||
} else {
|
||||
block_a = null;
|
||||
}
|
||||
@@ -262,7 +262,7 @@ index 6d8ff6c06af5545634f255ed17dc1e489ece2548..05273fa3b59d67858abffcb1ff18a6ff
|
||||
if (object2bytelinkedopenhashmap != null) {
|
||||
if (object2bytelinkedopenhashmap.size() == 200) {
|
||||
object2bytelinkedopenhashmap.removeLastByte();
|
||||
@@ -283,6 +313,11 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -272,6 +302,11 @@ public abstract class FlowingFluid extends Fluid {
|
||||
|
||||
object2bytelinkedopenhashmap.putAndMoveToFirst(block_a, (byte) (flag ? 1 : 0));
|
||||
}
|
||||
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index d67a149de34619ac9945ba7fdbd4c7c8f33c8817..6c7a94fc951f6168c4a2907cc4d50b09c2913ab1 100644
|
||||
index 5021c4618c8302e103fb2595a8d3df26f7479140..8676206457ec59bf711d3f4a2836ff47fea23bb6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -150,7 +150,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
@@ -157,7 +157,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -42,7 +42,7 @@ index d67a149de34619ac9945ba7fdbd4c7c8f33c8817..6c7a94fc951f6168c4a2907cc4d50b09
|
||||
|
||||
public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
@@ -2032,6 +2031,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2026,6 +2025,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.lastClimbablePos;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ index d67a149de34619ac9945ba7fdbd4c7c8f33c8817..6c7a94fc951f6168c4a2907cc4d50b09
|
||||
if (this.isSpectator()) {
|
||||
return false;
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 3283ed99c35ffed6805567705e0518d9f84feedc..6bd07ab4bd46bc6ffd4b20132e05fccb1adf1329 100644
|
||||
index bf2d18f74b0f0da7c3c30310c74224a1c0853564..f83c2b35cc279666686be3af558473b5d93bf7cd 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -298,7 +298,7 @@ public class ActivationRange
|
||||
@@ -158,7 +158,7 @@ index 0000000000000000000000000000000000000000..f3835d6934f4d82980eb068c0b8c238f
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
index 64076a452a315090d299a7a58a43fd3b5c1b4e0a..455a037174d66fd2fa1a136207ff7495486fd918 100644
|
||||
index 15f82c9a1ce1fef2e951d1b3c7a65e64b82061ea..115a9adac2131dd875d4bf1b6bc998125a96008d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||
@@ -63,13 +63,18 @@ public final class Biome {
|
||||
@@ -31,18 +31,18 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index f16a69775332a08ed0e87d27acd0fc959359694c..4a5dc0c552bbd48cb79e29016ea455882cf13744 100644
|
||||
index 1d849ce4e2c85f149af25318b8ffb6dcef6c6788..ac5bdd0584cd48d95c97dfa791eee9f447082cea 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -191,6 +191,7 @@ public class ServerEntity {
|
||||
@@ -181,6 +181,7 @@ public class ServerEntity {
|
||||
boolean flag6 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;
|
||||
|
||||
if (!this.forceStateResync && !flag6 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.onGround()&& !(io.papermc.paper.configuration.GlobalConfiguration.get().collisions.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync
|
||||
if (!flag6 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.onGround()) {
|
||||
+ if (flag2 || flag3 || this.entity instanceof AbstractArrow) { // Gale - Airplane - better checking for useless move packets
|
||||
if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) {
|
||||
if (flag2) {
|
||||
packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.onGround());
|
||||
@@ -204,6 +205,7 @@ public class ServerEntity {
|
||||
@@ -194,6 +195,7 @@ public class ServerEntity {
|
||||
flag4 = true;
|
||||
flag5 = true;
|
||||
}
|
||||
@@ -31,12 +31,12 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 42750bdde718f9047f008afbb12c0836e9c3d089..e5c640b4353d2fb09ebb2e7d498f704cc9a6acfa 100644
|
||||
index d7a638680fa349caba43f07ab9e6e4fa7303fb48..13b38b21d0425527e1a83e655e6be4bd6c5c2a02 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -210,6 +210,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||
@@ -259,6 +259,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
|
||||
+ // Gale start - Airplane - inline level height
|
||||
+ private final int minBuildHeight, levelHeightAccessorMinSection, height, maxBuildHeight, levelHeightAccessorMaxSection;
|
||||
@@ -47,10 +47,10 @@ index 42750bdde718f9047f008afbb12c0836e9c3d089..e5c640b4353d2fb09ebb2e7d498f704c
|
||||
+ @Override public final int getHeight() { return this.height; }
|
||||
+ // Gale end - Airplane - inline level height
|
||||
+
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
@@ -229,6 +238,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -278,6 +287,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
this.dimensionTypeRegistration = holder;
|
||||
final DimensionType dimensionmanager = (DimensionType) holder.value();
|
||||
|
||||
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 278c90341e1a3c47a584c6520ef8c108f7014c7a..8249ddaef0ad20ac5c3482159be24066230e6563 100644
|
||||
index a7142d9c7a1b739ada45f4d393fb970b1e21214f..aa6927ad7ea10b64693a069202366a051183e878 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1456,8 +1456,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1221,8 +1221,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ index 278c90341e1a3c47a584c6520ef8c108f7014c7a..8249ddaef0ad20ac5c3482159be24066
|
||||
Iterator iterator = this.entity.getIndirectPassengers().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1469,6 +1491,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1234,6 +1256,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
i = j;
|
||||
}
|
||||
}
|
||||
@@ -31,24 +31,24 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 7ff046e6e1e8f532ab7347beaeac898c57157cc2..2e784ad7c5e38ce74f3bcf0f20718422e3335c98 100644
|
||||
index bf69dd0f673e86fb2de6251bedcf36e4577933d9..12a23899497ee4a9666cfbee1bc2e535812512d4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -503,6 +503,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this));
|
||||
@@ -445,6 +445,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this.originWorld;
|
||||
}
|
||||
// Paper end - optimise entity tracking
|
||||
// Paper end - Entity origin API
|
||||
+
|
||||
public float getBukkitYaw() {
|
||||
return this.yRot;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
index 9ef8f014af332da129bfcd3370da983ec035ecc6..665fbe3362dcd9de4bd290b71a1b1f2fed218eeb 100644
|
||||
index 69992ebc999ea3ff9e47e4e049bcc514c01150ca..f9f6745d45aaba4a7106f80d403dcf9ae40e1d6c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
@@ -22,9 +22,11 @@ public class AttributeMap {
|
||||
private final Map<Holder<Attribute>, AttributeInstance> attributes = new Object2ObjectOpenHashMap<>();
|
||||
private final Set<AttributeInstance> dirtyAttributes = new ObjectOpenHashSet<>();
|
||||
@@ -23,9 +23,11 @@ public class AttributeMap {
|
||||
private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
||||
private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
||||
private final AttributeSupplier supplier;
|
||||
+ private final java.util.function.Function<Holder<Attribute>, AttributeInstance> createInstance; // Gale - Airplane - reduce entity allocations
|
||||
|
||||
@@ -58,7 +58,7 @@ index 9ef8f014af332da129bfcd3370da983ec035ecc6..665fbe3362dcd9de4bd290b71a1b1f2f
|
||||
}
|
||||
|
||||
private void onAttributeModified(AttributeInstance instance) {
|
||||
@@ -43,7 +45,7 @@ public class AttributeMap {
|
||||
@@ -49,7 +51,7 @@ public class AttributeMap {
|
||||
|
||||
@Nullable
|
||||
public AttributeInstance getInstance(Holder<Attribute> attribute) {
|
||||
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 2e784ad7c5e38ce74f3bcf0f20718422e3335c98..899cf208b8059600b364ae0d64b2a041620c3da3 100644
|
||||
index 12a23899497ee4a9666cfbee1bc2e535812512d4..795f7ac6479648fbfc34a3eb2ff954202f27789e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4467,16 +4467,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4255,16 +4255,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
|
||||
@@ -60,7 +60,7 @@ index 2e784ad7c5e38ce74f3bcf0f20718422e3335c98..899cf208b8059600b364ae0d64b2a041
|
||||
double d1 = 0.0D;
|
||||
boolean flag = this.isPushedByFluid();
|
||||
boolean flag1 = false;
|
||||
@@ -4484,14 +4486,61 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4272,14 +4274,61 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
int k1 = 0;
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
|
||||
|
||||
@@ -128,7 +128,7 @@ index 2e784ad7c5e38ce74f3bcf0f20718422e3335c98..899cf208b8059600b364ae0d64b2a041
|
||||
|
||||
if (d2 >= axisalignedbb.minY) {
|
||||
flag1 = true;
|
||||
@@ -4513,9 +4562,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4301,9 +4350,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
@@ -142,7 +142,7 @@ index 2e784ad7c5e38ce74f3bcf0f20718422e3335c98..899cf208b8059600b364ae0d64b2a041
|
||||
if (vec3d.length() > 0.0D) {
|
||||
if (k1 > 0) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
||||
index a2a5aef769ee8bb638a5a9f3da9812fa4a85dda5..121459fdb47904d448f86362f535765c713a4b67 100644
|
||||
index f2e11bff414b521295bde721e01ae2166a6a3fd6..440a35f0b987187895a7f74efc4f1989e1bee907 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
|
||||
@@ -25,6 +25,7 @@ public class LevelChunkSection {
|
||||
@@ -150,10 +150,10 @@ index a2a5aef769ee8bb638a5a9f3da9812fa4a85dda5..121459fdb47904d448f86362f535765c
|
||||
// CraftBukkit start - read/write
|
||||
private PalettedContainer<Holder<Biome>> biomes;
|
||||
+ public short fluidStateCount; // Gale - Airplane - reduce entity fluid lookups if no fluids
|
||||
public final com.destroystokyo.paper.util.maplist.IBlockDataList tickingList = new com.destroystokyo.paper.util.maplist.IBlockDataList(); // Paper
|
||||
// Paper start - optimise collisions
|
||||
private int specialCollidingBlocks;
|
||||
@@ -102,6 +103,7 @@ public class LevelChunkSection {
|
||||
|
||||
public LevelChunkSection(PalettedContainer<BlockState> datapaletteblock, PalettedContainer<Holder<Biome>> palettedcontainerro) {
|
||||
// CraftBukkit end
|
||||
@@ -82,6 +83,7 @@ public class LevelChunkSection {
|
||||
|
||||
if (!fluid.isEmpty()) {
|
||||
--this.tickingFluidCount;
|
||||
@@ -161,19 +161,35 @@ index a2a5aef769ee8bb638a5a9f3da9812fa4a85dda5..121459fdb47904d448f86362f535765c
|
||||
}
|
||||
|
||||
if (!state.isAir()) {
|
||||
@@ -116,6 +118,7 @@ public class LevelChunkSection {
|
||||
@@ -93,6 +95,7 @@ public class LevelChunkSection {
|
||||
|
||||
if (!fluid1.isEmpty()) {
|
||||
++this.tickingFluidCount;
|
||||
+ ++this.fluidStateCount; // Gale - Airplane - reduce entity fluid lookups if no fluids
|
||||
}
|
||||
|
||||
this.updateBlockCallback(x, y, z, iblockdata1, state); // Paper - optimise collisions
|
||||
@@ -162,6 +165,7 @@ public class LevelChunkSection {
|
||||
return iblockdata1;
|
||||
@@ -120,6 +123,7 @@ public class LevelChunkSection {
|
||||
public int nonEmptyBlockCount;
|
||||
public int tickingBlockCount;
|
||||
public int tickingFluidCount;
|
||||
+ public int fluidStateCount; // Gale - Airplane - reduce entity fluid lookups if no fluids
|
||||
|
||||
a(final LevelChunkSection chunksection) {}
|
||||
|
||||
@@ -138,6 +142,7 @@ public class LevelChunkSection {
|
||||
if (fluid.isRandomlyTicking()) {
|
||||
this.tickingFluidCount = (short) (this.tickingFluidCount + 1);
|
||||
this.tickingFluidCount += i;
|
||||
}
|
||||
+ this.fluidStateCount++; // Gale - Airplane - reduce entity fluid lookups if no fluids
|
||||
}
|
||||
|
||||
// Paper start - optimise collisions
|
||||
}
|
||||
@@ -149,6 +154,7 @@ public class LevelChunkSection {
|
||||
this.nonEmptyBlockCount = (short) a0.nonEmptyBlockCount;
|
||||
this.tickingBlockCount = (short) a0.tickingBlockCount;
|
||||
this.tickingFluidCount = (short) a0.tickingFluidCount;
|
||||
+ this.fluidStateCount = (short) a0.fluidStateCount; // Gale - Airplane - reduce entity fluid lookups if no fluids
|
||||
}
|
||||
|
||||
public PalettedContainer<BlockState> getStates() {
|
||||
@@ -13,7 +13,7 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 335cc8638d307fcd0dad44c431ec7f9d5376fc09..e2cc87a762c88a6360c265e66ed3bb0592eab2e3 100644
|
||||
index 8f97350aac2f19a0d19e35630261dacc7b46ce52..13d1908b378e5311d8bb7f9317b4b1c2d82ea042 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -73,6 +73,7 @@ tasks.withType<JavaCompile> {
|
||||
@@ -33,10 +33,10 @@ index 335cc8638d307fcd0dad44c431ec7f9d5376fc09..e2cc87a762c88a6360c265e66ed3bb05
|
||||
doFirst {
|
||||
workingDir.mkdirs()
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 2acad4c3fd58178b0f8b22bdb04eeeeb689d5afa..850ccd53c5007e8b18344ba76c9e7f0003decaff 100644
|
||||
index 16ecdf3c56809100032ca627a1769e4e8c452f08..f921771c0aeba72f3f208703dbf300e8748ded17 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -933,6 +933,46 @@ public class Metrics {
|
||||
@@ -928,6 +928,46 @@ public class Metrics {
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("gale_semantic_version", () -> semanticVersionMap));
|
||||
// Gale end - semantic version - include in metrics
|
||||
|
||||
@@ -84,10 +84,10 @@ index 2acad4c3fd58178b0f8b22bdb04eeeeb689d5afa..850ccd53c5007e8b18344ba76c9e7f00
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index e83db964c4016ed9252a76ff452eb5807a1d33cd..5bdcc501c8742b0e3e3c382c0ea5221c2b0d4982 100644
|
||||
index d42d6237831d500d0686b58abc4750896a1985c8..4fbdd8b1ead384762164c2d13180bfa230c40262 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -14,6 +14,8 @@ import java.util.Locale;
|
||||
@@ -20,6 +20,8 @@ import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.function.BooleanSupplier;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -96,7 +96,7 @@ index e83db964c4016ed9252a76ff452eb5807a1d33cd..5bdcc501c8742b0e3e3c382c0ea5221c
|
||||
import net.minecraft.DefaultUncaughtExceptionHandler;
|
||||
import net.minecraft.DefaultUncaughtExceptionHandlerWithName;
|
||||
import net.minecraft.SharedConstants;
|
||||
@@ -51,6 +53,7 @@ import net.minecraft.world.level.GameType;
|
||||
@@ -58,6 +60,7 @@ import net.minecraft.world.level.GameType;
|
||||
import net.minecraft.world.level.block.entity.SkullBlockEntity;
|
||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||
import org.galemc.gale.command.GaleCommands;
|
||||
@@ -104,7 +104,7 @@ index e83db964c4016ed9252a76ff452eb5807a1d33cd..5bdcc501c8742b0e3e3c382c0ea5221c
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -235,6 +238,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -244,6 +247,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
|
||||
@@ -22,7 +22,7 @@ you to easily disable books, should you want to preemptively remove this
|
||||
functionality before additional exploits are found.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 8e67853a7a93fa736c147e8b2df537746dc8e94f..cb3b10cc96c15a4894b3239110ee60f4aa130e05 100644
|
||||
index be2e97e4de911ad9570a9b4e9f3c5fafa93f6203..7ed1a93a7ecf993d2ee3825affa61be1d661dfc7 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -193,6 +193,8 @@ import net.minecraft.world.phys.Vec3;
|
||||
@@ -34,7 +34,7 @@ index 8e67853a7a93fa736c147e8b2df537746dc8e94f..cb3b10cc96c15a4894b3239110ee60f4
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1154,6 +1156,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1123,6 +1125,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
@Override
|
||||
public void handleEditBook(ServerboundEditBookPacket packet) {
|
||||
@@ -22,10 +22,10 @@ data is already available in the blockPosition struct, so we use that
|
||||
instead of re-doing the casting.
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
index d2ce6f2e78b3a8297a2a0b9752ed8140158e33f7..7287772498685c7ed4ffaeafb3e09aadafde5272 100644
|
||||
index 015a6463875b5ae46da0491b358adc568ac9a174..2429e743f8fcaa684dcdc0bd5774d82f0ea7f760 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
@@ -213,7 +213,7 @@ public final class MCUtil {
|
||||
@@ -197,7 +197,7 @@ public final class MCUtil {
|
||||
}
|
||||
|
||||
public static long getCoordinateKey(final Entity entity) {
|
||||
@@ -35,10 +35,10 @@ index d2ce6f2e78b3a8297a2a0b9752ed8140158e33f7..7287772498685c7ed4ffaeafb3e09aad
|
||||
|
||||
public static long getCoordinateKey(final ChunkPos pair) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 899cf208b8059600b364ae0d64b2a041620c3da3..ec36674769993816b22886d90a2f73e3e548917c 100644
|
||||
index 795f7ac6479648fbfc34a3eb2ff954202f27789e..9a8bcf6c11f885a711dff08dfa8f87d9f3deef54 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -311,7 +311,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -315,7 +315,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public double yo;
|
||||
public double zo;
|
||||
private Vec3 position;
|
||||
@@ -28,10 +28,10 @@ but is so much cheaper than the suffocation check that it's worth
|
||||
keeping it.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 05f9d4c9603247802b279976d56b25cd0cf83d3a..b095a5b4c2390bc3e52f8bb559c621ecb42db2c6 100644
|
||||
index 8676206457ec59bf711d3f4a2836ff47fea23bb6..6c0772f4bb5060d5c9649918257838594a582e65 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -425,7 +425,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -447,7 +447,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
boolean flag = this instanceof net.minecraft.world.entity.player.Player;
|
||||
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -43,7 +43,7 @@ index 05f9d4c9603247802b279976d56b25cd0cf83d3a..b095a5b4c2390bc3e52f8bb559c621ec
|
||||
this.hurt(this.damageSources().inWall(), 1.0F);
|
||||
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||
double d0 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
|
||||
@@ -1428,6 +1431,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1405,6 +1408,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.getHealth() <= 0.0F;
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@ launcher can very easily fill a chunk.
|
||||
Prevent saving Fireworks so that chunk unloads will wipe a chunks fireworks in this case.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
index 6671796d292fbc922a94271136f5a7a4bbdedaca..fe06ee24836f4f10e77a36c34c314464203e19d1 100644
|
||||
index 09d465947a5720e05c350d455c86002682104079..6c5f67138af166b87e588664b22198cbf3285c73 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
@@ -348,4 +348,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
||||
public static ItemStack getDefaultItem() {
|
||||
return new ItemStack(Items.FIREWORK_ROCKET);
|
||||
@@ -358,4 +358,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
||||
|
||||
return DoubleDoubleImmutablePair.of(d0, d1);
|
||||
}
|
||||
+
|
||||
+ // Gale start - EMC - make saving fireworks configurable
|
||||
@@ -13,7 +13,7 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/RandomizableContainer.java b/src/main/java/net/minecraft/world/RandomizableContainer.java
|
||||
index feb35fba0c56445ee910dbe1af9b36f21b4ec480..caf46a9b978c0cada8530142e6ccf8bb0f371c1c 100644
|
||||
index a9a80f8bc4a6f250fe3c20482c395058f024fabd..fb60f2a86ff387f46995b6aa71b65e1b56527623 100644
|
||||
--- a/src/main/java/net/minecraft/world/RandomizableContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/RandomizableContainer.java
|
||||
@@ -81,6 +81,7 @@ public interface RandomizableContainer extends Container {
|
||||
@@ -17,10 +17,10 @@ Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
Only do an item "suck in" action once per second
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 8fd3845c4965843be9c37498760d93f1ebdff541..8a5cbe95022a3ae41283f4f884d8b2f7eae0cd34 100644
|
||||
index ea0d9335446b20073b9aafb9de453097355db79c..c1bb44fd92ee4f3b900f29e3f9069841ca19fa5d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -22,11 +22,13 @@ import net.minecraft.world.entity.EntityType;
|
||||
@@ -22,12 +22,14 @@ import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.MoverType;
|
||||
import net.minecraft.world.entity.SlotAccess;
|
||||
import net.minecraft.world.entity.TraceableEntity;
|
||||
@@ -30,11 +30,12 @@ index 8fd3845c4965843be9c37498760d93f1ebdff541..8a5cbe95022a3ae41283f4f884d8b2f7
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.level.portal.DimensionTransition;
|
||||
+import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
// CraftBukkit start
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -234,11 +236,31 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -235,11 +237,31 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
@@ -66,7 +67,7 @@ index 8fd3845c4965843be9c37498760d93f1ebdff541..8a5cbe95022a3ae41283f4f884d8b2f7
|
||||
// Spigot start - copied from above
|
||||
@Override
|
||||
public void inactiveTick() {
|
||||
@@ -258,7 +280,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -259,7 +281,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
@@ -119,7 +120,7 @@ index 5f042e294db605827000123252b0df646968f897..e1cc15f28fe8da23b74ff4504c5b2da2
|
||||
|
||||
double getLevelY();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
index 55a5fad40f39b467ba933b2e0778998a54dbb8b2..21a1a880d49db917528d919ef7dd5cabbc8e2568 100644
|
||||
index 8310d132006043e93c612890514c4c7f3eb1c74d..59ab63dd7352abc47575daa3e829832a4793ea3f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.core.NonNullList;
|
||||
@@ -138,7 +139,7 @@ index 55a5fad40f39b467ba933b2e0778998a54dbb8b2..21a1a880d49db917528d919ef7dd5cab
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.HopperMenu;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
@@ -589,7 +591,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -563,7 +565,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
} else {
|
||||
boolean flag = hopper.isGridAligned() && iblockdata.isCollisionShapeFullBlock(world, blockposition) && !iblockdata.is(BlockTags.DOES_NOT_BLOCK_HOPPERS);
|
||||
|
||||
@@ -147,7 +148,7 @@ index 55a5fad40f39b467ba933b2e0778998a54dbb8b2..21a1a880d49db917528d919ef7dd5cab
|
||||
Iterator iterator = HopperBlockEntity.getItemsAtAndAbove(world, hopper).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -898,6 +900,31 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -872,6 +874,31 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
return first.getCount() < first.getMaxStackSize() && ItemStack.isSameItemSameComponents(first, second); // Paper - Perf: Optimize Hoppers; used to return true for full itemstacks?!
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ index 28afbf8da166377b295302e6ea7c602da70100b1..f8a561d91686d6df89a7374ca223972e
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 4fd7512106eb3aa63001ab4617e499d043fb6057..5ecdc3b51baae26edbcdc76ed3bb0f806ef31555 100644
|
||||
index f83c2b35cc279666686be3af558473b5d93bf7cd..86b678aa745e125ceaa271deec00d6290a02d88b 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -38,6 +38,7 @@ import co.aikar.timings.MinecraftTimings;
|
||||
@@ -13,10 +13,10 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 1f5223c3f152e8d3f21e59f282ccede8c35346c0..a5aefd1224b8cd6957a0a9654075fa06c6a69d99 100644
|
||||
index 3d1aff8318620bc87a439e095bc1d06e4dafbba1..79b49aec7c5c80948b8f1c77ca6e48049dae174e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -292,6 +292,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -295,6 +295,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
public boolean joining = true;
|
||||
public boolean sentListPacket = false;
|
||||
public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready
|
||||
@@ -25,11 +25,11 @@ index 1f5223c3f152e8d3f21e59f282ccede8c35346c0..a5aefd1224b8cd6957a0a9654075fa06
|
||||
public boolean isRealPlayer; // Paper
|
||||
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 94c5da09a691904fbab82c5b5ed5dd94d33b7021..c45e8cb4dd627023c31f8bd87455ed07aa9feb36 100644
|
||||
index 7ed1a93a7ecf993d2ee3825affa61be1d661dfc7..bb143cc9bfe8ee0302955ed61c876eace149f9ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2340,7 +2340,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper
|
||||
@@ -2284,7 +2284,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.disconnect((Component) Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper
|
||||
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
|
||||
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
|
||||
- } else {
|
||||
@@ -38,7 +38,7 @@ index 94c5da09a691904fbab82c5b5ed5dd94d33b7021..c45e8cb4dd627023c31f8bd87455ed07
|
||||
// CraftBukkit start
|
||||
if (sync) {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index a2142930b4d4b05987c90496fb9d733d99040aa0..523f183f2a8b8f97088eab57f9b28e777b93bef0 100644
|
||||
index 0d0b07c9199be9ca0d5ac3feb1d44f149ba69283..6aa5713fb0794a56985630c4616afdf5728d98d7 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -350,6 +350,8 @@ public abstract class PlayerList {
|
||||
@@ -13,7 +13,7 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
index f890738d3bb9fb5e70a9d323c6cec97f9948f9cf..8e9f4b1a7f0fe6df4e3d0796cef99db439f25bba 100644
|
||||
index fb7342f7a5008a283c3400c6313c637de8210dfa..a45353b8a6dd85c74d3e195f89f75f2509d579ad 100644
|
||||
--- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
+++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
@@ -36,6 +36,7 @@ import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 1e1e25ef913d0f3ac2fe2a6e0f1238480680ce61..59b157545b562ea94ffbc42c8174f4c573d79399 100644
|
||||
index bb143cc9bfe8ee0302955ed61c876eace149f9ca..d3319dcb15ee727b42d3bc09e06793cf728f1c6b 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -194,6 +194,7 @@ import net.minecraft.world.phys.shapes.BooleanOp;
|
||||
@@ -18,7 +18,7 @@ index 1e1e25ef913d0f3ac2fe2a6e0f1238480680ce61..59b157545b562ea94ffbc42c8174f4c5
|
||||
import org.galemc.gale.configuration.GaleGlobalConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -2498,7 +2499,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -2442,7 +2443,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
// CraftBukkit start
|
||||
String s = message.signedContent();
|
||||
if (s.isEmpty()) {
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
index f655e0ae4a287886d0291cd0089bad2000249d0f..e15409231e56f5bbbfbcd19cea2c7e3fbc612886 100644
|
||||
index 9fabf9322acd663c4452b562494e74aa42eb19da..749dbb091af02c2e5922de14fc2743b7649f2928 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
@@ -45,6 +45,7 @@ import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -37,24 +37,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
index 1351423a12c19a01f602a202832372a399e6a867..59b7d9c9a2a0203f8135a9dcdce302bbf0b2d0f4 100644
|
||||
index 5a8a33638ceb1d980ffc3e6dd86e7eb11dfd9375..4ec094e06e7707a052f3647871f7d14183e8978f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
@@ -58,6 +58,7 @@ import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.ticks.LevelTickAccess;
|
||||
import net.minecraft.world.ticks.WorldGenTickAccess;
|
||||
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class WorldGenRegion implements WorldGenLevel {
|
||||
@@ -326,6 +327,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
@@ -336,6 +336,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
return true;
|
||||
} else {
|
||||
// Paper start - Buffer OOB setBlock calls
|
||||
+ if (GaleGlobalConfiguration.get().logToConsole.setBlockInFarChunk) // Gale - Purpur - do not log setBlock in far chunks
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.setBlockInFarChunk) // Gale - Purpur - do not log setBlock in far chunks
|
||||
if (!hasSetFarWarned) {
|
||||
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
||||
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStep.targetStatus()) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
||||
hasSetFarWarned = true;
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
index 9c8c283aa88165d862c649b22fd86e61ec8e84d7..281d01126f623d0541b1676bf79bf1dd3020d250 100644
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/stats/ServerRecipeBook.java b/src/main/java/net/minecraft/stats/ServerRecipeBook.java
|
||||
index 4103ddf16164e3992fef0765d368282572537e29..191ea4a7b4c034c7c370b9b8ef78ddae31b78cbf 100644
|
||||
index 8a2584deccbf19de8a18fcfcb9c65318b60afe57..457d774dbfd441abfb108e0a11e675fadcd55092 100644
|
||||
--- a/src/main/java/net/minecraft/stats/ServerRecipeBook.java
|
||||
+++ b/src/main/java/net/minecraft/stats/ServerRecipeBook.java
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
index 62f4835309df2b2deeb799609f9b1b325bf58af3..2885788f0ae37474dfab5f51908e290a5f972206 100644
|
||||
index dc591702d1ad41209bb80e8d05f4ca11f20816f2..38a5b11d52ffcd1e3f7ffe8d617e7d3fd93f07c6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
@@ -31,6 +31,7 @@ import org.bukkit.Material;
|
||||
@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
index e83f9517b31c5171b8dc75ab63a5bfe654221c84..8b95af95976309f31eb2493049a6a7440c505608 100644
|
||||
index 14e412ebf75b0e06ab53a1c8f9dd1be6ad1e2680..f962e82e2c70f328a23dc99193d072f8dd7ad949 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||
@@ -44,6 +44,8 @@ import org.bukkit.event.player.PlayerChatEvent;
|
||||
@@ -29,7 +29,7 @@ index e83f9517b31c5171b8dc75ab63a5bfe654221c84..8b95af95976309f31eb2493049a6a744
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 523f183f2a8b8f97088eab57f9b28e777b93bef0..6931003ca7808fddccd648a3eb2dc41b38ec97bd 100644
|
||||
index 6aa5713fb0794a56985630c4616afdf5728d98d7..e7ca46e90da96354d132a483f2d45a91d121830b 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -102,6 +102,7 @@ import net.minecraft.world.phys.Vec3;
|
||||
@@ -40,7 +40,7 @@ index 523f183f2a8b8f97088eab57f9b28e777b93bef0..6931003ca7808fddccd648a3eb2dc41b
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1432,7 +1433,7 @@ public abstract class PlayerList {
|
||||
@@ -1372,7 +1373,7 @@ public abstract class PlayerList {
|
||||
// Paper end
|
||||
boolean flag = this.verifyChatTrusted(message);
|
||||
|
||||
@@ -17,10 +17,10 @@ Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
This can help to hide annoying scanning bots from showing up in console.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 765cf12c1558afd9686793b18388fc229c55d2d8..857ea8d6fe72a1ef2094121f49db4a359e9e2080 100644
|
||||
index b0f7a378f19b9837c060c891002cd5db756cdae1..22865e638a50397d194fb39b883f73753de1f7f0 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -42,6 +42,7 @@ import net.minecraft.util.CryptException;
|
||||
@@ -44,6 +44,7 @@ import net.minecraft.util.CryptException;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.util.StringUtil;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
@@ -28,10 +28,10 @@ index 765cf12c1558afd9686793b18388fc229c55d2d8..857ea8d6fe72a1ef2094121f49db4a35
|
||||
import org.slf4j.Logger;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.PacketUtils;
|
||||
@@ -154,6 +155,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -141,6 +142,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
|
||||
@Override
|
||||
public void onDisconnect(Component reason) {
|
||||
public void disconnect(Component reason) {
|
||||
try {
|
||||
+ // Gale start - Pufferfish - do not log disconnections with null id
|
||||
+ if (!GaleGlobalConfiguration.get().logToConsole.nullIdDisconnections && this.authenticatedProfile != null && this.authenticatedProfile.getId() == null) {
|
||||
+ var reasonString = reason.getString();
|
||||
@@ -40,9 +40,9 @@ index 765cf12c1558afd9686793b18388fc229c55d2d8..857ea8d6fe72a1ef2094121f49db4a35
|
||||
+ }
|
||||
+ }
|
||||
+ // Gale end - Pufferfish - do not log disconnections with null id
|
||||
ServerLoginPacketListenerImpl.LOGGER.info("{} lost connection: {}", this.getUserName(), reason.getString());
|
||||
}
|
||||
|
||||
ServerLoginPacketListenerImpl.LOGGER.info("Disconnecting {}: {}", this.getUserName(), reason.getString());
|
||||
this.connection.send(new ClientboundLoginDisconnectPacket(reason));
|
||||
this.connection.disconnect(reason);
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
index 0f5471291c482bd2b8ecc588da74a408563b7312..d95141f43ebbad984db96416623957bd47f3ac1b 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
@@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 28412943a1ce919da3c8731a441b5a1b3b893293..005890e25a3f5fe34027239633646a662eba32bb 100644
|
||||
index 4fbdd8b1ead384762164c2d13180bfa230c40262..bbf842eee5b67d8211f0af215f9c331c456d864d 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -192,7 +192,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -201,7 +201,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
}
|
||||
|
||||
// Paper start - detect running as root
|
||||
@@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 4f9fb7c75dc12c8c9d88e18c7c4749cad9545cc6..8c74652ffa2c1263c835381bc27ffdc6d272dbf7 100644
|
||||
index bbf842eee5b67d8211f0af215f9c331c456d864d..7ccdc35b40feb48fd737e96e868124fec03d5ef2 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -303,7 +303,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -312,7 +312,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
||||
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
||||
// Paper end - Add Velocity IP Forwarding Support
|
||||
@@ -13,14 +13,10 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/PoolElementStructurePiece.java b/src/main/java/net/minecraft/world/level/levelgen/structure/PoolElementStructurePiece.java
|
||||
index 608cfb0db7bb14611f6cdcb55d9701a55d882e9d..64ee66ba5e3340ac10f060d950f3515ac893bd55 100644
|
||||
index 0977cd0d65dd1c2dde04d318759458abe452847e..ee5b317e87c4d403b6d7f5ab1d493e446f9278f6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/PoolElementStructurePiece.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/PoolElementStructurePiece.java
|
||||
@@ -22,10 +22,11 @@ import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
|
||||
import net.minecraft.world.level.levelgen.structure.pools.JigsawJunction;
|
||||
import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElement;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
|
||||
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class PoolElementStructurePiece extends StructurePiece {
|
||||
@@ -29,15 +25,15 @@ index 608cfb0db7bb14611f6cdcb55d9701a55d882e9d..64ee66ba5e3340ac10f060d950f3515a
|
||||
protected final StructurePoolElement element;
|
||||
protected BlockPos position;
|
||||
private final int groundLevelDelta;
|
||||
@@ -57,7 +58,7 @@ public class PoolElementStructurePiece extends StructurePiece {
|
||||
@@ -80,7 +80,7 @@ public class PoolElementStructurePiece extends StructurePiece {
|
||||
DynamicOps<Tag> dynamicOps = context.registryAccess().createSerializationContext(NbtOps.INSTANCE);
|
||||
this.element = StructurePoolElement.CODEC
|
||||
.parse(dynamicOps, nbt.getCompound("pool_element"))
|
||||
StructurePoolElement.CODEC
|
||||
.encodeStart(dynamicOps, this.element)
|
||||
- .resultOrPartial(LOGGER::error)
|
||||
+ .resultOrPartial(GaleGlobalConfiguration.get().logToConsole.invalidPoolElementErrorStringConsumer) // Gale - EMC - softly log invalid pool element errors
|
||||
.orElseThrow(() -> new IllegalStateException("Invalid pool element found"));
|
||||
this.rotation = Rotation.valueOf(nbt.getString("rotation"));
|
||||
this.boundingBox = this.element.getBoundingBox(this.structureTemplateManager, this.position, this.rotation);
|
||||
+ .resultOrPartial(org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidPoolElementErrorStringConsumer) // Gale - EMC - softly log invalid pool element errors
|
||||
.ifPresent(poolElement -> nbt.put("pool_element", poolElement));
|
||||
nbt.putString("rotation", this.rotation.name());
|
||||
ListTag listTag = new ListTag();
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
index d95141f43ebbad984db96416623957bd47f3ac1b..ea7f6a826763af8aa10d79e82b9ba99198e31e06 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
@@ -38,10 +38,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
index e5006e7672ba79ed4bcf2c4173c5a9ed4c68395b..cd0971429ae679311269004ffde8743c9ddcef6b 100644
|
||||
index 385457c7151f7e636e1ea2e38ef983f4f532b9b5..1df9048cad66afa3706e960d627ee33e52a58541 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
@@ -153,6 +153,10 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||
@@ -154,6 +154,10 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||
this.connection.send(new ClientboundStatusResponsePacket(ping));
|
||||
// CraftBukkit end
|
||||
*/
|
||||
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||
index 6f22705072fecbe91196e4966fca2eeec060f120..d7d98386f6458ea00b88acdabb8ba70caf543783 100644
|
||||
index c9cabb061ebc9172647304431cc3fb2593dd47ba..68375718c4c9ba46439e49cd82a5267aab150f97 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||
@@ -72,6 +72,6 @@ public abstract class WaterAnimal extends PathfinderMob {
|
||||
@@ -71,6 +71,6 @@ public abstract class WaterAnimal extends PathfinderMob {
|
||||
i = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.maximum.or(i);
|
||||
j = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.minimum.or(j);
|
||||
// Paper end - Make water animal spawn height configurable
|
||||
@@ -19,10 +19,10 @@ the displayed hunger bar never goes down. Hunger (or any related value, includin
|
||||
should not go down on peaceful. See https://bugs.mojang.com/browse/MC-31819.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 72b3e64cf6d184e90a6e2c0d822b83312312d67d..f4f45fa391c36f66abdf1c16c0f3e31f5dda1c1a 100644
|
||||
index 0526f4c701b4d945f26c5f382e9efac86cc568fa..e513e17f460927fcffd029bb3b3357ca85aa514d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1893,6 +1893,11 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1908,6 +1908,11 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
|
||||
public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) {
|
||||
@@ -12,8 +12,21 @@ By: etil2jz <81570777+etil2jz@users.noreply.github.com>
|
||||
As part of: Mirai (https://github.com/etil2jz/Mirai)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/resources/ResourceLocation.java b/src/main/java/net/minecraft/resources/ResourceLocation.java
|
||||
index 1967c43ee3a12e63365cc40ee6565307e2fd73cf..8e478ce995cb4b3b33da68396ebaea5240800cb2 100644
|
||||
--- a/src/main/java/net/minecraft/resources/ResourceLocation.java
|
||||
+++ b/src/main/java/net/minecraft/resources/ResourceLocation.java
|
||||
@@ -36,7 +36,7 @@ public final class ResourceLocation implements Comparable<ResourceLocation> {
|
||||
private final String namespace;
|
||||
private final String path;
|
||||
|
||||
- private ResourceLocation(String namespace, String path) {
|
||||
+ private ResourceLocation(String namespace, String path) { // Gale start - Mirai - fix MC-26304 - private -> public
|
||||
assert isValidNamespace(namespace);
|
||||
|
||||
assert isValidPath(path);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
index 887957ce1ddc2f32569405642f35df468c08271f..fa78fcbdcada06a772e1e21a58125a849c515a62 100644
|
||||
index a2fafef89d5354e2cb02f5672810909950a57777..c785362f145dd9605bc01bd3b8b8118f71404d8f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.core.BlockPos;
|
||||
@@ -32,16 +45,16 @@ index 887957ce1ddc2f32569405642f35df468c08271f..fa78fcbdcada06a772e1e21a58125a84
|
||||
private NonNullList<ItemStack> items;
|
||||
public int brewTime;
|
||||
private boolean[] lastPotionCount;
|
||||
@@ -299,6 +301,22 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
||||
ContainerHelper.loadAllItems(nbt, this.items, registryLookup);
|
||||
this.brewTime = nbt.getShort("BrewTime");
|
||||
@@ -303,6 +305,22 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
||||
}
|
||||
|
||||
this.fuel = nbt.getByte("Fuel");
|
||||
+ // Gale start - Mirai - fix MC-26304
|
||||
+ if (this.ingredient == null || this.ingredient == Items.AIR) {
|
||||
+ for (String nbtKey : INGREDIENT_NBT_KEYS) {
|
||||
+ try {
|
||||
+ if (nbt.contains(nbtKey)) {
|
||||
+ this.ingredient = BuiltInRegistries.ITEM.get(new net.minecraft.resources.ResourceLocation(nbt.getString(nbtKey)));
|
||||
+ this.ingredient = BuiltInRegistries.ITEM.get(net.minecraft.resources.ResourceLocation.tryParse(nbt.getString(nbtKey)));
|
||||
+ if (this.ingredient != null && this.ingredient != Items.AIR) {
|
||||
+ break;
|
||||
+ }
|
||||
@@ -55,7 +68,7 @@ index 887957ce1ddc2f32569405642f35df468c08271f..fa78fcbdcada06a772e1e21a58125a84
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -307,6 +325,18 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
||||
@@ -311,6 +329,18 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
||||
nbt.putShort("BrewTime", (short) this.brewTime);
|
||||
ContainerHelper.saveAllItems(nbt, this.items, registryLookup);
|
||||
nbt.putByte("Fuel", (byte) this.fuel);
|
||||
@@ -42,10 +42,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
index 31b8a8bf78d52b5f11b68e780ec09bf78e7bda84..7f99fe3ea54c6b39584a73d1931100193ac09cbd 100644
|
||||
index ddf47dab1ab92c45e3eea09239d418a9798ed59e..95ac8f4af849523e25b95b624d59f9f5ae5877b4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -332,7 +332,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
@@ -356,7 +356,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
Vec3 vec3d = this.getDeltaMovement();
|
||||
|
||||
this.setDeltaMovement(vec3d.multiply((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F)));
|
||||
@@ -54,11 +54,34 @@ index 31b8a8bf78d52b5f11b68e780ec09bf78e7bda84..7f99fe3ea54c6b39584a73d193110019
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java.rej b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java.rej
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..835eb6436cd0d2b9698abd879c3d04e86d790ea3
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java.rej
|
||||
@@ -0,0 +1,9 @@
|
||||
+diff a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java (rejected hunks)
|
||||
+@@ -167,6 +167,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
+
|
||||
+ public static void teleportEntity(Level world, BlockPos pos, BlockState state, Entity entity, TheEndGatewayBlockEntity blockEntity) {
|
||||
+ if (world instanceof ServerLevel worldserver && !blockEntity.isCoolingDown()) {
|
||||
++ if (entity.level().galeConfig().gameplayMechanics.fixes.checkCanChangeDimensionsBeforeUseEndGateway && world.galeConfig().gameplayMechanics.fixes.checkCanChangeDimensionsBeforeUseEndGateway && !entity.canChangeDimensions()) return; // Gale - Purpur - end gateway should check if entity can use portal
|
||||
+ blockEntity.teleportCooldown = 100;
|
||||
+ BlockPos blockposition1;
|
||||
+
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
index 56bf02a1f9741fc1c05ede0c0c79fea97d46271b..0f205f02ce0553fb1f8db8aa903861102a570708 100644
|
||||
index 7f9c5012defeac5ae558e46d8fca6889fb1d0872..0f205f02ce0553fb1f8db8aa903861102a570708 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
@@ -124,6 +124,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
||||
@@ -100,6 +100,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
||||
public class Fixes extends ConfigurationPart {
|
||||
|
||||
public boolean keepMooshroomRotationAfterShearing = true; // Gale - Purpur - fix cow rotation when shearing mooshroom
|
||||
+ public boolean checkCanChangeDimensionsBeforeUseEndGateway = false; // Gale - Purpur - end gateway should check if entity can use portal
|
||||
|
||||
// Gale start - Purpur - fix MC-238526
|
||||
@Setting("mc-238526")
|
||||
@@ -123,6 +124,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
|
||||
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 6931003ca7808fddccd648a3eb2dc41b38ec97bd..73115d3afe723faadf487e235e965c392011929c 100644
|
||||
index e7ca46e90da96354d132a483f2d45a91d121830b..fa4ca096dfd3afe8868b76a8576f0f2882f139ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -489,7 +489,13 @@ public abstract class PlayerList {
|
||||
@@ -483,7 +483,13 @@ public abstract class PlayerList {
|
||||
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
|
||||
}
|
||||
// Paper end - Configurable player collision
|
||||
@@ -13,10 +13,10 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index ec36674769993816b22886d90a2f73e3e548917c..b97253a6b43d4db39c22ae16b7e75bd95fb9d958 100644
|
||||
index 9a8bcf6c11f885a711dff08dfa8f87d9f3deef54..a5e51025e6c2d5fea903b7c1d950ba430966d36d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -310,7 +310,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -314,7 +314,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public double xo;
|
||||
public double yo;
|
||||
public double zo;
|
||||
@@ -25,7 +25,7 @@ index ec36674769993816b22886d90a2f73e3e548917c..b97253a6b43d4db39c22ae16b7e75bd9
|
||||
public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public
|
||||
private ChunkPos chunkPosition;
|
||||
private Vec3 deltaMovement;
|
||||
@@ -2072,9 +2072,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1927,9 +1927,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public float getLightLevelDependentMagicValue() {
|
||||
@@ -34,7 +34,9 @@ index ec36674769993816b22886d90a2f73e3e548917c..b97253a6b43d4db39c22ae16b7e75bd9
|
||||
}
|
||||
|
||||
+ // Gale start - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
||||
+ /** @deprecated */
|
||||
+ /**
|
||||
+ * @deprecated
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ public float getLightLevelDependentMagicValue(BlockPos pos) {
|
||||
+ return this.level().hasChunkAt(this.getBlockX(), this.getBlockZ()) ? this.level.getLightLevelDependentMagicValue(pos) : 0.0F;
|
||||
@@ -43,14 +45,14 @@ index ec36674769993816b22886d90a2f73e3e548917c..b97253a6b43d4db39c22ae16b7e75bd9
|
||||
+
|
||||
public void absMoveTo(double x, double y, double z, float yaw, float pitch) {
|
||||
this.absMoveTo(x, y, z);
|
||||
this.setYRot(yaw % 360.0F);
|
||||
this.absRotateTo(yaw, pitch);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index f0196c364934894e6fba98de8d8dcbf09d3644b8..2d91941eb780de588202113700f68cca853eb62b 100644
|
||||
index 2a25238dcd741f9a5d16b202902210244d9a1947..316d1ef3975aab5565078dad11a8f4ca8133c836 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1817,13 +1817,29 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||
return flag;
|
||||
}
|
||||
@@ -1724,13 +1724,29 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
|
||||
protected void playAttackSound() {}
|
||||
|
||||
+ // Gale start - JettPack - optimize sun burn tick - cache eye blockpos
|
||||
+ private BlockPos cached_eye_blockpos;
|
||||
@@ -33,37 +33,19 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRA
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
index 45a2683c9489bee6d67a1f3d702c17f2e9dc02e4..8e90f35218e66690359dac35828a1485a77f34c1 100644
|
||||
index ddf42645402afefc0f5caebc684b191eef9d6ec2..a1e39d4476e932da3d4e0c363ce22eb5be2b8e6c 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.server.network;
|
||||
|
||||
+import it.unimi.dsi.fastutil.objects.Object2LongMap;
|
||||
+import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -14,7 +16,8 @@ import net.minecraft.server.MinecraftServer;
|
||||
|
||||
// CraftBukkit start
|
||||
import java.net.InetAddress;
|
||||
-import java.util.HashMap;
|
||||
+import java.util.Iterator;
|
||||
+import java.util.Map;
|
||||
// CraftBukkit end
|
||||
|
||||
public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketListener {
|
||||
@@ -25,7 +28,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
@@ -26,7 +26,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
static final java.util.regex.Pattern PROP_PATTERN = java.util.regex.Pattern.compile("\\w{0,16}");
|
||||
// Spigot end
|
||||
// CraftBukkit start - add fields
|
||||
- private static final HashMap<InetAddress, Long> throttleTracker = new HashMap<InetAddress, Long>();
|
||||
+ private static final Object2LongOpenHashMap<InetAddress> throttleTracker = new Object2LongOpenHashMap<>(); // Gale - Dionysus - replace throttle tracker map with optimized collection
|
||||
+ private static final it.unimi.dsi.fastutil.objects.Object2LongMap<InetAddress> throttleTracker = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>(); // Gale - Dionysus - replace throttle tracker map with optimized collection
|
||||
private static int throttleCounter = 0;
|
||||
// CraftBukkit end
|
||||
private static final Component IGNORE_STATUS_REASON = Component.translatable("disconnect.ignoring_status_request");
|
||||
@@ -86,7 +89,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
@@ -87,7 +87,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
InetAddress address = ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getAddress();
|
||||
|
||||
synchronized (ServerHandshakePacketListenerImpl.throttleTracker) {
|
||||
@@ -72,7 +54,7 @@ index 45a2683c9489bee6d67a1f3d702c17f2e9dc02e4..8e90f35218e66690359dac35828a1485
|
||||
ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime);
|
||||
Component chatmessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.connectionThrottle); // Paper - Configurable connection throttle kick message
|
||||
this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
|
||||
@@ -100,13 +103,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
@@ -101,13 +101,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
ServerHandshakePacketListenerImpl.throttleCounter = 0;
|
||||
|
||||
// Cleanup stale entries
|
||||
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index cf8b8c8efd1c9c81eb5f02d75bd75875eb66771f..d195687595d021423478d8e339659b2c0ec9c7e0 100644
|
||||
index 45704653310efe9cb755a644674b54b8722c2c84..dbfee1647c564e833eb23a3b90ad0f1cb78edfb5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -603,11 +603,18 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -600,11 +600,18 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
private final BlockState first;
|
||||
private final BlockState second;
|
||||
private final Direction direction;
|
||||
@@ -35,7 +35,7 @@ index cf8b8c8efd1c9c81eb5f02d75bd75875eb66771f..d195687595d021423478d8e339659b2c
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
@@ -623,11 +630,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -620,11 +627,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
@@ -13,27 +13,22 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/CubeVoxelShape.java b/src/main/java/net/minecraft/world/phys/shapes/CubeVoxelShape.java
|
||||
index b9af1d14c7815c99273bce8165cf384d669c1a75..93cc8fed22e21f45722f6de30a197b2aaacb1f44 100644
|
||||
index d812949c7329ae2696b38dc792fa011ba87decb9..746e9e280eb47356475484eb1f658c0728cd65cf 100644
|
||||
--- a/src/main/java/net/minecraft/world/phys/shapes/CubeVoxelShape.java
|
||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/CubeVoxelShape.java
|
||||
@@ -3,8 +3,13 @@ package net.minecraft.world.phys.shapes;
|
||||
import it.unimi.dsi.fastutil.doubles.DoubleList;
|
||||
import net.minecraft.core.Direction;
|
||||
@@ -5,13 +5,24 @@ import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.Mth;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public final class CubeVoxelShape extends VoxelShape {
|
||||
+
|
||||
+ private @NotNull DoubleList @Nullable [] list; // Gale - Lithium - cache CubeVoxelShape shape array
|
||||
+ private @org.jetbrains.annotations.NotNull DoubleList @org.jetbrains.annotations.Nullable [] list; // Gale - Lithium - cache CubeVoxelShape shape array
|
||||
+
|
||||
protected CubeVoxelShape(DiscreteVoxelShape voxels) {
|
||||
super(voxels);
|
||||
this.initCache(); // Paper - optimise collisions
|
||||
@@ -12,7 +17,15 @@ public final class CubeVoxelShape extends VoxelShape {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DoubleList getCoords(Direction.Axis axis) {
|
||||
public DoubleList getCoords(Direction.Axis axis) {
|
||||
- return new CubePointRange(this.shape.getSize(axis));
|
||||
+ // Gale start - Lithium - cache CubeVoxelShape shape array
|
||||
+ if (this.list == null) {
|
||||
@@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java b/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java
|
||||
index a544db042c8d2ecec8d323770552c4f10ca758a6..e7bffb7f757dbeac255676823de6464329f2f535 100644
|
||||
index ad02cdb00360165f6405eb3044bd8320f01a7ef1..0b6f3fca7e7b8f2f7cfa0c8f01068f234888f66d 100644
|
||||
--- a/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java
|
||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java
|
||||
@@ -4,6 +4,7 @@ import it.unimi.dsi.fastutil.doubles.AbstractDoubleList;
|
||||
@@ -22,7 +22,7 @@ index a544db042c8d2ecec8d323770552c4f10ca758a6..e7bffb7f757dbeac255676823de64643
|
||||
private final int parts;
|
||||
+ private final double scale; // Gale - Lithium - replace division by multiplication in CubePointRange
|
||||
|
||||
CubePointRange(int sectionCount) {
|
||||
public CubePointRange(int sectionCount) {
|
||||
if (sectionCount <= 0) {
|
||||
@@ -11,10 +12,11 @@ public class CubePointRange extends AbstractDoubleList {
|
||||
} else {
|
||||
@@ -7,7 +7,7 @@ License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java b/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java
|
||||
index e7bffb7f757dbeac255676823de6464329f2f535..55d4160b6bf9718d475e4bc7cecf048d62e00b82 100644
|
||||
index 0b6f3fca7e7b8f2f7cfa0c8f01068f234888f66d..2ac87dfb3d9756c0bf63d5a81470efad5b826371 100644
|
||||
--- a/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java
|
||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/CubePointRange.java
|
||||
@@ -3,14 +3,14 @@ package net.minecraft.world.phys.shapes;
|
||||
@@ -18,7 +18,7 @@ index e7bffb7f757dbeac255676823de6464329f2f535..55d4160b6bf9718d475e4bc7cecf048d
|
||||
+ private final int size; // Gale - replace parts by size in CubePointRange
|
||||
private final double scale; // Gale - Lithium - replace division by multiplication in CubePointRange
|
||||
|
||||
CubePointRange(int sectionCount) {
|
||||
public CubePointRange(int sectionCount) {
|
||||
if (sectionCount <= 0) {
|
||||
throw new IllegalArgumentException("Need at least 1 part");
|
||||
} else {
|
||||
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 70f1aec3e396561b111696b7ddc31ce848702671..4c35356e5a0f5901e640ca0657c0b92d29be766e 100644
|
||||
index 6c0772f4bb5060d5c9649918257838594a582e65..b7c02647d7d143e2462057792bafed96648973d7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -594,11 +594,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -565,11 +565,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
protected void tryAddFrost() {
|
||||
@@ -29,9 +29,9 @@ index 70f1aec3e396561b111696b7ddc31ce848702671..4c35356e5a0f5901e640ca0657c0b92d
|
||||
|
||||
if (attributemodifiable == null) {
|
||||
return;
|
||||
@@ -608,7 +607,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -579,7 +578,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADD_VALUE));
|
||||
attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_ID, (double) f, AttributeModifier.Operation.ADD_VALUE));
|
||||
}
|
||||
- }
|
||||
|
||||
@@ -214,7 +214,7 @@ index 0000000000000000000000000000000000000000..349618b7f544bf9a30e0796d4d9a2640
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/util/BitStorage.java b/src/main/java/net/minecraft/util/BitStorage.java
|
||||
index 8bafd5fd7499ba4a04bf706cfd1e156073716e21..b7df9eac4ee23fa489368af82ec9c07dea6ebd75 100644
|
||||
index 68648c5a5e3ff079f832092af0f2f801c42d1ede..5a85e499aeb02885cab5ba7d571d6f6ae470bce8 100644
|
||||
--- a/src/main/java/net/minecraft/util/BitStorage.java
|
||||
+++ b/src/main/java/net/minecraft/util/BitStorage.java
|
||||
@@ -1,6 +1,7 @@
|
||||
@@ -225,15 +225,15 @@ index 8bafd5fd7499ba4a04bf706cfd1e156073716e21..b7df9eac4ee23fa489368af82ec9c07d
|
||||
|
||||
public interface BitStorage {
|
||||
int getAndSet(int index, int value);
|
||||
@@ -31,4 +32,6 @@ public interface BitStorage {
|
||||
@@ -20,4 +21,6 @@ public interface BitStorage {
|
||||
void unpack(int[] out);
|
||||
|
||||
}
|
||||
// Paper end
|
||||
BitStorage copy();
|
||||
+
|
||||
+ <T> void compact(Palette<T> srcPalette, Palette<T> dstPalette, short[] out); // Gale - Lithium - faster chunk serialization
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/util/SimpleBitStorage.java b/src/main/java/net/minecraft/util/SimpleBitStorage.java
|
||||
index 8d7d763bf51cac556057645e6169c9447993189b..7846273b7e3519ad276373d8a2066856473b9e69 100644
|
||||
index 9f438d9c6eb05e43d24e4af68188a3d4c46a938c..0af2e2cc59db228e01afa880f83c2024dade4ff0 100644
|
||||
--- a/src/main/java/net/minecraft/util/SimpleBitStorage.java
|
||||
+++ b/src/main/java/net/minecraft/util/SimpleBitStorage.java
|
||||
@@ -2,6 +2,7 @@ package net.minecraft.util;
|
||||
@@ -244,7 +244,7 @@ index 8d7d763bf51cac556057645e6169c9447993189b..7846273b7e3519ad276373d8a2066856
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
public class SimpleBitStorage implements BitStorage {
|
||||
@@ -389,4 +390,45 @@ public class SimpleBitStorage implements BitStorage {
|
||||
@@ -367,4 +368,45 @@ public class SimpleBitStorage implements BitStorage {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -291,23 +291,15 @@ index 8d7d763bf51cac556057645e6169c9447993189b..7846273b7e3519ad276373d8a2066856
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/util/ZeroBitStorage.java b/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
||||
index f1b8e746fea603ebadcef7aff1b83677fea32137..5ca2190235bbc13448f716f33e294503fbce1ebe 100644
|
||||
index 50040c497a819cd1229042ab3cb057d34a32cacc..64f906110a6cea49db69377e8869bda7c841f1d5 100644
|
||||
--- a/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
||||
+++ b/src/main/java/net/minecraft/util/ZeroBitStorage.java
|
||||
@@ -2,6 +2,7 @@ package net.minecraft.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.function.IntConsumer;
|
||||
+import net.minecraft.world.level.chunk.Palette;
|
||||
|
||||
import me.titaniumtown.ArrayConstants;
|
||||
|
||||
@@ -72,4 +73,6 @@ public class ZeroBitStorage implements BitStorage {
|
||||
@@ -62,4 +62,6 @@ public class ZeroBitStorage implements BitStorage {
|
||||
public BitStorage copy() {
|
||||
return this;
|
||||
}
|
||||
+
|
||||
+ @Override public <T> void compact(Palette<T> srcPalette, Palette<T> dstPalette, short[] out) {} // Gale - Lithium - faster chunk serialization
|
||||
+ @Override public <T> void compact(net.minecraft.world.level.chunk.Palette<T> srcPalette, net.minecraft.world.level.chunk.Palette<T> dstPalette, short[] out) {} // Gale - Lithium - faster chunk serialization
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/PaletteResize.java b/src/main/java/net/minecraft/world/level/chunk/PaletteResize.java
|
||||
index acae3eb30e0689048937f479dc3070f0688abdad..4b79f0474a9013dd4fdb68c6363ca1942ba8b007 100644
|
||||
@@ -321,7 +313,7 @@ index acae3eb30e0689048937f479dc3070f0688abdad..4b79f0474a9013dd4fdb68c6363ca194
|
||||
int onResize(int newBits, T object);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||
index 81368bf186365878db2e1ed305bb7bf36c26f61f..6402665ae8cc8664921ae0298e8b6fa4c31d8b23 100644
|
||||
index 926c81a25180d508d662eb3fa35f771636164694..82ad713eede4bca015a5b4b1d5fd9b02f0e75a47 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||
@@ -23,8 +23,25 @@ import net.minecraft.util.Mth;
|
||||
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
index fdff9788eaf663be79214b2ca491f0f0444f6136..774da40408225b0961b4dea50c4358a03d58b2ff 100644
|
||||
index dcbef04bbaab988096bf416163264833e84d1967..5c0e5803284bfc82c2dd8bba9ded0ba7aac4962a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -115,6 +115,7 @@ public class Raid {
|
||||
@@ -112,6 +112,7 @@ public class Raid {
|
||||
private static final org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry PDC_TYPE_REGISTRY = new org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry();
|
||||
public final org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer persistentDataContainer = new org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer(PDC_TYPE_REGISTRY);
|
||||
// Paper end
|
||||
@@ -24,7 +24,7 @@ index fdff9788eaf663be79214b2ca491f0f0444f6136..774da40408225b0961b4dea50c4358a0
|
||||
|
||||
public Raid(int id, ServerLevel world, BlockPos pos) {
|
||||
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
|
||||
@@ -294,6 +295,12 @@ public class Raid {
|
||||
@@ -291,6 +292,12 @@ public class Raid {
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
@@ -37,7 +37,7 @@ index fdff9788eaf663be79214b2ca491f0f0444f6136..774da40408225b0961b4dea50c4358a0
|
||||
if (!this.isStopped()) {
|
||||
if (this.status == Raid.RaidStatus.ONGOING) {
|
||||
boolean flag = this.active;
|
||||
@@ -664,6 +671,12 @@ public class Raid {
|
||||
@@ -661,6 +668,12 @@ public class Raid {
|
||||
}
|
||||
|
||||
public void updateBossbar() {
|
||||
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
index 8ce870a5341a61fbbaf42021ef7f7f615a6a3e09..0b8c15b079f9b57876692e272b3535cfb125829b 100644
|
||||
index 68be0d51aa64b5d917fb53dbbbdf8966d4f4abd8..c991da3d975e07f3e1e59d5b2e91ed629ea608e6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
|
||||
@@ -62,12 +62,17 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
@@ -61,12 +61,17 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
private static final BlockState AIR = Blocks.AIR.defaultBlockState();
|
||||
public final Holder<NoiseGeneratorSettings> settings;
|
||||
private final Supplier<Aquifer.FluidPicker> globalFluidPicker;
|
||||
@@ -35,7 +35,7 @@ index 8ce870a5341a61fbbaf42021ef7f7f615a6a3e09..0b8c15b079f9b57876692e272b3535cf
|
||||
});
|
||||
}
|
||||
|
||||
@@ -394,7 +399,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
@@ -409,7 +414,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
|
||||
|
||||
@Override
|
||||
public int getSeaLevel() {
|
||||
@@ -13,10 +13,10 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index b97253a6b43d4db39c22ae16b7e75bd95fb9d958..23350a4046a4071ef87f65b7341572a2bff0e8eb 100644
|
||||
index a5e51025e6c2d5fea903b7c1d950ba430966d36d..db0be6ca1ae9c78b8143a7f6a13889d68a0afe38 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -319,6 +319,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -323,6 +323,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public float yRotO;
|
||||
public float xRotO;
|
||||
private AABB bb;
|
||||
@@ -24,8 +24,8 @@ index b97253a6b43d4db39c22ae16b7e75bd95fb9d958..23350a4046a4071ef87f65b7341572a2
|
||||
public boolean onGround;
|
||||
public boolean horizontalCollision;
|
||||
public boolean verticalCollision;
|
||||
@@ -1129,6 +1130,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
// Paper end - detailed watchdog information
|
||||
@@ -1033,6 +1034,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public void move(MoverType movementType, Vec3 movement) {
|
||||
+ // Gale start - VMP - skip entity move if movement is zero
|
||||
@@ -34,9 +34,9 @@ index b97253a6b43d4db39c22ae16b7e75bd95fb9d958..23350a4046a4071ef87f65b7341572a2
|
||||
+ }
|
||||
+ // Gale end - VMP - skip entity move if movement is zero
|
||||
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
|
||||
// Paper start - detailed watchdog information
|
||||
io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
|
||||
@@ -4145,6 +4151,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
if (this.noPhysics) {
|
||||
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
||||
@@ -3954,6 +3960,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public final void setBoundingBox(AABB boundingBox) {
|
||||
@@ -13,7 +13,7 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java b/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java
|
||||
index 09199c574169057ae6e52ee7df277c03fa6ba5c2..3f0c84cf120e71259adc726579b2a23b3c56abbe 100644
|
||||
index 2039b16e5e9bc0797b3f31081d221bb8b34a4dc7..ceab64ea37f69c254680a8bdd6d2a596d94cb7dc 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java
|
||||
@@ -42,14 +42,14 @@ public class LocalMobCapCalculator {
|
||||
@@ -13,23 +13,15 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index aaff62e2706b67772684193a9d05ebda1ff9e343..a2c5b824a3126f0c7970550f509db9407c66ee28 100644
|
||||
index aa6927ad7ea10b64693a069202366a051183e878..b8bcba9380cbcc08ac7ebed170c58b091691777e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -13,6 +13,7 @@ import com.mojang.datafixers.DataFixer;
|
||||
import com.mojang.logging.LogUtils;
|
||||
import com.mojang.serialization.DataResult;
|
||||
import com.mojang.serialization.JsonOps;
|
||||
+import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ByteMap;
|
||||
@@ -253,7 +254,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper - rewrite chunk system
|
||||
@@ -228,7 +228,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.toDrop = new LongOpenHashSet();
|
||||
this.tickingGenerated = new AtomicInteger();
|
||||
this.playerMap = new PlayerMap();
|
||||
- this.entityMap = new Int2ObjectOpenHashMap();
|
||||
+ this.entityMap = new Int2ObjectLinkedOpenHashMap(); // Gale - VMP - use linked map for entity trackers - provides faster iteration
|
||||
+ this.entityMap = new it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap(); // Gale - VMP - use linked map for entity trackers - provides faster iteration
|
||||
this.chunkTypeCache = new Long2ByteOpenHashMap();
|
||||
this.chunkSaveCooldowns = new Long2LongOpenHashMap();
|
||||
this.unloadQueue = Queues.newConcurrentLinkedQueue();
|
||||
// Paper - rewrite chunk system
|
||||
@@ -46,10 +46,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
index 3ce86f952a18cae7fda1903916903b31a63a40b4..0dfc2ccd8f454d0252542312661f65f41a6209ab 100644
|
||||
index 38ac2759894660be1ee7ba59b0bd1270158e9232..eccb524111cec32ed55722817529e6ab992d381d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
@@ -421,7 +421,59 @@ public class Sheep extends Animal implements Shearable {
|
||||
@@ -419,7 +419,96 @@ public class Sheep extends Animal implements Shearable {
|
||||
return super.finalizeSpawn(world, difficulty, spawnReason, entityData);
|
||||
}
|
||||
|
||||
@@ -59,39 +59,76 @@ index 3ce86f952a18cae7fda1903916903b31a63a40b4..0dfc2ccd8f454d0252542312661f65f4
|
||||
+ switch (firstColor) {
|
||||
+ case WHITE -> {
|
||||
+ switch (secondColor) {
|
||||
+ case BLUE -> {return DyeColor.LIGHT_BLUE;}
|
||||
+ case GRAY -> {return DyeColor.LIGHT_GRAY;}
|
||||
+ case BLACK -> {return DyeColor.GRAY;}
|
||||
+ case GREEN -> {return DyeColor.LIME;}
|
||||
+ case RED -> {return DyeColor.PINK;}
|
||||
+ case BLUE -> {
|
||||
+ return DyeColor.LIGHT_BLUE;
|
||||
+ }
|
||||
+ case GRAY -> {
|
||||
+ return DyeColor.LIGHT_GRAY;
|
||||
+ }
|
||||
+ case BLACK -> {
|
||||
+ return DyeColor.GRAY;
|
||||
+ }
|
||||
+ case GREEN -> {
|
||||
+ return DyeColor.LIME;
|
||||
+ }
|
||||
+ case RED -> {
|
||||
+ return DyeColor.PINK;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ case BLUE -> {
|
||||
+ switch (secondColor) {
|
||||
+ case WHITE -> {return DyeColor.LIGHT_BLUE;}
|
||||
+ case GREEN -> {return DyeColor.CYAN;}
|
||||
+ case RED -> {return DyeColor.PURPLE;}
|
||||
+ case WHITE -> {
|
||||
+ return DyeColor.LIGHT_BLUE;
|
||||
+ }
|
||||
+ case GREEN -> {
|
||||
+ return DyeColor.CYAN;
|
||||
+ }
|
||||
+ case RED -> {
|
||||
+ return DyeColor.PURPLE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ case RED -> {
|
||||
+ switch (secondColor) {
|
||||
+ case YELLOW -> {return DyeColor.ORANGE;}
|
||||
+ case WHITE -> {return DyeColor.PINK;}
|
||||
+ case BLUE -> {return DyeColor.PURPLE;}
|
||||
+ case YELLOW -> {
|
||||
+ return DyeColor.ORANGE;
|
||||
+ }
|
||||
+ case WHITE -> {
|
||||
+ return DyeColor.PINK;
|
||||
+ }
|
||||
+ case BLUE -> {
|
||||
+ return DyeColor.PURPLE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ case GREEN -> {
|
||||
+ switch (secondColor) {
|
||||
+ case BLUE -> {return DyeColor.CYAN;}
|
||||
+ case WHITE -> {return DyeColor.LIME;}
|
||||
+ case BLUE -> {
|
||||
+ return DyeColor.CYAN;
|
||||
+ }
|
||||
+ case WHITE -> {
|
||||
+ return DyeColor.LIME;
|
||||
+ }
|
||||
+ }
|
||||
+ case YELLOW -> {if (secondColor.equals(DyeColor.RED)) return DyeColor.ORANGE;}
|
||||
+ case PURPLE -> {if (secondColor.equals(DyeColor.PINK)) return DyeColor.MAGENTA;}
|
||||
+ case PINK -> {if (secondColor.equals(DyeColor.PURPLE)) return DyeColor.MAGENTA;}
|
||||
+ case GRAY -> {if (secondColor.equals(DyeColor.WHITE)) return DyeColor.LIGHT_GRAY;}
|
||||
+ case BLACK -> {if (secondColor.equals(DyeColor.WHITE)) return DyeColor.GRAY;}
|
||||
+ }
|
||||
+ case YELLOW -> {
|
||||
+ if (secondColor.equals(DyeColor.RED)) return DyeColor.ORANGE;
|
||||
+ }
|
||||
+ case PURPLE -> {
|
||||
+ if (secondColor.equals(DyeColor.PINK)) return DyeColor.MAGENTA;
|
||||
+ }
|
||||
+ case PINK -> {
|
||||
+ if (secondColor.equals(DyeColor.PURPLE)) return DyeColor.MAGENTA;
|
||||
+ }
|
||||
+ case GRAY -> {
|
||||
+ if (secondColor.equals(DyeColor.WHITE)) return DyeColor.LIGHT_GRAY;
|
||||
+ }
|
||||
+ case BLACK -> {
|
||||
+ if (secondColor.equals(DyeColor.WHITE)) return DyeColor.GRAY;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Gale end - carpet-fixes - optimize sheep offspring color
|
||||
@@ -108,7 +145,7 @@ index 3ce86f952a18cae7fda1903916903b31a63a40b4..0dfc2ccd8f454d0252542312661f65f4
|
||||
+ // Gale end - carpet-fixes - optimize sheep offspring color
|
||||
DyeColor enumcolor = ((Sheep) firstParent).getColor();
|
||||
DyeColor enumcolor1 = ((Sheep) secondParent).getColor();
|
||||
CraftingContainer inventorycrafting = Sheep.makeContainer(enumcolor, enumcolor1);
|
||||
CraftingInput craftinginput = Sheep.makeCraftInput(enumcolor, enumcolor1);
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
index 0f205f02ce0553fb1f8db8aa903861102a570708..19115238d0fd845a788446d88d9ec9a52762c367 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
|
||||
@@ -13,10 +13,10 @@ As part of: Slice (https://github.com/Cryptite/Slice)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 23350a4046a4071ef87f65b7341572a2bff0e8eb..4f8bd45ac7278f06d9af82d6d3e0882cfc830929 100644
|
||||
index db0be6ca1ae9c78b8143a7f6a13889d68a0afe38..4dd79b1595406dfd93b2dd6e2ef56f7bf4db65c6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -934,7 +934,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -864,7 +864,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
this.checkBelowWorld();
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -13,7 +13,7 @@ As part of: Mirai (https://github.com/etil2jz/Mirai)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/advancements/Advancement.java b/src/main/java/net/minecraft/advancements/Advancement.java
|
||||
index 6d04be3a75df1f847389b985c9b1c0330c9e2415..fd7057487e4c86ff584ceb30c08b26b0fde5caad 100644
|
||||
index fb4b7652c386fa10783d71899615723a958ffd56..8045b17eed344e4bcdd02adba1d63904b6562cde 100644
|
||||
--- a/src/main/java/net/minecraft/advancements/Advancement.java
|
||||
+++ b/src/main/java/net/minecraft/advancements/Advancement.java
|
||||
@@ -60,7 +60,7 @@ public record Advancement(
|
||||
@@ -13,10 +13,10 @@ As part of: SportPaper (https://github.com/Electroid/SportPaper)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 44424717623aa45c00dc69b23fc9741117650de3..cf51f108753a19e3ab97a6df3e5cecaa4d39f293 100644
|
||||
index e01481a889877ba898a8af9a13e4f83c842a18c6..9e663983f3f9f73d49ebf8b7d77f995e14440ce4 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1743,7 +1743,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1483,7 +1483,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
@Override
|
||||
public void destroyBlockProgress(int entityId, BlockPos pos, int progress) {
|
||||
@@ -35,7 +35,7 @@ index 44424717623aa45c00dc69b23fc9741117650de3..cf51f108753a19e3ab97a6df3e5cecaa
|
||||
|
||||
// CraftBukkit start
|
||||
Player entityhuman = null;
|
||||
@@ -1777,7 +1787,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1517,7 +1527,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
// CraftBukkit end
|
||||
|
||||
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index d502cc7221851e92b6f9d1522d33e9817ff18f6f..a4e813aeae443aecf78515d3759b2a65fd14f8ea 100644
|
||||
index fa4ca096dfd3afe8868b76a8576f0f2882f139ca..44990dfc60126bf6bb88679dfbebb09d3ca1473a 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -13,6 +13,8 @@ import java.net.SocketAddress;
|
||||
@@ -49,7 +49,7 @@ index d502cc7221851e92b6f9d1522d33e9817ff18f6f..a4e813aeae443aecf78515d3759b2a65
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Iterator;
|
||||
@@ -136,10 +138,11 @@ public abstract class PlayerList {
|
||||
@@ -134,10 +136,11 @@ public abstract class PlayerList {
|
||||
public static final Component CHAT_FILTERED_FULL = Component.translatable("chat.filtered_full");
|
||||
public static final Component DUPLICATE_LOGIN_DISCONNECT_MESSAGE = Component.translatable("multiplayer.disconnect.duplicate_login");
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -62,7 +62,7 @@ index d502cc7221851e92b6f9d1522d33e9817ff18f6f..a4e813aeae443aecf78515d3759b2a65
|
||||
private final Map<UUID, ServerPlayer> playersByUUID = Maps.newHashMap();
|
||||
private final UserBanList bans;
|
||||
private final IpBanList ipBans;
|
||||
@@ -330,6 +333,7 @@ public abstract class PlayerList {
|
||||
@@ -328,6 +331,7 @@ public abstract class PlayerList {
|
||||
|
||||
// entityplayer.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); // CraftBukkit - replaced with loop below
|
||||
this.players.add(player);
|
||||
@@ -70,7 +70,7 @@ index d502cc7221851e92b6f9d1522d33e9817ff18f6f..a4e813aeae443aecf78515d3759b2a65
|
||||
this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot
|
||||
this.playersByUUID.put(player.getUUID(), player);
|
||||
// this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(entityplayer))); // CraftBukkit - replaced with loop below
|
||||
@@ -669,6 +673,7 @@ public abstract class PlayerList {
|
||||
@@ -660,6 +664,7 @@ public abstract class PlayerList {
|
||||
entityplayer.retireScheduler(); // Paper - Folia schedulers
|
||||
entityplayer.getAdvancements().stopListening();
|
||||
this.players.remove(entityplayer);
|
||||
@@ -78,23 +78,23 @@ index d502cc7221851e92b6f9d1522d33e9817ff18f6f..a4e813aeae443aecf78515d3759b2a65
|
||||
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
|
||||
this.server.getCustomBossEvents().onPlayerDisconnect(entityplayer);
|
||||
UUID uuid = entityplayer.getUUID();
|
||||
@@ -831,6 +836,7 @@ public abstract class PlayerList {
|
||||
// Paper end - Expand PlayerRespawnEvent
|
||||
@@ -816,6 +821,7 @@ public abstract class PlayerList {
|
||||
public ServerPlayer respawn(ServerPlayer entityplayer, boolean flag, Entity.RemovalReason entity_removalreason, RespawnReason reason, Location location) {
|
||||
entityplayer.stopRiding(); // CraftBukkit
|
||||
this.players.remove(entityplayer);
|
||||
+ this.removeFromSendAllPlayerInfoBuckets(entityplayer); // Gale - Purpur - spread out sending all player info
|
||||
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
|
||||
entityplayer.serverLevel().removePlayerImmediately(entityplayer, Entity.RemovalReason.DISCARDED);
|
||||
BlockPos blockposition = entityplayer.getRespawnPosition();
|
||||
@@ -967,6 +973,7 @@ public abstract class PlayerList {
|
||||
entityplayer.serverLevel().removePlayerImmediately(entityplayer, entity_removalreason);
|
||||
/* CraftBukkit start
|
||||
@@ -897,6 +903,7 @@ public abstract class PlayerList {
|
||||
if (!entityplayer.connection.isDisconnected()) {
|
||||
worldserver1.addRespawnedPlayer(entityplayer1);
|
||||
worldserver.addRespawnedPlayer(entityplayer1);
|
||||
this.players.add(entityplayer1);
|
||||
+ this.addToSendAllPlayerInfoBuckets(entityplayer1); // Gale - Purpur - spread out sending all player info
|
||||
this.playersByName.put(entityplayer1.getScoreboardName().toLowerCase(java.util.Locale.ROOT), entityplayer1); // Spigot
|
||||
this.playersByUUID.put(entityplayer1.getUUID(), entityplayer1);
|
||||
}
|
||||
@@ -1025,20 +1032,55 @@ public abstract class PlayerList {
|
||||
@@ -975,20 +982,55 @@ public abstract class PlayerList {
|
||||
this.sendPlayerPermissionLevel(player, i, recalculatePermissions); // Paper - avoid recalculating permissions if possible
|
||||
}
|
||||
|
||||
@@ -157,10 +157,10 @@ index d502cc7221851e92b6f9d1522d33e9817ff18f6f..a4e813aeae443aecf78515d3759b2a65
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index f4f45fa391c36f66abdf1c16c0f3e31f5dda1c1a..82d3fdc8fb10724c40015349b0ddc60143dc86b2 100644
|
||||
index e513e17f460927fcffd029bb3b3357ca85aa514d..f136510042db4c40a486b2ee3ed7e91a90bd9424 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -38,6 +38,7 @@ import net.minecraft.network.syncher.SynchedEntityData;
|
||||
@@ -39,6 +39,7 @@ import net.minecraft.network.syncher.SynchedEntityData;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -168,7 +168,7 @@ index f4f45fa391c36f66abdf1c16c0f3e31f5dda1c1a..82d3fdc8fb10724c40015349b0ddc601
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
@@ -206,12 +207,15 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -207,12 +208,15 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index a4e813aeae443aecf78515d3759b2a65fd14f8ea..4eff57762a83b6e60fd5ad6cd71dcecf786b10d1 100644
|
||||
index 44990dfc60126bf6bb88679dfbebb09d3ca1473a..98efc69c911dd7cdce6c945d1bfebbefc0bbd154 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1068,14 +1068,18 @@ public abstract class PlayerList {
|
||||
@@ -1018,14 +1018,18 @@ public abstract class PlayerList {
|
||||
// Gale start - Purpur - spread out sending all player info
|
||||
ServerPlayer[] sendAllPlayerInfoBucket = this.sendAllPlayerInfoBuckets[this.sendAllPlayerInfoIn];
|
||||
if (sendAllPlayerInfoBucket != null) {
|
||||
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index ad590059cee0ec44f9799c3a6bc8cc0d00b5e172..11d6d060068985884338ab61d2f98d55a202afd8 100644
|
||||
index d0327f3e230c6e79f74e51c926f089e55a01bf59..7b9ee0e0316279a74ef15317450446550e0a50a4 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -513,6 +513,7 @@ public class Commands {
|
||||
@@ -511,6 +511,7 @@ public class Commands {
|
||||
private void runSync(ServerPlayer player, Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootcommandnode) {
|
||||
// Paper end - Perf: Async command map building
|
||||
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper - Brigadier API
|
||||
@@ -48,7 +48,7 @@ index ad590059cee0ec44f9799c3a6bc8cc0d00b5e172..11d6d060068985884338ab61d2f98d55
|
||||
PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit));
|
||||
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
||||
|
||||
@@ -523,6 +524,7 @@ public class Commands {
|
||||
@@ -521,6 +522,7 @@ public class Commands {
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 652ae75254d78fff02d68cbb747eaee4c3f35a1a..2a7de95242c80e2df86ef11538a315664617d3f0 100644
|
||||
index 8757a6ac609d463f94846d66fe04f50e859e7ce8..a720a05c47b2137a07515461960603cc5c939d16 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -4,6 +4,9 @@ import com.mojang.authlib.GameProfile;
|
||||
@@ -50,7 +50,7 @@ index 652ae75254d78fff02d68cbb747eaee4c3f35a1a..2a7de95242c80e2df86ef11538a31566
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
@@ -30,6 +33,7 @@ import net.minecraft.server.level.ClientInformation;
|
||||
@@ -31,6 +34,7 @@ import net.minecraft.server.level.ClientInformation;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.util.VisibleForDebug;
|
||||
import net.minecraft.util.thread.BlockableEventLoop;
|
||||
@@ -58,7 +58,7 @@ index 652ae75254d78fff02d68cbb747eaee4c3f35a1a..2a7de95242c80e2df86ef11538a31566
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -73,10 +77,14 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -74,10 +78,14 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
private long keepAliveChallenge;
|
||||
private long closedListenerTime;
|
||||
private boolean closed = false;
|
||||
@@ -71,10 +71,10 @@ index 652ae75254d78fff02d68cbb747eaee4c3f35a1a..2a7de95242c80e2df86ef11538a31566
|
||||
+ private static final long KEEPALIVE_LIMIT_IN_SECONDS = Long.getLong("paper.playerconnection.keepalive", 30); // Paper - provide property to set keepalive limit
|
||||
+ private static final long KEEPALIVE_LIMIT = KEEPALIVE_LIMIT_IN_SECONDS * 1000;
|
||||
+ // Gale end - Purpur - send multiple keep-alive packets
|
||||
protected static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support
|
||||
protected static final ResourceLocation MINECRAFT_BRAND = ResourceLocation.withDefaultNamespace("brand"); // Paper - Brand support
|
||||
|
||||
public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit
|
||||
@@ -124,6 +132,16 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -125,6 +133,16 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@Override
|
||||
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
|
||||
//PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // CraftBukkit // Paper - handle ServerboundKeepAlivePacket async
|
||||
@@ -91,7 +91,7 @@ index 652ae75254d78fff02d68cbb747eaee4c3f35a1a..2a7de95242c80e2df86ef11538a31566
|
||||
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
|
||||
int i = (int) (Util.getMillis() - this.keepAliveTime);
|
||||
|
||||
@@ -136,6 +154,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -137,6 +155,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
});
|
||||
// Paper end - This needs to be handled on the main thread for plugins
|
||||
}
|
||||
@@ -99,7 +99,7 @@ index 652ae75254d78fff02d68cbb747eaee4c3f35a1a..2a7de95242c80e2df86ef11538a31566
|
||||
|
||||
}
|
||||
|
||||
@@ -251,6 +270,21 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -252,6 +271,21 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
long currentTime = Util.getMillis();
|
||||
long elapsedTime = currentTime - this.keepAliveTime;
|
||||
|
||||
@@ -120,8 +120,8 @@ index 652ae75254d78fff02d68cbb747eaee4c3f35a1a..2a7de95242c80e2df86ef11538a31566
|
||||
+ // Gale end - Purpur - send multiple keep-alive packets
|
||||
if (!this.isSingleplayerOwner() && elapsedTime >= 15000L) { // Paper - use vanilla's 15000L between keep alive packets
|
||||
if (this.keepAlivePending && !this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected
|
||||
this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
|
||||
@@ -261,6 +295,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
|
||||
@@ -262,6 +296,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge));
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ index 652ae75254d78fff02d68cbb747eaee4c3f35a1a..2a7de95242c80e2df86ef11538a31566
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 71fd17e8e1aea7ac54d910e330c5eb0edaf8b07a..31cd9c04b06fa691305c078e3c428a9e0d717ecf 100644
|
||||
index d3319dcb15ee727b42d3bc09e06793cf728f1c6b..9dcbc2439e21a37793e8134e0715836fb88d9f78 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -9,6 +9,8 @@ import com.mojang.brigadier.suggestion.Suggestions;
|
||||
@@ -142,7 +142,7 @@ index 71fd17e8e1aea7ac54d910e330c5eb0edaf8b07a..31cd9c04b06fa691305c078e3c428a9e
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectIterator;
|
||||
import java.net.SocketAddress;
|
||||
@@ -3467,6 +3469,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -3412,6 +3414,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
@Override
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user