9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-23 08:49:28 +00:00

Update 1.20.5

This commit is contained in:
Dreeam
2024-04-28 08:17:49 -04:00
parent 05f24b652c
commit f126483109
127 changed files with 1041 additions and 1219 deletions

View File

@@ -15,8 +15,8 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
distribution: zulu
java-version: 21
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Configure Git user details
@@ -24,7 +24,7 @@ jobs:
- name: Apply patches
run: ./gradlew applyPatches
- name: Create Paperclip jar
run: ./gradlew createReobfPaperclipJar
run: ./gradlew createMojmapPaperclipJar
- name: Upload Paperclip jar
uses: actions/upload-artifact@v4
with:

View File

@@ -7,8 +7,7 @@ import kotlin.io.path.deleteRecursively
plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.patcher") version "1.5.15"
id("io.papermc.paperweight.patcher") version "1.6.2"
}
allprojects {
@@ -17,7 +16,7 @@ allprojects {
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}
}
}
@@ -27,7 +26,7 @@ val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
subprojects {
tasks.withType<JavaCompile>().configureEach {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
options.release.set(21)
}
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
@@ -46,6 +45,7 @@ subprojects {
repositories {
mavenCentral()
maven(paperMavenPublicUrl)
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") // TODO - Adventure snapshot
}
}
@@ -59,7 +59,7 @@ repositories {
}
dependencies {
remapper("net.fabricmc:tiny-remapper:0.10.1:fat")
remapper("net.fabricmc:tiny-remapper:0.10.2:fat")
decompiler("org.vineflower:vineflower:1.10.1")
paperclip("io.papermc:paperclip:3.0.3")
}
@@ -109,9 +109,8 @@ tasks.register("printGaleVersion") { // Gale - branding changes
}
// Gale start - branding changes - package license into jar
for (classifier in arrayOf("mojmap", "reobf")) {
// Based on io.papermc.paperweight.taskcontainers.BundlerJarTasks
tasks.named("create${classifier.capitalized()}PaperclipJar") {
// Based on io.papermc.paperweight.taskcontainers.BundlerJarTasks
tasks.named("createMojmapPaperclipJar") {
doLast {
// Based on io.papermc.paperweight.taskcontainers.BundlerJarTasks
@@ -119,7 +118,7 @@ for (classifier in arrayOf("mojmap", "reobf")) {
project.name,
"paperclip",
project.version,
classifier
"mojmap"
).joinToString("-") + ".jar"
// Based on io.papermc.paperweight.taskcontainers.BundlerJarTasks
@@ -131,7 +130,8 @@ for (classifier in arrayOf("mojmap", "reobf")) {
io.papermc.paperweight.util.unzip(zipFile, rootDir)
val licenseFileName = "LICENSE.txt"
project(":gale-server").projectDir.resolve(licenseFileName).copyTo(rootDir.resolve(licenseFileName).toFile())
project(":gale-server").projectDir.resolve(licenseFileName)
.copyTo(rootDir.resolve(licenseFileName).toFile())
io.papermc.paperweight.util.ensureDeleted(zipFile)
@@ -142,6 +142,5 @@ for (classifier in arrayOf("mojmap", "reobf")) {
}
}
}
}
// Gale end - branding changes - package license into jar

View File

@@ -1,8 +1,8 @@
group=org.galemc.gale
version=1.20.4-R0.1-SNAPSHOT
version=1.20.5-R0.1-SNAPSHOT
mcVersion=1.20.4
paperRef=7ac24a18940da12beb39a030113f6e459f348e2f
mcVersion=1.20.5
paperRef=306b203c2d06979e94eeab36d21c6a9596254d56
org.gradle.caching=true
org.gradle.parallel=true

View File

@@ -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 4ff1b38eb65f97344257204cf018f176f247ed36..bd6d14ffbbc93a94656255c395628df776334310 100644
index 27084402cf0e46dcd171074629b7c4156e48aa44..718955f1a6cca9d93bed49f53f8295a6be0c26d0 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2233,6 +2233,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2252,6 +2252,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
{
throw new UnsupportedOperationException("Not supported yet.");
}

View File

@@ -55,7 +55,7 @@ index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..92d20e70d26318fbaed8adffd21c6b77
* This class was not meant to be constructed explicitly
*
diff --git a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
index 653135352c104a6ddeb74a1b6d4916c6952d6271..78a6e7a31a81bc82d3e3687661e16c6d8ebc4617 100644
index f4d655a158410039305ac68cebe0d79000f73df8..7ad6d1007154357a33bca49fec43cb4a4a15b832 100644
--- a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
@@ -66,6 +66,7 @@ public class LibraryLoader
@@ -66,7 +66,7 @@ index 653135352c104a6ddeb74a1b6d4916c6952d6271..78a6e7a31a81bc82d3e3687661e16c6d
logger.log( Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
}
} );
@@ -81,6 +82,7 @@ public class LibraryLoader
@@ -86,6 +87,7 @@ public class LibraryLoader
{
return null;
}
@@ -74,7 +74,7 @@ index 653135352c104a6ddeb74a1b6d4916c6952d6271..78a6e7a31a81bc82d3e3687661e16c6d
logger.log( Level.INFO, "[{0}] Loading {1} libraries... please wait", new Object[]
{
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), desc.getLibraries().size() // Paper - use configured log prefix
@@ -119,6 +121,7 @@ public class LibraryLoader
@@ -124,6 +126,7 @@ public class LibraryLoader
}
jarFiles.add( url );

View File

@@ -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 c6cb4f17469a8f2e60dd3e28d41402851ce5fb21..019237c2e536a118f7cd3d81fc59b74f21c34609 100644
index 8a1e39474af88188f2e1765731b57d349f0ee645..0b3a1f3285fc0d8954f4204a93d3905df01cd828 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2054,6 +2054,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2098,6 +2098,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
boolean listPlayer(@NotNull Player other);
// Paper end

View File

@@ -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 9a428153f34291bdc026a71f7e60e285b7794b0c..ee513652ab11b9173e6dd83d9ff048ee50a5acd3 100644
index 687bd8f54c9bfb5f5ab1f7ad9d232daf2433cc76..3719626f051b1577e7874d17c26f2ce7e7e25689 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2357,6 +2357,37 @@ public final class Bukkit {
@@ -2380,6 +2380,37 @@ public final class Bukkit {
return server.getTPS();
}
@@ -49,10 +49,10 @@ index 9a428153f34291bdc026a71f7e60e285b7794b0c..ee513652ab11b9173e6dd83d9ff048ee
* 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 bd6d14ffbbc93a94656255c395628df776334310..bdf18c891ff90ca6173ff8af14f6ad6dbc370ae7 100644
index 718955f1a6cca9d93bed49f53f8295a6be0c26d0..a6baad622de8252aa7138a9b571a5329d64a608c 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2015,6 +2015,31 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2034,6 +2034,31 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
public double[] getTPS();

View File

@@ -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 ee513652ab11b9173e6dd83d9ff048ee50a5acd3..7b28cc23aa63431fe51fc8e51d5774f4a314945f 100644
index 3719626f051b1577e7874d17c26f2ce7e7e25689..1d288ac91a00d427b92711ecaf581d1746d90cc1 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2357,8 +2357,30 @@ public final class Bukkit {
@@ -2380,8 +2380,30 @@ public final class Bukkit {
return server.getTPS();
}
@@ -72,10 +72,10 @@ index ee513652ab11b9173e6dd83d9ff048ee50a5acd3..7b28cc23aa63431fe51fc8e51d5774f4
* 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 bdf18c891ff90ca6173ff8af14f6ad6dbc370ae7..e634f4ce24423fd955bac3cd717f78142e7e4e30 100644
index a6baad622de8252aa7138a9b571a5329d64a608c..0fabc244497cadc6d966ff6cce3fe2a9b065ef2d 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2015,8 +2015,27 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2034,8 +2034,27 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
public double[] getTPS();

View File

@@ -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 7b28cc23aa63431fe51fc8e51d5774f4a314945f..d8201747ede92a0123eec012844a7a674e6947f5 100644
index 1d288ac91a00d427b92711ecaf581d1746d90cc1..1a4eae45a9352fcc55b8c8a63a126d734604e8c6 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2933,6 +2933,20 @@ public final class Bukkit {
@@ -2956,6 +2956,20 @@ public final class Bukkit {
}
// Paper end - Folia region threading API
@@ -48,10 +48,10 @@ index 7b28cc23aa63431fe51fc8e51d5774f4a314945f..d8201747ede92a0123eec012844a7a67
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 e634f4ce24423fd955bac3cd717f78142e7e4e30..e0615e17765406bab75b5d16f9056d6821c577ee 100644
index 0fabc244497cadc6d966ff6cce3fe2a9b065ef2d..db539f0324f2d7c9a9bcb2738bd8eb4158f8d4b5 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2571,4 +2571,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2590,4 +2590,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
// Paper end - Folia region threading API

View File

@@ -7,10 +7,10 @@ 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 58da26ad2f128ba0b66f86820f60853f4be352f0..331aae3eb16403874890d539fc5093a00c4d73f0 100644
index 5d448d8a7cf6626a11791f30ad52baf41a099272..efddc377a63b80f19e4cb0080027a45e30f69e5f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,8 +13,14 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
@@ -12,8 +12,14 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
val alsoShade: Configuration by configurations.creating
dependencies {

View File

@@ -34,10 +34,10 @@ 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 0530b87c422a6b767c1a18434f93f18f16580785..64dd6f81e24d18df3b5efc87a0cb452759d3697a 100644
index 4f206e32477d84f4ba16e49d5abd3c28da5cab8f..3c8f05a13d4fb10ac1e0ed444f1bfe665a077033 100644
--- a/src/main/java/net/minecraft/util/ExtraCodecs.java
+++ b/src/main/java/net/minecraft/util/ExtraCodecs.java
@@ -225,7 +225,7 @@ public class ExtraCodecs {
@@ -224,7 +224,7 @@ public class ExtraCodecs {
return combineFunction.apply(object, object2);
}), pair -> ImmutableList.of(leftFunction.apply((I)pair), rightFunction.apply((I)pair)));
Codec<I> codec3 = RecordCodecBuilder.<Pair>create(
@@ -46,7 +46,7 @@ index 0530b87c422a6b767c1a18434f93f18f16580785..64dd6f81e24d18df3b5efc87a0cb4527
.apply(instance, Pair::of)
)
.comapFlatMap(
@@ -248,7 +248,7 @@ public class ExtraCodecs {
@@ -247,7 +247,7 @@ public class ExtraCodecs {
Optional<Pair<A, T>> optional = dataResult.resultOrPartial(mutableObject::setValue);
return optional.isPresent()
? dataResult
@@ -77,7 +77,7 @@ index c9101a3bf0cb2c9e49e0e768b379e8dd816012de..ec7f8ef7bcd0a6cf72d032714c3e1057
.put(dynamic.createString("x"), dynamic.createInt(i * 16 + m))
.put(dynamic.createString("y"), dynamic.createInt(j * 16 + n))
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 71e1a68ae46475e7cdf37f32e101b3ca8847abd3..721dc2881c51a4bbcdaeaf3b309b316d26009535 100644
index 166b7d87ab88e28d465fb4a5d07c180c10464925..a506f3ef40ec34a89abb73a60cedf3b556585bee 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 {

View File

@@ -7,14 +7,13 @@ 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 b86398b20a38a1d06b44f328f191b44f73553aeb..4d5c2cbb26c97ac11d4908a1d734c421a06b1ba8 100644
index efddc377a63b80f19e4cb0080027a45e30f69e5f..0ca56b8c082e17ace3425ee151b096f961448799 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -65,6 +65,16 @@ dependencies {
@@ -73,6 +73,15 @@ paperweight {
craftBukkitPackageVersion.set("v1_20_R4") // also needs to be updated in MappingEnvironment
}
val craftbukkitPackageVersion = "1_20_R3" // Paper
+
+// Gale start - hide irrelevant compilation warnings
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs

View File

@@ -7,10 +7,10 @@ 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 e1fbcd105b8af0744c9524e8ea8440104f5dc6dc..32839f9f0dc6009cf3346724a2ddbf74f56ac94c 100644
index 0ca56b8c082e17ace3425ee151b096f961448799..ee6002acca215015d00ea0bfc2b720ea0087145e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -190,6 +190,7 @@ fun TaskContainer.registerRunTask(
@@ -181,6 +181,7 @@ fun TaskContainer.registerRunTask(
val memoryGb = providers.gradleProperty("paper.runMemoryGb").getOrElse("2")
minHeapSize = "${memoryGb}G"
maxHeapSize = "${memoryGb}G"

View File

@@ -221,10 +221,10 @@ 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 af2ced430f317ea5bcef154af014c0a18b2ffc72..b9d7ca20d2284a227c95b9c9e03549f28dc60a28 100644
index ee6002acca215015d00ea0bfc2b720ea0087145e..77df57490bf3c107eff5527506256610fd8fe1f3 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -87,7 +87,7 @@ tasks.jar {
@@ -94,7 +94,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
@@ -233,9 +233,9 @@ index af2ced430f317ea5bcef154af014c0a18b2ffc72..b9d7ca20d2284a227c95b9c9e03549f2
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
@@ -221,3 +221,22 @@ tasks.registerRunTask("runDev") {
classpath(sourceSets.main.map { it.runtimeClasspath })
jvmArgs("-DPaper.pushPaperAssetsRoot=true")
@@ -233,3 +233,22 @@ tasks.registerRunTask("runReobfPaperclip") {
classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreatePaperclipJar>("createReobfPaperclipJar").flatMap { it.outputZip })
mainClass.set(null as String?)
}
+
+// Gale start - package license into jar
@@ -427,10 +427,10 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..e45e6b44b2a8f2cdae6e0048a812b921
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 27db614d46dffc2d10f18d79cc5a084f3421d86b..4318f6b4f83709ae2f1d4d8346e79b3e433abf19 100644
index 8dc2f9df367c849ca333bf1a1fd92ff91617b548..f77a12e0ef3852b6de0f7b507bba4803d2d70d49 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -952,7 +952,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -960,7 +960,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper
if (!isSameThread()) {
@@ -445,7 +445,7 @@ index 27db614d46dffc2d10f18d79cc5a084f3421d86b..4318f6b4f83709ae2f1d4d8346e79b3e
while (this.getRunningThread().isAlive()) {
this.getRunningThread().stop();
try {
@@ -1865,7 +1871,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1924,7 +1930,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {
@@ -455,10 +455,10 @@ index 27db614d46dffc2d10f18d79cc5a084f3421d86b..4318f6b4f83709ae2f1d4d8346e79b3e
public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c490a29bcf7410bc54959ee71375605964379ed5..af7206ac02397971acc1505f76c666327cdae8b3 100644
index 05e304f9fc8d0291fa779da589bd060ef4165b49..419b99908b0e798c229b2f92e14f45c4356330cb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -266,7 +266,7 @@ import javax.annotation.Nullable; // Paper
@@ -268,7 +268,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server {
@@ -481,10 +481,10 @@ 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 3c7a771c48cc2732cc038ca11bb93ec5f8c2d667..53b73cac093797de47a9e61a5fdab44aced54ebb 100644
index 573b93fc4e392456af2f2cf3900a9d7014f67a22..7f11f35ba6ec90c06d6d224b5a13e2a114cd35b2 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -502,7 +502,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -508,7 +508,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@Override
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
@@ -709,7 +709,7 @@ index 0000000000000000000000000000000000000000..3d674eca7d20202d8f811c5c3e3946a1
+
+}
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 9e638f72f180ff5ef63ec3dd6cf548c53f7bd4a5..7e3efdc59ce2c84403d0c2b77c1c48f3e28a28a2 100644
index 6db566e3111ec08a99aa429624979cb83a85e272..5e556d7f3e444a7b7d7de70fa4efd50ef2a6dc8b 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

View File

@@ -38,21 +38,22 @@ 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 218bf89fd7583d6db9f64754c4db8fcce5415bdb..2ba577f8d191dc1650ac7945fffdfee7db34b5c6 100644
index 4495e1e8930619a0d58745cc55c69a5b574eb698..6684e1932d667f8f29d90eb71e3ac9863832f677 100644
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
@@ -6,7 +6,10 @@ import io.papermc.paper.configuration.constraint.Constraint;
@@ -7,8 +7,11 @@ import io.papermc.paper.configuration.constraint.Constraint;
import io.papermc.paper.configuration.constraint.Constraints;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceLocation;
+import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.GameRules;
+import org.bukkit.configuration.ConfigurationSection;
+import org.bukkit.configuration.file.YamlConfiguration;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.MustBeInvokedByOverriders;
import org.slf4j.Logger;
@@ -93,7 +96,7 @@ public abstract class Configurations<G, W> {
@@ -96,7 +99,7 @@ public abstract class Configurations<G, W> {
};
}
@@ -61,7 +62,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..2ba577f8d191dc1650ac7945fffdfee7
return node -> {
ObjectMapper.Factory factory = (ObjectMapper.Factory) Objects.requireNonNull(node.options().serializers().get(type));
ObjectMapper.Mutable<T> mutable = (ObjectMapper.Mutable<T>) factory.get(type);
@@ -167,7 +170,7 @@ public abstract class Configurations<G, W> {
@@ -170,7 +173,7 @@ public abstract class Configurations<G, W> {
final YamlConfigurationLoader loader = result.loader();
final ConfigurationNode node = loader.load();
if (result.isNewFile()) { // add version to new files
@@ -70,7 +71,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..2ba577f8d191dc1650ac7945fffdfee7
} else {
this.verifyWorldConfigVersion(contextMap, node);
}
@@ -228,7 +231,7 @@ public abstract class Configurations<G, W> {
@@ -232,7 +235,7 @@ public abstract class Configurations<G, W> {
.build();
final ConfigurationNode worldNode = worldLoader.load();
if (newFile) { // set the version field if new file
@@ -79,7 +80,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..2ba577f8d191dc1650ac7945fffdfee7
} else {
this.verifyWorldConfigVersion(contextMap, worldNode);
}
@@ -353,4 +356,25 @@ public abstract class Configurations<G, W> {
@@ -358,4 +361,25 @@ public abstract class Configurations<G, W> {
return "ContextKey{" + this.name + "}";
}
}
@@ -106,19 +107,19 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..2ba577f8d191dc1650ac7945fffdfee7
+
}
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..ed63ff5cb678eabde42c91e57c6e1b0d38c866b8 100644
index d99489e0216b24d27a19c92a1ce0c10ae10d071f..652487d60a65141832f3d1c8a45cd98e59402f48 100644
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -322,7 +322,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -320,7 +320,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
}
}
- private static ContextMap createWorldContextMap(ServerLevel level) {
+ public static ContextMap createWorldContextMap(ServerLevel level) { // Gale - Gale configuration
return createWorldContextMap(level.convertable.levelDirectory.path(), level.serverLevelData.getLevelName(), level.dimension().location(), level.spigotConfig, level.registryAccess());
return createWorldContextMap(level.convertable.levelDirectory.path(), level.serverLevelData.getLevelName(), level.dimension().location(), level.spigotConfig, level.registryAccess(), level.getGameRules());
}
@@ -424,17 +424,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -423,17 +423,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
}
@@ -136,7 +137,7 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..ed63ff5cb678eabde42c91e57c6e1b0d
@Deprecated
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
YamlConfiguration config = new YamlConfiguration();
@@ -457,9 +446,16 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -456,9 +445,16 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
}
// Symlinks are not correctly checked in createDirectories
@@ -188,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 4318f6b4f83709ae2f1d4d8346e79b3e433abf19..25bde42e2bc3201b8ddc2a70ccd1bfd8072e2f0e 100644
index f77a12e0ef3852b6de0f7b507bba4803d2d70d49..6b4fdb7e4761abb7a5cd302ab8746e0dfec33b15 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;
@@ -201,33 +202,17 @@ index 4318f6b4f83709ae2f1d4d8346e79b3e433abf19..25bde42e2bc3201b8ddc2a70ccd1bfd8
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -85,7 +82,6 @@ import net.minecraft.server.level.ServerChunkCache;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.level.ServerPlayerGameMode;
-import net.minecraft.server.level.TicketType;
import net.minecraft.server.level.progress.ChunkProgressListener;
import net.minecraft.server.level.progress.ChunkProgressListenerFactory;
import net.minecraft.server.network.ServerConnectionListener;
@@ -109,7 +105,6 @@ import net.minecraft.util.ProgressListener;
import net.minecraft.util.RandomSource;
import net.minecraft.util.SignatureValidator;
import net.minecraft.util.TimeUtil;
-import net.minecraft.util.Unit;
import net.minecraft.util.datafix.DataFixers;
import net.minecraft.util.profiling.EmptyProfileResults;
import net.minecraft.util.profiling.ProfileResults;
@@ -152,6 +147,9 @@ import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
@@ -145,6 +142,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;
import net.minecraft.world.level.storage.loot.LootDataManager;
+import net.minecraft.world.phys.Vec2;
+import net.minecraft.world.phys.Vec3;
+import org.galemc.gale.configuration.GaleConfigurations;
import org.slf4j.Logger;
// CraftBukkit start
@@ -306,6 +304,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -313,6 +313,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
@@ -235,7 +220,7 @@ index 4318f6b4f83709ae2f1d4d8346e79b3e433abf19..25bde42e2bc3201b8ddc2a70ccd1bfd8
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
@@ -412,6 +411,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -422,6 +423,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
@@ -289,7 +274,7 @@ 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 68d268b6fff126e8645b6deec3fb549ea2286b77..1243b375d2cbdf224fe174e75d42739248858561 100644
index eb4fc900164d1fb3a78653ae8bc42ea30323f5b7..109ecbde2afa832a26f51901556f0ae6dae4c561 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 @@
@@ -314,7 +299,7 @@ index 68d268b6fff126e8645b6deec3fb549ea2286b77..1243b375d2cbdf224fe174e75d427392
import java.util.Locale;
import java.util.Optional;
import java.util.function.BooleanSupplier;
@@ -209,6 +204,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -222,6 +217,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
@@ -326,10 +311,10 @@ index 68d268b6fff126e8645b6deec3fb549ea2286b77..1243b375d2cbdf224fe174e75d427392
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 502bdc726b7890b00ee36871d905dea44e8719e3..fc4d69058e6f543afc7da493edb8ac43376413c4 100644
index 0981d440d0dbfe4df668d1f3f1b5706a93bc4434..e0f09623624f52610b535a04a16141a54199c4fc 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -134,12 +134,10 @@ import net.minecraft.world.level.chunk.storage.EntityStorage;
@@ -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;
@@ -342,17 +327,17 @@ index 502bdc726b7890b00ee36871d905dea44e8719e3..fc4d69058e6f543afc7da493edb8ac43
import net.minecraft.world.level.gameevent.DynamicGameEventListener;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.level.gameevent.GameEventDispatcher;
@@ -692,7 +690,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -697,7 +695,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor
+ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), spigotConfig -> minecraftserver.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor // Gale - Gale configuration
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor
+ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), spigotConfig -> minecraftserver.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor // Gale - Gale configuration
this.pvpMode = minecraftserver.isPvpAllowed();
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 ca89d1593bf1b46c79a882db528cbca1359dc9d4..82db09234899606b217acb22b0eba2f8ee063812 100644
index b4ef3ad2c17168085372f1fe46809f02d9dfe74a..3a9437384e781a7a94f12edc6205b7da87a0cf49 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;
@@ -363,7 +348,7 @@ index ca89d1593bf1b46c79a882db528cbca1359dc9d4..82db09234899606b217acb22b0eba2f8
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
@@ -42,8 +41,6 @@ import net.minecraft.world.TickRateManager;
@@ -41,8 +40,6 @@ import net.minecraft.world.TickRateManager;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageSources;
import net.minecraft.world.entity.Entity;
@@ -372,26 +357,15 @@ index ca89d1593bf1b46c79a882db528cbca1359dc9d4..82db09234899606b217acb22b0eba2f8
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
@@ -89,17 +86,15 @@ import net.minecraft.network.protocol.game.ClientboundSetBorderSizePacket;
import net.minecraft.network.protocol.game.ClientboundSetBorderWarningDelayPacket;
import net.minecraft.network.protocol.game.ClientboundSetBorderWarningDistancePacket;
import org.bukkit.Bukkit;
-import org.bukkit.Location;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.block.CapturedBlockState;
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
@@ -99,6 +96,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.craftbukkit.util.CraftSpawnCategory;
-import org.bukkit.craftbukkit.util.CraftNamespacedKey;
import org.bukkit.entity.SpawnCategory;
import org.bukkit.event.block.BlockPhysicsEvent;
-import org.bukkit.event.world.GenericGameEvent;
+import org.galemc.gale.configuration.GaleWorldConfiguration;
// CraftBukkit end
public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -171,6 +166,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -168,6 +166,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return this.paperConfig;
}
// Paper end - add paper world config
@@ -404,7 +378,7 @@ index ca89d1593bf1b46c79a882db528cbca1359dc9d4..82db09234899606b217acb22b0eba2f8
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
@@ -216,9 +217,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -213,9 +217,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey();
@@ -417,7 +391,7 @@ index ca89d1593bf1b46c79a882db528cbca1359dc9d4..82db09234899606b217acb22b0eba2f8
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 af7206ac02397971acc1505f76c666327cdae8b3..a3d3b36644f583c31df1a7b8814f3920615fd54b 100644
index 419b99908b0e798c229b2f92e14f45c4356330cb..1c69e41e0a6c908eb9530cdbac3137b2e399a552 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1054,6 +1054,7 @@ public final class CraftServer implements Server {
@@ -428,7 +402,7 @@ index af7206ac02397971acc1505f76c666327cdae8b3..a3d3b36644f583c31df1a7b8814f3920
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))
@@ -3028,6 +3029,14 @@ public final class CraftServer implements Server {
@@ -3048,6 +3049,14 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}

View File

@@ -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 bb6246da25e756348d2dc0152d487f99054b5203..6fd999a40643cd3068cfdd80347d2cc117a409db 100644
index 109ecbde2afa832a26f51901556f0ae6dae4c561..222b863ba26217b69e9c027ba304107fbe1d6c81 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -45,6 +45,7 @@ import net.minecraft.world.level.GameRules;
@@ -50,6 +50,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 bb6246da25e756348d2dc0152d487f99054b5203..6fd999a40643cd3068cfdd80347d2cc1
import org.slf4j.Logger;
// CraftBukkit start
@@ -217,6 +218,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -230,6 +231,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

View File

@@ -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 8d626fadcd4743b6472a2954d2b1b2ec89669814..8d3959614ce42c996d93ffe00e7900d60c9b8184 100644
index c097f5d5fbd51cbbc01bbd54101905c59b3f3a4c..cd8ca1c9c8253e54c0b34d30b08fb0c2341cc98e 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 8d626fadcd4743b6472a2954d2b1b2ec89669814..8d3959614ce42c996d93ffe00e7900d6
public static void main(String[] args) {
// Paper start
final String warnWhenLegacyFormattingDetected = String.join(".", "net", "kyori", "adventure", "text", "warnWhenLegacyFormattingDetected");
@@ -315,14 +336,14 @@ public class Main {
@@ -317,13 +338,13 @@ public class Main {
String javaInfo = "Java " + runtimeMX.getSpecVersion() + " (" + runtimeMX.getVmName() + " " + runtimeMX.getVmVersion() + ")";
String osInfo = "Host: " + osMX.getName() + " " + osMX.getVersion() + " (" + osMX.getArch() + ")";
@@ -57,7 +57,6 @@ index 8d626fadcd4743b6472a2954d2b1b2ec89669814..8d3959614ce42c996d93ffe00e7900d6
}
// Paper end - Log Java and OS versioning to help with debugging plugin issues
System.setProperty("library.jansi.version", "Paper"); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows
- System.out.println("Loading libraries, please wait...");
+ printlnStartupInfoToSystemOut("Loading libraries, please wait..."); // Gale - include time in startup logs
net.minecraft.server.Main.main(options);

View File

@@ -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 bab2471616404821671264ccefd729cab8d0bf58..aa46e6e22998c62c89a56fbcabc13fdf58dd7dba 100644
index 9d10cdacb3aed2c00dc60aeb6f2cbeb48905e21f..4323ffee716380bd67eb04a4a7bb62bc4ba2f7df 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -67,6 +67,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -66,6 +66,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
public final Difficulty difficulty;
public final GameType gamemode;
public final String levelName;
@@ -52,17 +52,17 @@ index bab2471616404821671264ccefd729cab8d0bf58..aa46e6e22998c62c89a56fbcabc13fdf
- private final DedicatedServerProperties.WorldDimensionData worldDimensionData;
+ public final DedicatedServerProperties.WorldDimensionData worldDimensionData; // Gale - include server.properties in timings - private -> public
public final WorldOptions worldOptions;
public boolean acceptsTransfers;
public final String rconIp; // Paper - Configurable rcon ip
@@ -157,6 +159,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.enforceSecureProfile = this.get("enforce-secure-profile", true);
@@ -160,6 +162,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", "");
+ this.levelSeed = s; // Gale - include server.properties in timings
boolean flag = this.get("generate-structures", true);
long i = WorldOptions.parseSeed(s).orElse(WorldOptions.randomSeed());
@@ -166,7 +169,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -169,7 +172,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
}, new JsonObject()), (String) this.get("level-type", (s1) -> {
return s1.toLowerCase(Locale.ROOT);
}, WorldPresets.NORMAL.location().toString()));

View File

@@ -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 295b76c60d9395d0beb234aff5691388bd3fe437..2315d736b604ff35aa5bd839f3ea7bbc3f47e31c 100644
index 6b4fdb7e4761abb7a5cd302ab8746e0dfec33b15..b1a97d7b67d546a997799913005ae4383c988660 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1514,7 +1514,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1566,7 +1566,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void tickServer(BooleanSupplier shouldKeepTicking) {
@@ -19,12 +19,12 @@ index 295b76c60d9395d0beb234aff5691388bd3fe437..2315d736b604ff35aa5bd839f3ea7bbc
long i = Util.getNanos();
// Paper start - move oversleep into full server tick
@@ -1586,7 +1586,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.logTickTime(l - i);
@@ -1636,7 +1636,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.logTickMethodTime(i);
this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot
- co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper
+ co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTimingFullServerTick(); // Paper // Gale - final timings calls
}
private int computeNextAutosaveInterval() {
private void logTickMethodTime(long tickStartTime) {

File diff suppressed because it is too large Load Diff

View File

@@ -99,7 +99,7 @@ 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 e028353e0261310afc42ca0454b723d9f1ffc131..4ca8f36bb88fbd45720ea12fe524d671b5aeb791 100644
index e5c2e53388ff61e4aeae22a74b525d9a26ea0200..15dddb035c7ae3aca9b5cd5a5f56e0407641d9dd 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 {
@@ -133,10 +133,10 @@ index e028353e0261310afc42ca0454b723d9f1ffc131..4ca8f36bb88fbd45720ea12fe524d671
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 28653d149bcbfa7bc37b8a09ae58229b908374f7..66192e92f18062f6bec377a43d6cfc5b277705a1 100644
index 990ea96de8e940390b67e9462fcfd6025f2f5770..e102c109d01e0f992808a6096b5f6a323b52d970 100644
--- a/src/main/java/net/minecraft/util/Mth.java
+++ b/src/main/java/net/minecraft/util/Mth.java
@@ -57,13 +57,11 @@ public class Mth {
@@ -58,13 +58,11 @@ public class Mth {
}
public static int floor(float value) {
@@ -152,7 +152,7 @@ index 28653d149bcbfa7bc37b8a09ae58229b908374f7..66192e92f18062f6bec377a43d6cfc5b
}
public static long lfloor(double value) {
@@ -80,13 +78,11 @@ public class Mth {
@@ -81,13 +79,11 @@ public class Mth {
}
public static int ceil(float value) {
@@ -168,7 +168,7 @@ index 28653d149bcbfa7bc37b8a09ae58229b908374f7..66192e92f18062f6bec377a43d6cfc5b
}
public static int clamp(int value, int min, int max) {
@@ -122,15 +118,7 @@ public class Mth {
@@ -123,15 +119,7 @@ public class Mth {
}
public static double absMax(double a, double b) {

View File

@@ -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/util/Mth.java b/src/main/java/net/minecraft/util/Mth.java
index 66192e92f18062f6bec377a43d6cfc5b277705a1..c29f12b2da4d0f65673eecc0151e74ff7e9bc26b 100644
index e102c109d01e0f992808a6096b5f6a323b52d970..6a34354958aec331d6417087c4a7d24b49872f36 100644
--- a/src/main/java/net/minecraft/util/Mth.java
+++ b/src/main/java/net/minecraft/util/Mth.java
@@ -149,14 +149,26 @@ public class Mth {
@@ -150,14 +150,26 @@ public class Mth {
return Math.floorMod(dividend, divisor);
}

View File

@@ -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 38f7d1ece27ec1a3deda21fb6a6f0e788c8ed718..90ae117a63f05dfca97de4586217c001f332a55f 100644
index 3554109bcc4651ca93b6275c914e57e007e2204e..d7f11092148f2b4f1aa224906765ab1cbeb81a26 100644
--- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
@@ -26,8 +26,15 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
@@ -27,8 +27,15 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
final CraftingBookCategory category;
final ItemStack result;
final NonNullList<Ingredient> ingredients;
@@ -56,7 +56,7 @@ index 38f7d1ece27ec1a3deda21fb6a6f0e788c8ed718..90ae117a63f05dfca97de4586217c001
this.group = group;
this.category = category;
this.result = result;
@@ -77,6 +84,28 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
@@ -78,6 +85,28 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
}
public boolean matches(CraftingContainer inventory, Level world) {

View File

@@ -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 2f058cec80c6ef7a5a5ca065dc6c9fe353c521de..f2854247ceff3d99f29ced43daa9537aa2ce7549 100644
index 74c596264d4da551437bd2a23e1c70022cfc73fc..adb4cd2a926744182952d0702284f7c7b9e5d42c 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -45,6 +45,45 @@ public abstract class Projectile extends Entity implements TraceableEntity {
@@ -46,6 +46,45 @@ public abstract class Projectile extends Entity implements TraceableEntity {
super(type, world);
}

View File

@@ -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/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
index 6b614818b14ecfc8fc82b523eeb7e21fdf9bf1ba..685823c4c6f175460fdeb84053ea115c24a67909 100644
index dc27ddf5131e7398a5390a5187261d4c7fb6ccaa..f223e369dd8d781e32e1f06572b2ae717afd6f32 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -1,6 +1,6 @@
@@ -18,12 +18,11 @@ index 6b614818b14ecfc8fc82b523eeb7e21fdf9bf1ba..685823c4c6f175460fdeb84053ea115c
import java.time.temporal.ChronoField;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
@@ -241,12 +241,62 @@ public class Bat extends AmbientCreature {
@@ -239,12 +239,60 @@ public class Bat extends AmbientCreature {
}
}
+ // Gale start - predict Halloween
+
+ /**
+ * The 1-indexed month of the year that Halloween starts (inclusive).
+ */
@@ -55,7 +54,6 @@ index 6b614818b14ecfc8fc82b523eeb7e21fdf9bf1ba..685823c4c6f175460fdeb84053ea115c
+ * Will be 0 while not computed yet.
+ */
+ private static long nextHalloweenEnd = 0;
+
+ // Gale end - predict Halloween
+
private static boolean isHalloween() {
@@ -84,4 +82,4 @@ index 6b614818b14ecfc8fc82b523eeb7e21fdf9bf1ba..685823c4c6f175460fdeb84053ea115c
+ // Gale end - predict Halloween
}
@Override
private void setupAnimationStates() {

View File

@@ -19,10 +19,10 @@ require it to be initialized earlier. By moving it to the superclass, we
initialize it earlier, ensuring that it is available sooner.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 2de2c2c09a57f46a7c7ff9603f57c104d5a911d9..62c4576b3e7f50054cca6157019b2b53133009dc 100644
index 3217bfc0df76c4211187fc4643132242c9018c56..76b6cb6015c8d8ad1aca34bfe8ea4f20468f57fb 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -955,7 +955,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -961,7 +961,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
// Paper start - optimise random block ticking
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
@@ -31,7 +31,7 @@ index 2de2c2c09a57f46a7c7ff9603f57c104d5a911d9..62c4576b3e7f50054cca6157019b2b53
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 680cfc6e2e3acd0d5ce364c774772e3c4d072c31..69404b218565db0d73eccb13e56cf27fad443b73 100644
index df7ff0ff2f83dead1d404f033369c0d59cef9089..d934ba31e397fae2498e7c6a9499bc5eb98eb897 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -181,6 +181,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {

View File

@@ -52,22 +52,22 @@ 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/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 20ec10b843f90d2077f49d293d65fa6ed4876961..c43884019b7162c7f58f636a89c7c19c445eec88 100644
index 858ae75ac17612b5856361a7a9a462b1b900efb0..b96ff2f3889a7bee948019810b6a835645ea12bc 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -497,6 +497,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -495,6 +495,7 @@ public class ServerChunkCache extends ChunkSource {
// Paper - optimise chunk tick iteration
+ this.level.resetIceAndSnowTick(); // Gale - Airplane - optimize random calls in chunk ticking - reset ice & snow tick random
if (this.level.getServer().tickRateManager().runsNormally()) {
if (this.level.tickRateManager().runsNormally()) {
this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
int k = this.distanceManager.getNaturalSpawnChunkCount();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 62c4576b3e7f50054cca6157019b2b53133009dc..83c001e809c76a5ec0b314967839713e63d67f0d 100644
index 76b6cb6015c8d8ad1aca34bfe8ea4f20468f57fb..da218c526740244d633b63b537539cb59e505fe7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -957,6 +957,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -963,6 +963,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
// Paper end
@@ -76,7 +76,7 @@ index 62c4576b3e7f50054cca6157019b2b53133009dc..83c001e809c76a5ec0b314967839713e
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
ChunkPos chunkcoordintpair = chunk.getPos();
boolean flag = this.isRaining();
@@ -964,7 +966,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -970,7 +972,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
int k = chunkcoordintpair.getMinBlockZ();
final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
@@ -85,7 +85,7 @@ index 62c4576b3e7f50054cca6157019b2b53133009dc..83c001e809c76a5ec0b314967839713e
blockposition.set(this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15))); // Paper
if (this.isRainingAt(blockposition)) {
@@ -992,7 +994,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -998,7 +1000,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
@@ -95,10 +95,10 @@ index 62c4576b3e7f50054cca6157019b2b53133009dc..83c001e809c76a5ec0b314967839713e
if (this.random.nextInt(48) == 0) {
// Paper start
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index b02a2ca45152693e9974e802866feaa6bd2f2508..3d0b8761866046ae7ee6b5777fb098ce786abd94 100644
index b38cdfdd3681b4f0fe537d4100b14bd017331118..35147d7a6649708c2b068065eb44831f40c3ab8e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -85,6 +85,18 @@ public class LevelChunk extends ChunkAccess {
@@ -87,6 +87,18 @@ public class LevelChunk extends ChunkAccess {
private final LevelChunkTicks<Fluid> fluidTicks;
public volatile FullChunkStatus chunkStatus = FullChunkStatus.INACCESSIBLE; // Paper - rewrite chunk system
@@ -117,7 +117,7 @@ index b02a2ca45152693e9974e802866feaa6bd2f2508..3d0b8761866046ae7ee6b5777fb098ce
public LevelChunk(Level world, ChunkPos pos) {
this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null);
}
@@ -108,6 +120,7 @@ public class LevelChunk extends ChunkAccess {
@@ -110,6 +122,7 @@ public class LevelChunk extends ChunkAccess {
this.postLoad = entityLoader;
this.blockTicks = blockTickScheduler;
this.fluidTicks = fluidTickScheduler;

View File

@@ -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 b0a97679157a18a3c623ce3b2ae315789772c254..5b19da8ec66e482a4e6e61692a8057d2cd652aac 100644
index 260202fab3ac300552c557b44dcf251f083c6a78..15b544bd0794e021ed4a9fde94883bcb5c6a3521 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -333,11 +333,17 @@ public class EnderMan extends Monster implements NeutralMob {
@@ -318,11 +318,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);

View File

@@ -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/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
index 96d664c28738d6090f7067761c2978dd1aa0fd0e..e89942d80b435acbeb7a1d00491c7fdf18e89a3c 100644
index ca7fbe4f8c1e1d2fb90095aa35be4dda3029c23e..4ef55f51f98a4b5c164b40728efd82052c5bf762 100644
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
@@ -687,6 +687,8 @@ public class Inventory implements Container, Nameable {
@@ -643,6 +643,8 @@ public class Inventory implements Container, Nameable {
}
public boolean contains(ItemStack stack) {
@@ -43,9 +43,9 @@ index 96d664c28738d6090f7067761c2978dd1aa0fd0e..e89942d80b435acbeb7a1d00491c7fdf
Iterator iterator = this.compartments.iterator();
while (iterator.hasNext()) {
@@ -701,7 +703,18 @@ public class Inventory implements Container, Nameable {
}
}
@@ -679,25 +681,34 @@ public class Inventory implements Container, Nameable {
return false;
}
+ */
+ for (int i = 0; i < this.compartments.size(); i++) {
@@ -53,12 +53,60 @@ index 96d664c28738d6090f7067761c2978dd1aa0fd0e..e89942d80b435acbeb7a1d00491c7fdf
+ for (int j = 0; j < list.size(); j++) {
+ ItemStack itemstack1 = list.get(j);
- public boolean contains(Predicate<ItemStack> predicate) {
- Iterator iterator = this.compartments.iterator();
-
- while (iterator.hasNext()) {
- List<ItemStack> list = (List) iterator.next();
- Iterator iterator1 = list.iterator();
+ if (!itemstack1.isEmpty() && ItemStack.isSameItem(itemstack1, stack)) {
+ return true;
+ }
+ }
+ }
+ // Gale end - Airplane - remove iterators from Inventory#contains
+ return false;
+ }
- while (iterator1.hasNext()) {
- ItemStack itemstack = (ItemStack) iterator1.next();
+ public boolean containsMatchedMap(Predicate<ItemStack> predicate) {
+ for (int i = 0; i < this.compartments.size(); i++) {
+ List<ItemStack> list = this.compartments.get(i);
+ for (int j = 0; j < list.size(); j++) {
+ ItemStack itemstack1 = list.get(j);
- if (predicate.test(itemstack)) {
+ if (!itemstack1.isEmpty() && predicate.test(itemstack1)) {
return true;
}
}
}
-
return false;
}
+ // Gale end - Airplane - remove iterators from Inventory#contains
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
--- 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 {
Predicate<ItemStack> predicate = MapItemSavedData.mapMatcher(stack);
- if (!player.getInventory().contains(predicate)) {
+ if (!player.getInventory().containsMatchedMap(predicate)) {
this.removeDecoration(player.getName().getString());
}
@@ -302,7 +302,7 @@ public class MapItemSavedData extends SavedData {
MapItemSavedData.HoldingPlayer worldmap_worldmaphumantracker1 = (MapItemSavedData.HoldingPlayer) this.carriedBy.get(i);
String s = worldmap_worldmaphumantracker1.player.getName().getString();
- if (!worldmap_worldmaphumantracker1.player.isRemoved() && (worldmap_worldmaphumantracker1.player.getInventory().contains(predicate) || stack.isFramed())) {
+ if (!worldmap_worldmaphumantracker1.player.isRemoved() && (worldmap_worldmaphumantracker1.player.getInventory().containsMatchedMap(predicate) || stack.isFramed())) {
if (!stack.isFramed() && worldmap_worldmaphumantracker1.player.level().dimension() == this.dimension && this.trackingPosition) {
this.addDecoration(MapDecorationTypes.PLAYER, worldmap_worldmaphumantracker1.player.level(), s, worldmap_worldmaphumantracker1.player.getX(), worldmap_worldmaphumantracker1.player.getZ(), (double) worldmap_worldmaphumantracker1.player.getYRot(), (Component) null);
}

View File

@@ -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 8b3f630fddb1cd7f87664711532bde8bb78d9c90..d422047e55c40062203e67d3fd5d3f2b9d5ce0f9 100644
index 1c69e41e0a6c908eb9530cdbac3137b2e399a552..526fb1161605a2b7243d9f78216883918c3bf210 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1138,6 +1138,13 @@ public final class CraftServer implements Server {
@@ -1139,6 +1139,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."
));

View File

@@ -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 c49b788af3f66edaef4aa153e6cb323283e552f8..d30b0eefaeb2bc07a7b6871ff8a827ec48bd5f44 100644
index f5252fb595683797b3f3ca3cece74d2482a79299..05f9d4c9603247802b279976d56b25cd0cf83d3a 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -143,7 +143,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@@ -150,7 +150,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
// CraftBukkit end
@@ -42,7 +42,7 @@ index c49b788af3f66edaef4aa153e6cb323283e552f8..d30b0eefaeb2bc07a7b6871ff8a827ec
public abstract class LivingEntity extends Entity implements Attackable {
@@ -2022,6 +2021,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -2048,6 +2047,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
return this.lastClimbablePos;
}

View File

@@ -188,7 +188,7 @@ index 241fec02e6869c638d3a160819b32173a081467b..1380f521de979b8734ebd13dd420b312
public int getContainerSize() {
return this.container1.getContainerSize() + this.container2.getContainerSize();
diff --git a/src/main/java/net/minecraft/world/Container.java b/src/main/java/net/minecraft/world/Container.java
index d6cbe98e67fdbf8db46338a88ab1356dd63b50a3..adbc0a9caf5daad2655658f06e42d75270b574b0 100644
index f402dbbfe3a443e6bc51f88b85abe937852b52f0..2c6388d892d0b58ba1800b795418fc9541c3b94c 100644
--- a/src/main/java/net/minecraft/world/Container.java
+++ b/src/main/java/net/minecraft/world/Container.java
@@ -3,6 +3,8 @@ package net.minecraft.world;
@@ -262,13 +262,13 @@ index d6cbe98e67fdbf8db46338a88ab1356dd63b50a3..adbc0a9caf5daad2655658f06e42d752
+ }
+ // Gale end - Airplane - improve container checking with a bitset - allow the inventory to override and optimize these frequent calls
int LARGE_MAX_STACK_SIZE = 64;
int DEFAULT_DISTANCE_LIMIT = 8;
float DEFAULT_DISTANCE_BUFFER = 4.0F;
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
index 756d0434472921992c9d84597d7c9c824e93614c..9a804cdfe86475a0dcef394d13f40fa27ceec269 100644
index 2704389bc3ec6dbbf1b568a4380972f8c0d62d15..d6c2455f41024dd839986cce70fd27d804c3da58 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java
@@ -28,7 +28,10 @@ import org.bukkit.inventory.InventoryHolder;
@@ -30,7 +30,10 @@ import org.bukkit.inventory.InventoryHolder;
public abstract class AbstractMinecartContainer extends AbstractMinecart implements ContainerEntity {
@@ -277,9 +277,9 @@ index 756d0434472921992c9d84597d7c9c824e93614c..9a804cdfe86475a0dcef394d13f40fa2
+ private gg.airplane.structs.ItemListWithBitset itemStacksOptimized;
+ // Gale end - Airplane - improve container checking with a bitset
@Nullable
public ResourceLocation lootTable;
public ResourceKey<LootTable> lootTable;
public long lootTableSeed;
@@ -90,12 +93,18 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
@@ -92,12 +95,18 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
protected AbstractMinecartContainer(EntityType<?> type, Level world) {
super(type, world);
@@ -300,7 +300,7 @@ index 756d0434472921992c9d84597d7c9c824e93614c..9a804cdfe86475a0dcef394d13f40fa2
}
@Override
@@ -164,6 +173,10 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
@@ -166,6 +175,10 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme
protected void readAdditionalSaveData(CompoundTag nbt) {
super.readAdditionalSaveData(nbt);
this.lootableData.loadNbt(nbt); // Paper
@@ -308,14 +308,39 @@ index 756d0434472921992c9d84597d7c9c824e93614c..9a804cdfe86475a0dcef394d13f40fa2
+ this.itemStacksOptimized = new gg.airplane.structs.ItemListWithBitset(this.getContainerSize());
+ this.itemStacks = this.itemStacksOptimized.nonNullList;
+ // Gale end - Airplane - improve container checking with a bitset
this.readChestVehicleSaveData(nbt);
this.readChestVehicleSaveData(nbt, this.registryAccess());
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
index 02675f15e157ce68506c813b19cf5472bf67bc00..6cec1f6fd6cbcb4080b7601edeaa16e69967813e 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
@@ -119,19 +119,7 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
@Override
public boolean isEmpty() {
- Iterator iterator = this.getItems().iterator();
-
- ItemStack itemstack;
-
- do {
- if (!iterator.hasNext()) {
- return true;
- }
-
- itemstack = (ItemStack) iterator.next();
- } while (itemstack.isEmpty());
-
- return false;
+ return this.isCompletelyEmpty(null); // Gale - Airplane - improve container checking with a bitset - use super
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
index 9b1243d96e0694c62fc9e82e9be540bce0d2b3ad..0d7a80824bf0ce921070dea02220ca650002f94c 100644
index b88aa184cd06a0485146f58a5b61a56a50911209..bf7ec7196d02553bc26caf87213fa24183312de3 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
@@ -31,7 +31,10 @@ import org.bukkit.entity.HumanEntity;
@@ -32,7 +32,10 @@ import org.bukkit.entity.HumanEntity;
public class ChestBlockEntity extends RandomizableContainerBlockEntity implements LidBlockEntity {
private static final int EVENT_SET_OPEN_COUNT = 1;
@@ -326,7 +351,7 @@ index 9b1243d96e0694c62fc9e82e9be540bce0d2b3ad..0d7a80824bf0ce921070dea02220ca65
public final ContainerOpenersCounter openersCounter;
private final ChestLidController chestLidController;
@@ -65,9 +68,13 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
@@ -66,9 +69,13 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
}
// CraftBukkit end
@@ -341,7 +366,7 @@ index 9b1243d96e0694c62fc9e82e9be540bce0d2b3ad..0d7a80824bf0ce921070dea02220ca65
this.openersCounter = new ContainerOpenersCounter() {
@Override
protected void onOpen(Level world, BlockPos pos, BlockState state) {
@@ -98,6 +105,23 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
@@ -99,6 +106,23 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
this.chestLidController = new ChestLidController();
}
@@ -365,46 +390,46 @@ index 9b1243d96e0694c62fc9e82e9be540bce0d2b3ad..0d7a80824bf0ce921070dea02220ca65
public ChestBlockEntity(BlockPos pos, BlockState state) {
this(BlockEntityType.CHEST, pos, state);
}
@@ -115,7 +139,10 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
@@ -116,7 +140,10 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
@Override
public void load(CompoundTag nbt) {
super.load(nbt);
protected void loadAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) {
super.loadAdditional(nbt, registryLookup);
- this.items = NonNullList.withSize(this.getContainerSize(), ItemStack.EMPTY);
+ // Gale start - Airplane - improve container checking with a bitset
+ this.optimizedItems = new gg.airplane.structs.ItemListWithBitset(this.getContainerSize());
+ this.items = this.optimizedItems.nonNullList;
+ // Gale end - Airplane - improve container checking with a bitset
if (!this.tryLoadLootTable(nbt)) {
ContainerHelper.loadAllItems(nbt, this.items);
ContainerHelper.loadAllItems(nbt, this.items, registryLookup);
}
@@ -187,7 +214,10 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
@@ -188,7 +215,10 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
@Override
protected void setItems(NonNullList<ItemStack> list) {
- this.items = list;
protected void setItems(NonNullList<ItemStack> inventory) {
- this.items = inventory;
+ // Gale start - Airplane - improve container checking with a bitset
+ this.optimizedItems = gg.airplane.structs.ItemListWithBitset.fromList(list);
+ this.optimizedItems = gg.airplane.structs.ItemListWithBitset.fromList(inventory);
+ this.items = this.optimizedItems.nonNullList;
+ // Gale end - Airplane - improve container checking with a bitset
}
@Override
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 cdb739df2a285032d25d84f4464f202a7a3fa578..a2e314549f4b4182a817ecd477235f56fb95c5f5 100644
index da30c7fd750aa7b912310368100a5261c189715f..5ba7feada898b27aa651f4dab0595b2ad28b68d0 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
@@ -48,7 +48,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -47,7 +47,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
public static final int MOVE_ITEM_SPEED = 8;
public static final int HOPPER_CONTAINER_SIZE = 5;
private static final int[][] CACHED_SLOTS = new int[54][];
+ // Gale start - Airplane - improve container checking with a bitset
private NonNullList<ItemStack> items;
+ private gg.airplane.structs.ItemListWithBitset optimizedItems;
+ // Gale end - Airplane - improve container checking with a bitset
public int cooldownTime;
private long tickedGameTime;
@@ -84,14 +87,37 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
private Direction facing;
@@ -84,15 +87,38 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
public HopperBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntityType.HOPPER, pos, state);
@@ -414,6 +439,7 @@ index cdb739df2a285032d25d84f4464f202a7a3fa578..a2e314549f4b4182a817ecd477235f56
+ this.items = this.optimizedItems.nonNullList;
+ // Gale end - Airplane - improve container checking with a bitset
this.cooldownTime = -1;
this.facing = (Direction) state.getValue(HopperBlock.FACING);
}
+ // Gale start - Airplane - improve container checking with a bitset
@@ -434,18 +460,18 @@ index cdb739df2a285032d25d84f4464f202a7a3fa578..a2e314549f4b4182a817ecd477235f56
+ // Gale end - Airplane - improve container checking with a bitset
+
@Override
public void load(CompoundTag nbt) {
super.load(nbt);
protected void loadAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) {
super.loadAdditional(nbt, registryLookup);
- this.items = NonNullList.withSize(this.getContainerSize(), ItemStack.EMPTY);
+ // Gale start - Airplane - improve container checking with a bitset
+ this.optimizedItems = new gg.airplane.structs.ItemListWithBitset(this.getContainerSize());
+ this.items = this.optimizedItems.nonNullList;
+ // Gale end - Airplane - improve container checking with a bitset
if (!this.tryLoadLootTable(nbt)) {
ContainerHelper.loadAllItems(nbt, this.items);
ContainerHelper.loadAllItems(nbt, this.items, registryLookup);
}
@@ -202,7 +228,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
flag = HopperBlockEntity.ejectItems(world, pos, state, (Container) blockEntity, blockEntity); // CraftBukkit
@@ -205,7 +231,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
flag = HopperBlockEntity.ejectItems(world, pos, blockEntity);
}
- if (fullState != HOPPER_IS_FULL || flag) { // Paper - Perf: Optimize Hoppers
@@ -453,7 +479,7 @@ index cdb739df2a285032d25d84f4464f202a7a3fa578..a2e314549f4b4182a817ecd477235f56
flag |= booleansupplier.getAsBoolean();
}
@@ -242,7 +268,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -245,7 +271,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
skipPushModeEventFire = skipHopperEvents;
boolean foundItem = false;
for (int i = 0; i < hopper.getContainerSize(); ++i) {
@@ -462,16 +488,7 @@ index cdb739df2a285032d25d84f4464f202a7a3fa578..a2e314549f4b4182a817ecd477235f56
if (!item.isEmpty()) {
foundItem = true;
ItemStack origItemStack = item;
@@ -514,7 +540,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
}
private static boolean isEmptyContainer(Container inv, Direction facing) {
- return allMatch(inv, facing, IS_EMPTY_TEST); // Paper - Perf: Optimize Hoppers
+ return inv.isCompletelyEmpty(facing); // Paper - Perf: Optimize Hoppers // Gale - Airplane - improve container checking with a bitset - use bitsets
}
public static boolean suckInItems(Level world, Hopper hopper) {
@@ -714,7 +740,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -722,7 +748,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
if (HopperBlockEntity.canPlaceItemInContainer(to, stack, slot, side)) {
boolean flag = false;
@@ -480,33 +497,15 @@ index cdb739df2a285032d25d84f4464f202a7a3fa578..a2e314549f4b4182a817ecd477235f56
if (itemstack1.isEmpty()) {
// Spigot start - SPIGOT-6693, InventorySubcontainer#setItem
@@ -909,7 +935,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -910,7 +936,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@Override
protected void setItems(NonNullList<ItemStack> list) {
- this.items = list;
protected void setItems(NonNullList<ItemStack> inventory) {
- this.items = inventory;
+ // Gale start - Airplane - improve container checking with a bitset
+ this.optimizedItems = gg.airplane.structs.ItemListWithBitset.fromList(list);
+ this.optimizedItems = gg.airplane.structs.ItemListWithBitset.fromList(inventory);
+ this.items = this.optimizedItems.nonNullList;
+ // Gale end - Airplane - improve container checking with a bitset
}
public static void entityInside(Level world, BlockPos pos, BlockState state, Entity entity, HopperBlockEntity blockEntity) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
index dfd1246b735fe64c5beae83567a013861eb00822..c547a53433a0e8e74403aa6bd36c4dd177350a11 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
@@ -94,12 +94,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
public boolean isEmpty() {
this.unpackLootTable(null);
// Paper start - Perf: Optimize Hoppers
- for (final ItemStack itemStack : this.getItems()) {
- if (!itemStack.isEmpty()) {
- return false;
- }
- }
- return true;
+ return this.isCompletelyEmpty(null); // Gale - Airplane - improve container checking with a bitset - use super
// Paper end - Perf: Optimize Hoppers
}

View File

@@ -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/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 0948e253b95312998d498be7cd7a123bbe06376b..84021917524447938cb7f0877647565698f7d4e1 100644
index d934ba31e397fae2498e7c6a9499bc5eb98eb897..0c0396e0d3e23485a069a8b6bbd637826a7b1119 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -218,6 +218,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -50,8 +50,8 @@ index 0948e253b95312998d498be7cd7a123bbe06376b..84021917524447938cb7f08776475656
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
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
@@ -240,6 +249,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
});
@@ -237,6 +246,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.dimensionTypeRegistration = holder;
final DimensionType dimensionmanager = (DimensionType) holder.value();
+ // Gale start - Airplane - inline level height

View File

@@ -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/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 71581713596594f8f8c39dac4971111e1a2cad3d..ffa5f8be4aefb451352e1c6db84f36adca3a044d 100644
index 7e707fe1d800debf1eef8800fe98eb4e1dbd800b..d0383cef6e204cc806903666d296287e1c530ed3 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -423,13 +423,14 @@ public final class NaturalSpawner {
@@ -406,13 +406,14 @@ public final class NaturalSpawner {
}
}

View File

@@ -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 f07a0008387c18dae5b133b90ed291b364428d02..76604a8d3aa6ce7b3c7abfb37f1a059a9e793fe0 100644
index e1e4f32852351dbc122e53fc56e2359f835a938f..aaff62e2706b67772684193a9d05ebda1ff9e343 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1441,8 +1441,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1455,8 +1455,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
}
@@ -65,7 +65,7 @@ index f07a0008387c18dae5b133b90ed291b364428d02..76604a8d3aa6ce7b3c7abfb37f1a059a
Iterator iterator = this.entity.getIndirectPassengers().iterator();
while (iterator.hasNext()) {
@@ -1454,6 +1476,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1468,6 +1490,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
i = j;
}
}

View File

@@ -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 d7da3bb9e6c7900a211ddd35471799d9a3d63f17..34be1098c1c1bf1e5de7034afe02579d9680fd23 100644
index c3f260004ca0577f19cb047071969e173a303081..1549876d9888571449d54461024c331580ea7bf7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -502,6 +502,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -504,6 +504,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this));
}
// Paper end - optimise entity tracking
@@ -43,27 +43,27 @@ index d7da3bb9e6c7900a211ddd35471799d9a3d63f17..34be1098c1c1bf1e5de7034afe02579d
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 b99a080ab27e24d8131fda931ca70d6d271bb01c..5d34e5bd3ff2954b009f7a99954c0f1cc0d5755e 100644
index 9ef8f014af332da129bfcd3370da983ec035ecc6..665fbe3362dcd9de4bd290b71a1b1f2fed218eeb 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
@@ -23,9 +23,11 @@ public class AttributeMap {
private final Map<Attribute, AttributeInstance> attributes = Maps.newHashMap();
private final Set<AttributeInstance> dirtyAttributes = Sets.newHashSet();
@@ -22,9 +22,11 @@ public class AttributeMap {
private final Map<Holder<Attribute>, AttributeInstance> attributes = new Object2ObjectOpenHashMap<>();
private final Set<AttributeInstance> dirtyAttributes = new ObjectOpenHashSet<>();
private final AttributeSupplier supplier;
+ private final java.util.function.Function<Attribute, AttributeInstance> createInstance; // Gale - Airplane - reduce entity allocations
+ private final java.util.function.Function<Holder<Attribute>, AttributeInstance> createInstance; // Gale - Airplane - reduce entity allocations
public AttributeMap(AttributeSupplier defaultAttributes) {
this.supplier = defaultAttributes;
+ this.createInstance = attribute -> this.supplier.createInstance(this::onAttributeModified, attribute); // Gale - Airplane - reduce entity allocations
+ this.createInstance = attributex -> this.supplier.createInstance(this::onAttributeModified, attributex); // Gale - Airplane - reduce entity allocations
}
private void onAttributeModified(AttributeInstance instance) {
@@ -44,7 +46,7 @@ public class AttributeMap {
@@ -43,7 +45,7 @@ public class AttributeMap {
@Nullable
public AttributeInstance getInstance(Attribute attribute) {
public AttributeInstance getInstance(Holder<Attribute> attribute) {
- return this.attributes.computeIfAbsent(attribute, attributex -> this.supplier.createInstance(this::onAttributeModified, attributex));
+ return this.attributes.computeIfAbsent(attribute, this.createInstance); // Gale - Airplane - reduce entity allocations - cache lambda, as for some reason java allocates it anyways
}
@Nullable
public boolean hasAttribute(Holder<Attribute> attribute) {

View File

@@ -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/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 55b59745b7d3cc245c4768b5d2e6bf277a34d1b4..86a2f955dc981dd95091b70d6600ff94ce4dc714 100644
index da218c526740244d633b63b537539cb59e505fe7..92a53e55e6431a2748e5a489ca0375930087c3cf 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -894,7 +894,20 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -900,7 +900,20 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.stopRiding();
}
@@ -57,10 +57,10 @@ index 55b59745b7d3cc245c4768b5d2e6bf277a34d1b4..86a2f955dc981dd95091b70d6600ff94
}
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 84021917524447938cb7f0877647565698f7d4e1..9440dd58325df07521ef52373089e6989105ba4b 100644
index 0c0396e0d3e23485a069a8b6bbd637826a7b1119..50f660de3d94c2b30668f8fd09a590a2d1b3ba16 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1331,13 +1331,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1325,13 +1325,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try {
tickConsumer.accept(entity);
MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick

View File

@@ -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 fbb453420aa6f4688aa6b2bd07b099aa5e8b912e..dc38b98d4ec1eec60725fcb00c09ac7a3ca427a9 100644
index 1549876d9888571449d54461024c331580ea7bf7..d0fa080acc1877fe66672387c0b1f00e6cebf041 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4405,16 +4405,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4462,16 +4462,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
@@ -60,7 +60,7 @@ index fbb453420aa6f4688aa6b2bd07b099aa5e8b912e..dc38b98d4ec1eec60725fcb00c09ac7a
double d1 = 0.0D;
boolean flag = this.isPushedByFluid();
boolean flag1 = false;
@@ -4422,14 +4424,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4479,14 +4481,61 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
int k1 = 0;
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
@@ -128,7 +128,7 @@ index fbb453420aa6f4688aa6b2bd07b099aa5e8b912e..dc38b98d4ec1eec60725fcb00c09ac7a
if (d2 >= axisalignedbb.minY) {
flag1 = true;
@@ -4451,9 +4500,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4508,9 +4557,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit end
}
}
@@ -142,7 +142,7 @@ index fbb453420aa6f4688aa6b2bd07b099aa5e8b912e..dc38b98d4ec1eec60725fcb00c09ac7a
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 796bbef3544e06b8e7aac7e8ac5f740a2613f4bd..f34b5ecf71602c95208d0f72e56c636b3a2bc34a 100644
index a2a5aef769ee8bb638a5a9f3da9812fa4a85dda5..121459fdb47904d448f86362f535765c713a4b67 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 {

View File

@@ -13,10 +13,10 @@ 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 8b5e71d2847db5e737f5380f41cc4696a038c397..8ad208f318b8350dda538976ff17cf4a4b009003 100644
index 77df57490bf3c107eff5527506256610fd8fe1f3..e9b050f744391444714c8803835d78d0415f96ce 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -72,6 +72,7 @@ tasks.withType<JavaCompile> {
@@ -79,6 +79,7 @@ tasks.withType<JavaCompile> {
compilerArgs.add("-Xlint:-module")
compilerArgs.add("-Xlint:-removal")
compilerArgs.add("-Xlint:-dep-ann")
@@ -24,7 +24,7 @@ index 8b5e71d2847db5e737f5380f41cc4696a038c397..8ad208f318b8350dda538976ff17cf4a
}
// Gale end - hide irrelevant compilation warnings
@@ -191,6 +192,7 @@ fun TaskContainer.registerRunTask(
@@ -182,6 +183,7 @@ fun TaskContainer.registerRunTask(
minHeapSize = "${memoryGb}G"
maxHeapSize = "${memoryGb}G"
jvmArgs("--enable-preview") // Gale - enable preview features for development runs
@@ -84,7 +84,7 @@ 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 fc72e121d1af5436524f2027adbf3ef2a62e8152..cd49cd980a747e88725507c53f9697b40158f09a 100644
index 7c60cc310be57ffc5fbd5a0654059cd2846ef945..28412943a1ce919da3c8731a441b5a1b3b893293 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;
@@ -96,7 +96,7 @@ index fc72e121d1af5436524f2027adbf3ef2a62e8152..cd49cd980a747e88725507c53f9697b4
import net.minecraft.DefaultUncaughtExceptionHandler;
import net.minecraft.DefaultUncaughtExceptionHandlerWithName;
import net.minecraft.SharedConstants;
@@ -46,6 +48,7 @@ import net.minecraft.world.level.GameType;
@@ -51,6 +53,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 fc72e121d1af5436524f2027adbf3ef2a62e8152..cd49cd980a747e88725507c53f9697b4
import org.slf4j.Logger;
// CraftBukkit start
@@ -223,6 +226,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -236,6 +239,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // Paper - init PaperBrigadierProvider

View File

@@ -22,10 +22,10 @@ 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 ab5b259d8f72022c875cae73be25fe2da346c6b3..f6b847f9cf1a97f186ba9a9d1d540ef56c41ebc4 100644
index 8e67853a7a93fa736c147e8b2df537746dc8e94f..cb3b10cc96c15a4894b3239110ee60f4aa130e05 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -186,6 +186,8 @@ import net.minecraft.world.phys.Vec3;
@@ -193,6 +193,8 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
@@ -34,7 +34,7 @@ index ab5b259d8f72022c875cae73be25fe2da346c6b3..f6b847f9cf1a97f186ba9a9d1d540ef5
import org.slf4j.Logger;
// CraftBukkit start
@@ -1135,6 +1137,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1154,6 +1156,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleEditBook(ServerboundEditBookPacket packet) {
@@ -45,7 +45,7 @@ index ab5b259d8f72022c875cae73be25fe2da346c6b3..f6b847f9cf1a97f186ba9a9d1d540ef5
+ // Gale end - Pufferfish - make book writing configurable
// Paper start - Book size limits
if (!this.cserver.isPrimaryThread()) {
List<String> pageList = packet.getPages();
List<String> pageList = packet.pages();
diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
index 0a808c5d242b2d9bea82d9d219227fbaf5741bf4..7d66126c1f5957c109a2426d53f5d0072886309b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java

View File

@@ -22,7 +22,7 @@ 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 4ca8f36bb88fbd45720ea12fe524d671b5aeb791..898d29e138d1bee811510d3568597c49f9c2cf00 100644
index 15dddb035c7ae3aca9b5cd5a5f56e0407641d9dd..7d941808d1cf3ba22ee8c358d63ea6e289609184 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 {
@@ -35,10 +35,10 @@ index 4ca8f36bb88fbd45720ea12fe524d671b5aeb791..898d29e138d1bee811510d3568597c49
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 dc38b98d4ec1eec60725fcb00c09ac7a3ca427a9..f369a104d147205520f3e89dccd6180db0773121 100644
index d0fa080acc1877fe66672387c0b1f00e6cebf041..2ff752dfc7dcee936611613da934ccebe45c1cae 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -309,7 +309,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -312,7 +312,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public double yo;
public double zo;
private Vec3 position;

View File

@@ -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 b62041ee8d550bdeb654f9fac386135d8258182d..1798862ef457dddfa907ec5d903bd5461a044858 100644
index 05f9d4c9603247802b279976d56b25cd0cf83d3a..b095a5b4c2390bc3e52f8bb559c621ecb42db2c6 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -412,7 +412,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -425,7 +425,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 b62041ee8d550bdeb654f9fac386135d8258182d..1798862ef457dddfa907ec5d903bd546
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();
@@ -1415,6 +1418,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1428,6 +1431,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
return this.getHealth() <= 0.0F;
}

View File

@@ -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/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
index 0af9ed92824ccf30814eceb6a2c2e5c12661c991..cb5502ef7a9f4c5dcbbb794371daffb92c456b00 100644
index 300929a406905f5ff1ede664d5b99fb0938d4d2e..e5625557d2cd70b19b9db5fd418c243b639188e8 100644
--- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
@@ -8,6 +8,7 @@ import javax.annotation.Nullable;
@@ -24,15 +24,15 @@ index 0af9ed92824ccf30814eceb6a2c2e5c12661c991..cb5502ef7a9f4c5dcbbb794371daffb9
import org.slf4j.Logger;
public class SignedMessageChain {
@@ -37,7 +38,7 @@ public class SignedMessageChain {
throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false); // Paper - diff on change (if disconnects, need a new kick event cause)
} else if (playerPublicKey.data().hasExpired()) {
throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey"), false, org.bukkit.event.player.PlayerKickEvent.Cause.EXPIRED_PROFILE_PUBLIC_KEY); // Paper - kick event causes
- } else if (body.timeStamp().isBefore(this.lastTimeStamp)) {
+ } else if (body.timeStamp().isBefore(this.lastTimeStamp) && GaleGlobalConfiguration.get().misc.verifyChatOrder) { // Gale - Pufferfish - make chat order verification configurable
throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.out_of_order_chat"), true, org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes
@@ -45,7 +46,7 @@ public class SignedMessageChain {
SignedMessageLink signedMessageLink = SignedMessageChain.this.nextLink;
if (signedMessageLink == null) {
throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.CHAIN_BROKEN);
- } else if (body.timeStamp().isBefore(SignedMessageChain.this.lastTimeStamp)) {
+ } else if (body.timeStamp().isBefore(SignedMessageChain.this.lastTimeStamp) && GaleGlobalConfiguration.get().misc.verifyChatOrder) { // Gale - Pufferfish - make chat order verification configurable
this.setChainBroken();
throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.OUT_OF_ORDER_CHAT, org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes
} else {
this.lastTimeStamp = body.timeStamp();
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 346fdf6f8a76539fa9ca46015ee122417e4a8102..7c781eabbb6df5df9f9f2cbdeef4e116ca30b645 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java

View File

@@ -26,13 +26,13 @@ search to attempt respawning the ender dragon whenever a player places
an end crystal.
diff --git a/src/main/java/net/minecraft/world/item/EndCrystalItem.java b/src/main/java/net/minecraft/world/item/EndCrystalItem.java
index e1696f6b77df4c8fceaece64701d4db78b0a4c42..a0bc8bb8d88e96457a2be0befe1fd69ef4973e11 100644
index dd1bdb4bb87a3a59c229ba76b36841d199717624..ded33fd166cbb95917f7e321875acc4222caff46 100644
--- a/src/main/java/net/minecraft/world/item/EndCrystalItem.java
+++ b/src/main/java/net/minecraft/world/item/EndCrystalItem.java
@@ -53,11 +53,13 @@ public class EndCrystalItem extends Item {
@@ -54,11 +54,13 @@ public class EndCrystalItem extends Item {
// CraftBukkit end
world.addFreshEntity(entityendercrystal);
world.gameEvent((Entity) context.getPlayer(), GameEvent.ENTITY_PLACE, blockposition1);
world.gameEvent((Entity) context.getPlayer(), (Holder) GameEvent.ENTITY_PLACE, blockposition1);
+ if (world.galeConfig().gameplayMechanics.tryRespawnEnderDragonAfterEndCrystalPlace) { // Gale - Pufferfish - make ender dragon respawn attempt after placing end crystals configurable
EndDragonFight enderdragonbattle = ((ServerLevel) world).getDragonFight();

View File

@@ -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 5b3b59057b962438c6f4fc8a1507342865b3bc11..1f39b1af8ba1264d58ddf342ed9472bda01b5ad2 100644
index 3df4005b6ddc075e5922c1e96e4ceb21d8b8ea43..941274636eb635bc2c91bffa55436a5a5a78fcd2 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
@@ -355,4 +355,12 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
public boolean isAttackable() {
return false;
@@ -348,4 +348,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
private static ItemStack getDefaultItem() {
return new ItemStack(Items.FIREWORK_ROCKET);
}
+
+ // Gale start - EMC - make saving fireworks configurable
@@ -34,7 +34,6 @@ index 5b3b59057b962438c6f4fc8a1507342865b3bc11..1f39b1af8ba1264d58ddf342ed9472bd
+ return this.level().galeConfig().smallOptimizations.saveFireworks;
+ }
+ // Gale end - EMC - make saving fireworks configurable
+
}
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
index 7e7e01f6514f6bbb9c89dc3c878fb6da25eb6b1f..00a327bd0e4e0f2def0bb29d5ecff4f0ec4ba1eb 100644

View File

@@ -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/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
index 1de09539877d40b7bdcdc8a10d1d30c81420aa5b..57be35f6a3954aec8b3b039c1d7bb02f8359cf5b 100644
index 17da915ffa638500a83b67db0940a7b9a9b333a1..e47c9481f39426e1767e73275edbf9a1d298caea 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
@@ -68,6 +68,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
@@ -74,6 +74,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
@Override
public void unpackLootTable(@org.jetbrains.annotations.Nullable final Player player) {

View File

@@ -17,12 +17,12 @@ 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 29ce703a79f7893ac990ad80e0f1c1cf63546e6c..293bc6e40fec09a8ec5cac901d52cc3f7e9b9ea3 100644
index 8fd3845c4965843be9c37498760d93f1ebdff541..8a5cbe95022a3ae41283f4f884d8b2f7eae0cd34 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -14,11 +14,13 @@ import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
@@ -22,11 +22,13 @@ import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MoverType;
import net.minecraft.world.entity.SlotAccess;
import net.minecraft.world.entity.TraceableEntity;
+import net.minecraft.world.entity.vehicle.MinecartHopper;
import net.minecraft.world.item.Item;
@@ -32,9 +32,9 @@ index 29ce703a79f7893ac990ad80e0f1c1cf63546e6c..293bc6e40fec09a8ec5cac901d52cc3f
import net.minecraft.world.level.gameevent.GameEvent;
+import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
@@ -228,11 +230,31 @@ public class ItemEntity extends Entity implements TraceableEntity {
// CraftBukkit start
import net.minecraft.server.MinecraftServer;
@@ -234,11 +236,31 @@ public class ItemEntity extends Entity implements TraceableEntity {
}
// CraftBukkit end
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
@@ -66,7 +66,7 @@ index 29ce703a79f7893ac990ad80e0f1c1cf63546e6c..293bc6e40fec09a8ec5cac901d52cc3f
// Spigot start - copied from above
@Override
public void inactiveTick() {
@@ -252,7 +274,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
@@ -258,7 +280,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
}
// CraftBukkit end
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
@@ -81,7 +81,7 @@ index 29ce703a79f7893ac990ad80e0f1c1cf63546e6c..293bc6e40fec09a8ec5cac901d52cc3f
// Spigot end
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
index 761142374f793a1cd4228936b21a68d7a0458894..06a697757aaa10ded293ee26117153b66702e77b 100644
index d7f8464bf3eed0e42a5fc7f14a5b243d171f8b5e..7b69243130829334c1a592026adf8fce3609f25c 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java
@@ -17,6 +17,7 @@ import net.minecraft.world.level.block.state.BlockState;
@@ -92,7 +92,7 @@ index 761142374f793a1cd4228936b21a68d7a0458894..06a697757aaa10ded293ee26117153b6
public MinecartHopper(EntityType<? extends MinecartHopper> type, Level world) {
super(type, world);
@@ -131,4 +132,12 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
@@ -136,4 +137,12 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
}
// Paper end
@@ -106,11 +106,11 @@ index 761142374f793a1cd4228936b21a68d7a0458894..06a697757aaa10ded293ee26117153b6
+
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/Hopper.java b/src/main/java/net/minecraft/world/level/block/entity/Hopper.java
index 25cae6cb4127083cb47966ed7bb58a9a61e4310f..3cd850744b4b35c2abe2fde7ddc6ce227cbf45c0 100644
index 5f042e294db605827000123252b0df646968f897..e1cc15f28fe8da23b74ff4504c5b2da2236fda3f 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/Hopper.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/Hopper.java
@@ -14,6 +14,8 @@ public interface Hopper extends Container {
return SUCK;
@@ -11,6 +11,8 @@ public interface Hopper extends Container {
return SUCK_AABB;
}
+ long getAndIncrementAttemptCounter(); // Gale - EMC - reduce hopper item checks
@@ -119,13 +119,13 @@ index 25cae6cb4127083cb47966ed7bb58a9a61e4310f..3cd850744b4b35c2abe2fde7ddc6ce22
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 a2e314549f4b4182a817ecd477235f56fb95c5f5..7ecf0ff4dc106999d1f3a419482f9bf1510335e6 100644
index 5ba7feada898b27aa651f4dab0595b2ad28b68d0..4f5a1d7dfabdf03f708ad5773a15369bcbe62523 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.Direction;
import net.minecraft.core.NonNullList;
@@ -11,6 +11,7 @@ import net.minecraft.core.NonNullList;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.tags.BlockTags;
+import net.minecraft.server.MinecraftServer;
import net.minecraft.world.CompoundContainer;
import net.minecraft.world.Container;
@@ -138,25 +138,17 @@ index a2e314549f4b4182a817ecd477235f56fb95c5f5..7ecf0ff4dc106999d1f3a419482f9bf1
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.HopperMenu;
import net.minecraft.world.item.ItemStack;
@@ -576,7 +578,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
return false;
}
// Paper end - Perf: Optimize Hoppers
- } else {
+ } else if (shouldSuckIn(world, hopper)) { // Gale - EMC - reduce hopper item checks
@@ -588,7 +590,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
} else {
boolean flag = hopper.isGridAligned() && iblockdata.isCollisionShapeFullBlock(world, blockposition) && !iblockdata.is(BlockTags.DOES_NOT_BLOCK_HOPPERS);
- if (!flag) {
+ if (!flag && shouldSuckIn(world, hopper)) { // Gale - EMC - reduce hopper item checks
Iterator iterator = HopperBlockEntity.getItemsAtAndAbove(world, hopper).iterator();
ItemEntity entityitem;
@@ -591,6 +593,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
return true;
}
+ return false; // Gale - EMC - reduce hopper item checks
}
@io.papermc.paper.annotation.DoNotUse // Paper - method unused as logic is inlined above
@@ -901,6 +904,31 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
return first.getCount() < first.getMaxStackSize() && first.is(second.getItem()) && first.getDamageValue() == second.getDamageValue() && ((first.isEmpty() && second.isEmpty()) || java.util.Objects.equals(first.getTag(), second.getTag())); // Paper - Perf: Optimize Hoppers; used to return true for full itemstacks?!
while (iterator.hasNext()) {
@@ -897,6 +899,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?!
}
+ // Gale start - EMC - reduce hopper item checks

View File

@@ -18,7 +18,7 @@ Helps 1.8 Farms let hoppers pick it up before Villager
due to our hopper changes
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
index 92bd58010e8c89e361e28aec59447349edbbc028..2239c7260638bb25df5b45dbc129bcfe1530bc59 100644
index d98b28e9488a5a7736719cf656736bb026ec8c7e..74fe07a3737728b67987ef794103346c1e428109 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
@@ -21,6 +21,7 @@ import net.minecraft.world.entity.ai.memory.NearestVisibleLivingEntities;
@@ -29,7 +29,7 @@ index 92bd58010e8c89e361e28aec59447349edbbc028..2239c7260638bb25df5b45dbc129bcfe
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.ProjectileWeaponItem;
@@ -101,7 +102,16 @@ public class BehaviorUtils {
@@ -99,7 +100,16 @@ public class BehaviorUtils {
vec3d2 = vec3d2.normalize().multiply(velocityFactor.x, velocityFactor.y, velocityFactor.z);
entityitem.setDeltaMovement(vec3d2);

View File

@@ -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 deb9a8931bbc6d8687d629fac9787361fc96aae6..06b9fdd33fe888d298dfd24a67702a610233f10d 100644
index 1f5223c3f152e8d3f21e59f282ccede8c35346c0..a5aefd1224b8cd6957a0a9654075fa06c6a69d99 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -275,6 +275,7 @@ public class ServerPlayer extends Player {
@@ -292,6 +292,7 @@ public class ServerPlayer extends Player {
public boolean joining = true;
public boolean sentListPacket = false;
public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready
@@ -25,25 +25,23 @@ index deb9a8931bbc6d8687d629fac9787361fc96aae6..06b9fdd33fe888d298dfd24a67702a61
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 e2c9a1007dce1fd05382622dd186ff5dca1b9512..481e0139a973a7b24a5ff6158e795a265550f087 100644
index cb3b10cc96c15a4894b3239110ee60f4aa130e05..8a860d6a7602ff15be01a9e57181cd66c72fd2b1 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2274,6 +2274,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
@@ -2338,7 +2338,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.disconnect(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));
return Optional.empty();
+ // Gale start - EMC - do not process chat/commands before player has joined
+ } else if (!player.didPlayerJoinEvent) {
+ return Optional.empty();
+ // Gale end - EMC - do not process chat/commands before player has joined
} else {
- } else {
+ } else if (player.didPlayerJoinEvent) { // Gale - EMC - do not process chat/commands before player has joined
this.player.resetLastActionTime();
return optional;
// 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 1e5f709115007ff19901c0a6c3cf884d9e4d3a6c..152ecf384ac91c39700c6e16b0cd342b8b827bf9 100644
index a2142930b4d4b05987c90496fb9d733d99040aa0..523f183f2a8b8f97088eab57f9b28e777b93bef0 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -348,6 +348,8 @@ public abstract class PlayerList {
@@ -350,6 +350,8 @@ public abstract class PlayerList {
return;
}

View File

@@ -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/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 6082637bfd19f7ea6eb1b76c615f56a6454643e6..3615dff6845a7fb6f89b6c51629acab7a21e7db4 100644
index 8a860d6a7602ff15be01a9e57181cd66c72fd2b1..ee05f0131f336c50536fe47eda4693b696634796 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -187,6 +187,7 @@ import net.minecraft.world.phys.shapes.BooleanOp;
@@ -194,6 +194,7 @@ import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions;
@@ -18,7 +18,7 @@ index 6082637bfd19f7ea6eb1b76c615f56a6454643e6..3615dff6845a7fb6f89b6c51629acab7
import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger;
@@ -2443,7 +2444,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2509,7 +2510,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// CraftBukkit start
String s = message.signedContent();
if (s.isEmpty()) {

View File

@@ -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/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 5ece375eaf6bcc61864997a389bb5e24625e4505..12898276aae034673484cd60cb598a520a47ce21 100644
index 1351423a12c19a01f602a202832372a399e6a867..59b7d9c9a2a0203f8135a9dcdce302bbf0b2d0f4 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -54,6 +54,7 @@ import net.minecraft.world.phys.AABB;
@@ -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;
@@ -48,13 +48,13 @@ index 5ece375eaf6bcc61864997a389bb5e24625e4505..12898276aae034673484cd60cb598a52
import org.slf4j.Logger;
public class WorldGenRegion implements WorldGenLevel {
@@ -318,6 +319,7 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -326,6 +327,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 (!hasSetFarWarned) {
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + 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.generatingStatus) + (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

View File

@@ -7,18 +7,18 @@ 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/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
index cb5502ef7a9f4c5dcbbb794371daffb92c456b00..20a369086c0c13735d1a39a2faf23408a96f25f4 100644
index e5625557d2cd70b19b9db5fd418c243b639188e8..67ab06ccd421f991035360bd037616c9fd5ceeb0 100644
--- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
@@ -47,7 +47,7 @@ public class SignedMessageChain {
throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.unsigned_chat"), true, org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event causes
@@ -57,7 +57,7 @@ public class SignedMessageChain {
throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.INVALID_SIGNATURE);
} else {
if (playerChatMessage.hasExpiredServer(Instant.now())) {
- LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", body.content());
+ if (GaleGlobalConfiguration.get().logToConsole.chat.expiredMessageWarning) LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", body.content()); // Gale - do not log expired message warnings
- SignedMessageChain.LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", body.content());
+ if (GaleGlobalConfiguration.get().logToConsole.chat.expiredMessageWarning) SignedMessageChain.LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", body.content()); // Gale - do not log expired message warnings
}
return playerChatMessage;
SignedMessageChain.this.nextLink = signedMessageLink.advance();
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 83fcaa347be906cf42ba853754ac6bda2b39d8f9..ca6d3712f4552534585b46e921738ec9416095ab 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java

View File

@@ -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 1d78e8beacbc93ef2cd6beb418edca843f8a5429..c5ad3034e8298e345733340d2b6284ef05bb4713 100644
index e83f9517b31c5171b8dc75ab63a5bfe654221c84..8b95af95976309f31eb2493049a6a7440c505608 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,10 +29,10 @@ index 1d78e8beacbc93ef2cd6beb418edca843f8a5429..c5ad3034e8298e345733340d2b6284ef
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 152ecf384ac91c39700c6e16b0cd342b8b827bf9..40fba831975d21eb4ba9aacbf25cdaca082de6aa 100644
index 523f183f2a8b8f97088eab57f9b28e777b93bef0..6931003ca7808fddccd648a3eb2dc41b38ec97bd 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -100,6 +100,7 @@ import net.minecraft.world.phys.Vec3;
@@ -102,6 +102,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.DisplaySlot;
import net.minecraft.world.scores.Objective;
import net.minecraft.world.scores.PlayerTeam;
@@ -40,7 +40,7 @@ index 152ecf384ac91c39700c6e16b0cd342b8b827bf9..40fba831975d21eb4ba9aacbf25cdaca
import org.slf4j.Logger;
// CraftBukkit start
@@ -1433,7 +1434,7 @@ public abstract class PlayerList {
@@ -1432,7 +1433,7 @@ public abstract class PlayerList {
// Paper end
boolean flag = this.verifyChatTrusted(message);

View File

@@ -17,18 +17,18 @@ 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 89b3184be952fd0803520dd0f717f3acfc3cb496..4ed1b205d2b31c00fbf9aa70cd2c13e7d0fe0534 100644
index 765cf12c1558afd9686793b18388fc229c55d2d8..857ea8d6fe72a1ef2094121f49db4a359e9e2080 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -39,6 +39,7 @@ import net.minecraft.util.CryptException;
@@ -42,6 +42,7 @@ import net.minecraft.util.CryptException;
import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.player.Player;
import net.minecraft.util.StringUtil;
import org.apache.commons.lang3.Validate;
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger;
import org.bukkit.craftbukkit.util.Waitable;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
@@ -127,6 +128,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketUtils;
@@ -154,6 +155,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void onDisconnect(Component reason) {

View File

@@ -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 d47e5442de3c6bf731b1b31454493855bc1e61e3..64701667486002c60c9d1819e57ac40153306a71 100644
index 28412943a1ce919da3c8731a441b5a1b3b893293..005890e25a3f5fe34027239633646a662eba32bb 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -179,7 +179,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -192,7 +192,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
// Paper start - detect running as root

View File

@@ -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 eb76cadfb225a936fd89ccfd2db13d308e5fe5bb..2c8eb9294890955f71382ed3884874cc827bab5e 100644
index 005890e25a3f5fe34027239633646a662eba32bb..c58b52acafdc43f41bcc786de56d3d75eb220678 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -291,7 +291,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -304,7 +304,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

View File

@@ -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/world/level/levelgen/structure/PoolElementStructurePiece.java b/src/main/java/net/minecraft/world/level/levelgen/structure/PoolElementStructurePiece.java
index 92fd8e437b57c9df06c0287006604b85a1b7c048..3bd9d7105d2e0a6cdcbf81d8a5f4a51975257b67 100644
index 608cfb0db7bb14611f6cdcb55d9701a55d882e9d..64ee66ba5e3340ac10f060d950f3515ac893bd55 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
@@ -23,10 +23,11 @@ import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
@@ -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;
@@ -29,8 +29,8 @@ index 92fd8e437b57c9df06c0287006604b85a1b7c048..3bd9d7105d2e0a6cdcbf81d8a5f4a519
protected final StructurePoolElement element;
protected BlockPos position;
private final int groundLevelDelta;
@@ -58,7 +59,7 @@ public class PoolElementStructurePiece extends StructurePiece {
DynamicOps<Tag> dynamicOps = RegistryOps.create(NbtOps.INSTANCE, context.registryAccess());
@@ -57,7 +58,7 @@ public class PoolElementStructurePiece extends StructurePiece {
DynamicOps<Tag> dynamicOps = context.registryAccess().createSerializationContext(NbtOps.INSTANCE);
this.element = StructurePoolElement.CODEC
.parse(dynamicOps, nbt.getCompound("pool_element"))
- .resultOrPartial(LOGGER::error)

View File

@@ -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 75884a9e69a28404752c1a2cf854335bb78cac01..2bef8de96eeba9a1cd674f3195fe0055eb56fa33 100644
index 6f22705072fecbe91196e4966fca2eeec060f120..d7d98386f6458ea00b88acdabb8ba70caf543783 100644
--- a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
+++ b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java
@@ -78,6 +78,6 @@ public abstract class WaterAnimal extends PathfinderMob {
@@ -72,6 +72,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

View File

@@ -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/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
index 161c128d27f50f145f88142191f1a5c93649ea65..6659abb4ab8a13a48c154d2e3f273eb13b202e7f 100644
index 0c21959f57ae88fcd0a4d6dc911c1ce347c96528..5707c6287a691030841fa973e8f7f34a816103e4 100644
--- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
+++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
@@ -200,12 +200,21 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder<Mushroo
@@ -196,12 +196,21 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder<Mushroo
// this.discard(); // CraftBukkit - moved down
entitycow.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
entitycow.setHealth(this.getHealth());

View File

@@ -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 567704f61034363e48ef2a5b5566ebdc91682297..e1b2b6a55d0a837d2a447dcc636a9f29aa4597e7 100644
index 72b3e64cf6d184e90a6e2c0d822b83312312d67d..f4f45fa391c36f66abdf1c16c0f3e31f5dda1c1a 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1875,6 +1875,11 @@ public abstract class Player extends LivingEntity {
@@ -1893,6 +1893,11 @@ public abstract class Player extends LivingEntity {
}
public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) {

View File

@@ -13,18 +13,18 @@ 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/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
index 9bb542ce3a8c52e1688bb1f66fc916dd23a5fd10..79878ae4907091b2009032a2ad1a2d05bcda26eb 100644
index 887957ce1ddc2f32569405642f35df468c08271f..fa78fcbdcada06a772e1e21a58125a849c515a62 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 javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
@@ -6,6 +6,7 @@ import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.NonNullList;
+import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.world.Container;
@@ -49,6 +50,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
import net.minecraft.world.ContainerHelper;
@@ -47,6 +48,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
public static final int DATA_BREW_TIME = 0;
public static final int DATA_FUEL_USES = 1;
public static final int NUM_DATA_VALUES = 2;
@@ -32,8 +32,8 @@ index 9bb542ce3a8c52e1688bb1f66fc916dd23a5fd10..79878ae4907091b2009032a2ad1a2d05
private NonNullList<ItemStack> items;
public int brewTime;
private boolean[] lastPotionCount;
@@ -301,6 +303,22 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
ContainerHelper.loadAllItems(nbt, this.items);
@@ -299,6 +301,22 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
ContainerHelper.loadAllItems(nbt, this.items, registryLookup);
this.brewTime = nbt.getShort("BrewTime");
this.fuel = nbt.getByte("Fuel");
+ // Gale start - Mirai - fix MC-26304
@@ -55,9 +55,9 @@ index 9bb542ce3a8c52e1688bb1f66fc916dd23a5fd10..79878ae4907091b2009032a2ad1a2d05
}
@Override
@@ -309,6 +327,18 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
@@ -307,6 +325,18 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
nbt.putShort("BrewTime", (short) this.brewTime);
ContainerHelper.saveAllItems(nbt, this.items);
ContainerHelper.saveAllItems(nbt, this.items, registryLookup);
nbt.putByte("Fuel", (byte) this.fuel);
+ // Gale start - Mirai - fix MC-26304
+ if (this.ingredient != null && this.ingredient != Items.AIR) {

View File

@@ -37,17 +37,17 @@ 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/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
index 098fde8200a11f91f934ddab6b1486dac4014dfe..083130de6f6d5b6daa1564d5d51115f7c58987a7 100644
index 93bd70c1dc2ba8b893a6087730071c81fb1132f4..a39409ba38b28d160aa1abe70a1dd1c5a633c08d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -171,6 +171,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
@@ -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 && !blockEntity.isCoolingDown()) {
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
ServerLevel worldserver = (ServerLevel) world;
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 7f9c5012defeac5ae558e46d8fca6889fb1d0872..56bf02a1f9741fc1c05ede0c0c79fea97d46271b 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java

View File

@@ -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 e8faca6e443239968f0111519f9e5cd018ed3297..488a98e20b4f405d1ce4a224d2d2b5151dec369b 100644
index 31b8a8bf78d52b5f11b68e780ec09bf78e7bda84..7f99fe3ea54c6b39584a73d1931100193ac09cbd 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -320,7 +320,7 @@ public abstract class AbstractArrow extends Projectile {
@@ -332,7 +332,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)));

View File

@@ -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 40fba831975d21eb4ba9aacbf25cdaca082de6aa..8730ebf74eca319b3d70db5504c134e9d492c366 100644
index 6931003ca7808fddccd648a3eb2dc41b38ec97bd..73115d3afe723faadf487e235e965c392011929c 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -490,7 +490,13 @@ public abstract class PlayerList {
@@ -489,7 +489,13 @@ public abstract class PlayerList {
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
}
// Paper end - Configurable player collision

View File

@@ -59,6 +59,21 @@ index 277cfd9d1e8fff5d9b5e534b75c3c5162d58b0b7..a6db66fd143db595802ac91296c607db
private int size;
public static int getLocationKey(final int x, final int y, final int z) {
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java b/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
index 190c5f0b02a3d99054704ae1afbffb3498ddffe1..6f9ebc774cd5b4debb51973e88975ab23ddeb914 100644
--- a/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
@@ -15,9 +15,7 @@ public final class ReferenceList<E> implements Iterable<E> {
this.referenceToIndex.defaultReturnValue(Integer.MIN_VALUE);
}
- protected static final Object[] EMPTY_LIST = new Object[0];
-
- protected Object[] references = EMPTY_LIST;
+ protected Object[] references = me.titaniumtown.ArrayConstants.emptyObjectArray; // Gale - JettPack - reduce array allocations
protected int count;
public int size() {
diff --git a/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java b/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java
index ae60bd96b5284d54676d8e7e4dd5d170b526ec1e..b269b9b55c10542b16af301be3f43798c82dde82 100644
--- a/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java
@@ -181,7 +196,7 @@ index 06648f9751fd8a322d0809ffebf6a544596ee1a4..b4c2fbdd56ba278560fc1c0d7e086dce
@Override
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
index 23916b011ed0645ab284fb080c9555921290d875..367d7ada0f45a4de675cdc8cb087a30cca9dd530 100644
index 4e005b7b062e3231f564d284887ea1c2783a4e7d..df1031040b2e3d0546a5d7b6dd81ad27ee9dc60e 100644
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
@@ -1,6 +1,5 @@
@@ -250,7 +265,7 @@ index ff13d67151c50ea11a45117e524c7524e2b1a202..3f6327661e593e52a89c247288f0104c
@Override
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
index 24ad8d22b5180cd7d7f793e3074e438f9192448f..33ea5ee8d79708e11613ce162f97f300242894b7 100644
index 154bffd341e43be0a0fa710cfbed1a2094f249a3..2beb88f50fa003af9052ca982121b1c1bb1d0c3b 100644
--- a/src/main/java/net/minecraft/nbt/ListTag.java
+++ b/src/main/java/net/minecraft/nbt/ListTag.java
@@ -2,6 +2,8 @@ package net.minecraft.nbt;
@@ -262,7 +277,7 @@ index 24ad8d22b5180cd7d7f793e3074e438f9192448f..33ea5ee8d79708e11613ce162f97f300
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
@@ -279,7 +281,7 @@ public class ListTag extends CollectionTag<Tag> {
@@ -258,7 +260,7 @@ public class ListTag extends CollectionTag<Tag> {
}
}
@@ -271,7 +286,7 @@ index 24ad8d22b5180cd7d7f793e3074e438f9192448f..33ea5ee8d79708e11613ce162f97f300
}
public long[] getLongArray(int index) {
@@ -291,7 +293,7 @@ public class ListTag extends CollectionTag<Tag> {
@@ -269,7 +271,7 @@ public class ListTag extends CollectionTag<Tag> {
}
}
@@ -325,10 +340,10 @@ index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..43f402d9032e4570a81a80e412215598
protected CipherBase(Cipher cipher) {
this.cipher = cipher;
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index a536ebcf29d8ef0ed32863bd8d5e70f7a0636e8d..63b303a68edd7d39f85c8cb56760b2bf46dcb67a 100644
index 58d28b6c1cc7da7d786f78308db971f7502ad844..6da6a7befa2dc8988900abee03d24ba894939932 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -23,7 +23,6 @@ import io.netty.channel.epoll.EpollSocketChannel;
@@ -27,7 +27,6 @@ import io.netty.channel.epoll.EpollSocketChannel;
import io.netty.channel.local.LocalChannel;
import io.netty.channel.local.LocalServerChannel;
import io.netty.channel.nio.NioEventLoopGroup;
@@ -336,7 +351,7 @@ index a536ebcf29d8ef0ed32863bd8d5e70f7a0636e8d..63b303a68edd7d39f85c8cb56760b2bf
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.flow.FlowControlHandler;
import io.netty.handler.timeout.ReadTimeoutHandler;
@@ -39,6 +38,8 @@ import java.util.function.Supplier;
@@ -43,6 +42,8 @@ import java.util.function.Supplier;
import javax.annotation.Nullable;
import javax.crypto.Cipher;
import net.minecraft.SharedConstants;
@@ -345,17 +360,17 @@ index a536ebcf29d8ef0ed32863bd8d5e70f7a0636e8d..63b303a68edd7d39f85c8cb56760b2bf
import net.minecraft.Util;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
@@ -322,7 +323,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -316,7 +317,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
public void setListener(PacketListener packetListener) {
- Validate.notNull(packetListener, "packetListener", new Object[0]);
+ Validate.notNull(packetListener, "packetListener", ArrayConstants.emptyObjectArray); // Gale - JettPack - reduce array allocations
PacketFlow enumprotocoldirection = packetListener.flow();
private void validateListener(ProtocolInfo<?> state, PacketListener listener) {
- Validate.notNull(listener, "packetListener", new Object[0]);
+ Validate.notNull(listener, "packetListener", me.titaniumtown.ArrayConstants.emptyObjectArray); // Gale - JettPack - reduce array allocations
PacketFlow enumprotocoldirection = listener.flow();
String s;
if (enumprotocoldirection != this.receiving) {
diff --git a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
index 18e53db59082bae94922edc4baa812aa6f089576..54da741b4fa22c6a01aacc6598de0a9d44fc545b 100644
index 4aa6232bf0f72fcde32d257100bd15b1c5192aaa..ad73e14f068ae2f3b83769eef1191b9b13fbd1e5 100644
--- a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
+++ b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
@@ -16,6 +16,8 @@ import java.util.function.Consumer;
@@ -373,27 +388,27 @@ index 18e53db59082bae94922edc4baa812aa6f089576..54da741b4fa22c6a01aacc6598de0a9d
public class TranslatableContents implements ComponentContents {
- public static final Object[] NO_ARGS = new Object[0];
+ public static final Object[] NO_ARGS = ArrayConstants.emptyObjectArray; // Gale - JettPack - reduce array allocations
private static final Codec<Object> PRIMITIVE_ARG_CODEC = ExtraCodecs.validate(ExtraCodecs.JAVA, TranslatableContents::filterAllowedArguments);
private static final Codec<Object> PRIMITIVE_ARG_CODEC = ExtraCodecs.JAVA.validate(TranslatableContents::filterAllowedArguments);
private static final Codec<Object> ARG_CODEC = Codec.either(PRIMITIVE_ARG_CODEC, ComponentSerialization.CODEC)
.xmap(
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index bc391d27399d8c22e78735ca39aa8ab45efb6413..465a7787f15c934b2cef1a58e4b18f1ae9b4cae7 100644
index 5443013060b62e3bfcc51cddca96d1c0bc59fe72..76a1b31a55b1838dc80b796f997edaddbcaa755c 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -87,7 +87,7 @@ public class Main {
OptionSpec<Void> optionspec5 = optionparser.accepts("eraseCache");
OptionSpec<Void> optionspec6 = optionparser.accepts("safeMode", "Loads level with vanilla datapack only");
OptionSpec<Void> optionspec7 = optionparser.accepts("help").forHelp();
- OptionSpec<String> optionspec8 = optionparser.accepts("universe").withRequiredArg().defaultsTo(".", new String[0]);
+ OptionSpec<String> optionspec8 = optionparser.accepts("universe").withRequiredArg().defaultsTo(".", me.titaniumtown.ArrayConstants.emptyStringArray); // Gale - JettPack - reduce array allocations
OptionSpec<String> optionspec9 = optionparser.accepts("world").withRequiredArg();
OptionSpec<Integer> optionspec10 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1, new Integer[0]);
OptionSpec<String> optionspec11 = optionparser.accepts("serverId").withRequiredArg();
@@ -89,7 +89,7 @@ public class Main {
OptionSpec<Void> optionspec6 = optionparser.accepts("recreateRegionFiles");
OptionSpec<Void> optionspec7 = optionparser.accepts("safeMode", "Loads level with vanilla datapack only");
OptionSpec<Void> optionspec8 = optionparser.accepts("help").forHelp();
- OptionSpec<String> optionspec9 = optionparser.accepts("universe").withRequiredArg().defaultsTo(".", new String[0]);
+ OptionSpec<String> optionspec9 = optionparser.accepts("universe").withRequiredArg().defaultsTo(".", me.titaniumtown.ArrayConstants.emptyStringArray); // Gale - JettPack - reduce array allocations
OptionSpec<String> optionspec10 = optionparser.accepts("world").withRequiredArg();
OptionSpec<Integer> optionspec11 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1, new Integer[0]);
OptionSpec<String> optionspec12 = optionparser.accepts("serverId").withRequiredArg();
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 733ff850468c8a6474a15a455e89bf1195dd7e65..04249a147f2c0a41499d1149a1f9749689074232 100644
index 949d8c167d8f2b8fa2cb16d489c1cacffcaa78e5..a9f97783ff2a62041f6fc16a2e64112b42a4188d 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -335,7 +335,7 @@ public class ServerEntity {
@@ -342,7 +342,7 @@ public class ServerEntity {
if (this.entity instanceof LivingEntity) {
List<Pair<EquipmentSlot, ItemStack>> list = Lists.newArrayList();
@@ -403,7 +418,7 @@ index 733ff850468c8a6474a15a455e89bf1195dd7e65..04249a147f2c0a41499d1149a1f97496
for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index d5e9c65d8664f509bec419fddc7b85042473268e..9805ee5989d813f45b5b0829d73ebce3909b5f07 100644
index 92a53e55e6431a2748e5a489ca0375930087c3cf..44424717623aa45c00dc69b23fc9741117650de3 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -38,6 +38,8 @@ import java.util.stream.Collectors;
@@ -415,7 +430,7 @@ index d5e9c65d8664f509bec419fddc7b85042473268e..9805ee5989d813f45b5b0829d73ebce3
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
import net.minecraft.Util;
@@ -1044,7 +1046,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1050,7 +1052,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
BlockPos blockposition2 = blockposition.set(j + randomX, randomY, k + randomZ);
BlockState iblockdata = com.destroystokyo.paper.util.maplist.IBlockDataList.getBlockDataFromRaw(raw);
@@ -424,7 +439,7 @@ index d5e9c65d8664f509bec419fddc7b85042473268e..9805ee5989d813f45b5b0829d73ebce3
}
// We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock).
// TODO CHECK ON UPDATE (ping the Canadian)
@@ -1350,7 +1352,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1356,7 +1358,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public static List<Entity> getCurrentlyTickingEntities() {
Entity ticking = currentlyTickingEntity.get();
@@ -434,19 +449,19 @@ index d5e9c65d8664f509bec419fddc7b85042473268e..9805ee5989d813f45b5b0829d73ebce3
return ret;
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 26ff2e2ffb7cbc206a4a52600f173a4dcd084ac2..6d7d6858c021d2d14a83bbe40404c749c449e589 100644
index ee05f0131f336c50536fe47eda4693b696634796..f0436b9a2457eac9904e56f45fa1118e83d090cc 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -28,6 +28,8 @@ import java.util.function.UnaryOperator;
@@ -29,6 +29,8 @@ import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nullable;
+
+import me.titaniumtown.ArrayConstants;
import net.minecraft.ChatFormatting;
import net.minecraft.SharedConstants;
import net.minecraft.Util;
@@ -177,7 +179,6 @@ import net.minecraft.world.level.block.entity.CrafterBlockEntity;
import net.minecraft.advancements.AdvancementHolder;
@@ -184,7 +186,6 @@ import net.minecraft.world.level.block.entity.CrafterBlockEntity;
import net.minecraft.world.level.block.entity.JigsawBlockEntity;
import net.minecraft.world.level.block.entity.SignBlockEntity;
import net.minecraft.world.level.block.entity.StructureBlockEntity;
@@ -454,7 +469,7 @@ index 26ff2e2ffb7cbc206a4a52600f173a4dcd084ac2..6d7d6858c021d2d14a83bbe40404c749
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
@@ -226,8 +227,6 @@ import org.bukkit.event.inventory.InventoryCreativeEvent;
@@ -233,8 +234,6 @@ import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.inventory.SmithItemEvent;
import org.bukkit.event.player.AsyncPlayerChatEvent;
@@ -464,7 +479,7 @@ index 26ff2e2ffb7cbc206a4a52600f173a4dcd084ac2..6d7d6858c021d2d14a83bbe40404c749
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 0818657745d48cd3367263e2d7650361ca7a4c02..a87be49d91e0bd95d5d5aa9f140f3f29f1c8b565 100644
index 857ea8d6fe72a1ef2094121f49db4a359e9e2080..0588e43e7607b10f66db6d0b615141250031699a 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -13,9 +13,10 @@ import java.security.PrivateKey;
@@ -479,20 +494,20 @@ index 0818657745d48cd3367263e2d7650361ca7a4c02..a87be49d91e0bd95d5d5aa9f140f3f29
import net.minecraft.DefaultUncaughtExceptionHandler;
import net.minecraft.core.UUIDUtil;
import net.minecraft.network.Connection;
@@ -147,8 +148,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -174,8 +175,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleHello(ServerboundHelloPacket packet) {
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
- if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation && !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) Validate.validState(Player.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]); // Paper - config username validation
- if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation && !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) Validate.validState(StringUtil.isValidPlayerName(packet.name()), "Invalid characters in username", new Object[0]); // Paper - config username validation
+ // Gale start - JettPack - reduce array allocations
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", ArrayConstants.emptyObjectArray);
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation && !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) Validate.validState(Player.isValidUsername(packet.name()), "Invalid characters in username", ArrayConstants.emptyObjectArray); // Paper - config username validation
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation && !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) Validate.validState(StringUtil.isValidPlayerName(packet.name()), "Invalid characters in username", ArrayConstants.emptyObjectArray); // Paper - config username validation
+ // Gale end - JettPack - reduce array allocations
this.requestedUsername = packet.name();
GameProfile gameprofile = this.server.getSingleplayerProfile();
@@ -232,7 +235,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -271,7 +274,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleKey(ServerboundKeyPacket packet) {
@@ -501,17 +516,17 @@ index 0818657745d48cd3367263e2d7650361ca7a4c02..a87be49d91e0bd95d5d5aa9f140f3f29
final String s;
@@ -412,7 +415,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -451,7 +454,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleLoginAcknowledgement(ServerboundLoginAcknowledgedPacket packet) {
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.PROTOCOL_SWITCHING, "Unexpected login acknowledgement packet", new Object[0]);
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.PROTOCOL_SWITCHING, "Unexpected login acknowledgement packet", ArrayConstants.emptyObjectArray); // Gale - JettPack - reduce array allocations
CommonListenerCookie commonlistenercookie = CommonListenerCookie.createInitial((GameProfile) Objects.requireNonNull(this.authenticatedProfile));
this.connection.setupOutboundProtocol(ConfigurationProtocols.CLIENTBOUND);
CommonListenerCookie commonlistenercookie = CommonListenerCookie.createInitial((GameProfile) Objects.requireNonNull(this.authenticatedProfile), this.transferred);
ServerConfigurationPacketListenerImpl serverconfigurationpacketlistenerimpl = new ServerConfigurationPacketListenerImpl(this.server, this.connection, commonlistenercookie, this.player); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 8730ebf74eca319b3d70db5504c134e9d492c366..c28ad37a7b69992ef80aeffefb04028a084deb5c 100644
index 73115d3afe723faadf487e235e965c392011929c..d502cc7221851e92b6f9d1522d33e9817ff18f6f 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -25,6 +25,8 @@ import java.util.UUID;
@@ -524,7 +539,7 @@ index 8730ebf74eca319b3d70db5504c134e9d492c366..c28ad37a7b69992ef80aeffefb04028a
import net.minecraft.FileUtil;
import net.minecraft.commands.CommandSourceStack;
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index 7e133752ccb1ea7c0b4fa781feb1a88e2cfdcf6d..c524ca1eab9db011f8203835c43e244ff4101e87 100644
index c038da20b76c0b7b1c18471b20be01e849d29f3a..1516232f116f1d48fe383d8c05c7dcc63b38f96a 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -1,6 +1,5 @@
@@ -591,22 +606,22 @@ index 01f5b946fabbe34f31110e75973dab9f39897346..f1b8e746fea603ebadcef7aff1b83677
public ZeroBitStorage(int size) {
diff --git a/src/main/java/net/minecraft/world/entity/EquipmentSlot.java b/src/main/java/net/minecraft/world/entity/EquipmentSlot.java
index 8b4dd6ff53d2d61c71f04c37389ac645766305c4..49a643015c4bd67baf250b27db7cb6ffb57921de 100644
index eb3c12e03c0d5c9cec84d97e2c51c50ce59c23a4..9b29ec4e72e4cdf2a42868ca5659fdcffa87597c 100644
--- a/src/main/java/net/minecraft/world/entity/EquipmentSlot.java
+++ b/src/main/java/net/minecraft/world/entity/EquipmentSlot.java
@@ -15,6 +15,7 @@ public enum EquipmentSlot implements StringRepresentable {
@@ -16,6 +16,7 @@ public enum EquipmentSlot implements StringRepresentable {
private final int index;
private final int filterFlag;
private final String name;
+ public static final EquipmentSlot[] VALUES = EquipmentSlot.values(); // Gale - JettPack - reduce array allocations
private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) {
private EquipmentSlot(final EquipmentSlot.Type type, final int entityId, final int armorStandId, final String name) {
this.type = type;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 9c85df84d820ff664b446cfbcb6cf322dde7289b..4489bd7c6b29ea6db432e62bb113fdc930c8a480 100644
index b095a5b4c2390bc3e52f8bb559c621ecb42db2c6..70f1aec3e396561b111696b7ddc31ce848702671 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3161,7 +3161,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3233,7 +3233,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@Nullable
private Map<EquipmentSlot, ItemStack> collectEquipmentChanges() {
Map<EquipmentSlot, ItemStack> map = null;
@@ -616,10 +631,10 @@ index 9c85df84d820ff664b446cfbcb6cf322dde7289b..4489bd7c6b29ea6db432e62bb113fdc9
for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index c7f328945ac11626bab2724475c2aa41a69fffa0..9df992ca013db3f54026aa5ebd3eb3d49b7c3969 100644
index a52538ddbadfaa40021462e15224e8a1ed6312a2..1b97a429c05ae8f77af3cea4852bac3966dd54e0 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1063,7 +1063,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1173,7 +1173,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
@Override
protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) {
super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops);
@@ -628,7 +643,7 @@ index c7f328945ac11626bab2724475c2aa41a69fffa0..9df992ca013db3f54026aa5ebd3eb3d4
int j = aenumitemslot.length;
for (int k = 0; k < j; ++k) {
@@ -1126,7 +1126,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1256,7 +1256,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
}
boolean flag = true;
@@ -637,7 +652,7 @@ index c7f328945ac11626bab2724475c2aa41a69fffa0..9df992ca013db3f54026aa5ebd3eb3d4
int j = aenumitemslot.length;
for (int k = 0; k < j; ++k) {
@@ -1213,7 +1213,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1343,7 +1343,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
float f = localDifficulty.getSpecialMultiplier();
this.enchantSpawnedWeapon(random, f);
@@ -646,7 +661,7 @@ index c7f328945ac11626bab2724475c2aa41a69fffa0..9df992ca013db3f54026aa5ebd3eb3d4
int i = aenumitemslot.length;
for (int j = 0; j < i; ++j) {
@@ -1433,7 +1433,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1563,7 +1563,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
t0.setInvulnerable(this.isInvulnerable());
if (flag) {
t0.setCanPickUpLoot(this.canPickUpLoot());
@@ -656,10 +671,10 @@ index c7f328945ac11626bab2724475c2aa41a69fffa0..9df992ca013db3f54026aa5ebd3eb3d4
for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
index 7de9d012e7416eaa0189b513a0972c846e93c4b6..9274015f58c71f991903bd28434a4832afd074b2 100644
index f38acc96f71298e40ce9433e7759fd223ca55e48..22ec9c1e74450f56cd1e390d59ca28f1577e6139 100644
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -237,7 +237,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
@@ -238,7 +238,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
return;
}
// CraftBukkit end
@@ -669,60 +684,62 @@ index 7de9d012e7416eaa0189b513a0972c846e93c4b6..9274015f58c71f991903bd28434a4832
for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 1ad126d992d95062a3db08374db7a927f23a0cac..93ddff72b43b8cfd83a4b07d636795640b63ae07 100644
index 36e3415b9312d3a80c9f5e1c36b42b7ea30c31c5..5c922ed680cdf54e7a1439e2181a3ba4151a1d4c 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -1053,7 +1053,7 @@ public final class ItemStack {
int k;
@@ -1102,7 +1102,7 @@ public final class ItemStack implements DataComponentHolder {
ItemAttributeModifiers itemattributemodifiers = (ItemAttributeModifiers) this.getOrDefault(DataComponents.ATTRIBUTE_MODIFIERS, ItemAttributeModifiers.EMPTY);
if (ItemStack.shouldShowInTooltip(i, ItemStack.TooltipPart.MODIFIERS)) {
if (itemattributemodifiers.showInTooltip()) {
- EquipmentSlot[] aenumitemslot = EquipmentSlot.values();
+ EquipmentSlot[] aenumitemslot = EquipmentSlot.VALUES; // Gale - JettPack - reduce array allocations
int i = aenumitemslot.length;
k = aenumitemslot.length;
for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipePattern.java b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipePattern.java
index d8fe760bb74c8ea0d6fb8321d2c8a49d838c5362..4fd03bc94ebcbc42fbb55564515ea1f57fe6d214 100644
index 90a38babcc87a789e4955f1505fa645780d14011..d8aa16137d3f914d6dd2c3ed438e677f6e8a9172 100644
--- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipePattern.java
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipePattern.java
@@ -11,6 +11,8 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
+
+import me.titaniumtown.ArrayConstants;
import net.minecraft.Util;
import net.minecraft.core.NonNullList;
import net.minecraft.network.FriendlyByteBuf;
@@ -85,7 +87,7 @@ public record ShapedRecipePattern(int width, int height, NonNullList<Ingredient>
@@ -88,7 +88,7 @@ public record ShapedRecipePattern(int width, int height, NonNullList<Ingredient>
}
if (pattern.size() == l) {
- return new String[0];
+ return ArrayConstants.emptyStringArray; // Gale - JettPack - reduce array allocations
+ return me.titaniumtown.ArrayConstants.emptyStringArray; // Gale - JettPack - reduce array allocations
} else {
String[] strings = new String[pattern.size() - l - k];
diff --git a/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java b/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java
index 8343e175a7221f7b0e83c39cd5350683a0649f8d..e023a1c77ab1e2ca757d82f027246259d122b81f 100644
index e158ff1a9dbd054985873e854fcf6c433102059c..4dbe4db3e7b005eabdec56e5047ad7bc4a3ebd64 100644
--- a/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java
+++ b/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java
@@ -63,10 +63,11 @@ public class Enchantments {
public static final Enchantment MULTISHOT = register("multishot", new MultiShotEnchantment(Enchantment.Rarity.RARE, EquipmentSlot.MAINHAND));
public static final Enchantment QUICK_CHARGE = register("quick_charge", new QuickChargeEnchantment(Enchantment.Rarity.UNCOMMON, EquipmentSlot.MAINHAND));
public static final Enchantment PIERCING = register("piercing", new ArrowPiercingEnchantment(Enchantment.Rarity.COMMON, EquipmentSlot.MAINHAND));
- public static final Enchantment MENDING = register("mending", new MendingEnchantment(Enchantment.Rarity.RARE, EquipmentSlot.values()));
+ public static final Enchantment MENDING = register("mending", new MendingEnchantment(Enchantment.Rarity.RARE, EquipmentSlot.VALUES));
@@ -303,20 +303,22 @@ public class Enchantments {
public static final Enchantment DENSITY = register("density", new DensityEnchantment());
public static final Enchantment BREACH = register("breach", new BreachEnchantment());
public static final Enchantment WIND_BURST = register("wind_burst", new WindBurstEnchantment());
+ // Gale start - JettPack - reduce array allocations
public static final Enchantment MENDING = register(
"mending",
new MendingEnchantment(
Enchantment.definition(
- ItemTags.DURABILITY_ENCHANTABLE, 2, 1, Enchantment.dynamicCost(25, 25), Enchantment.dynamicCost(75, 25), 4, EquipmentSlot.values()
+ ItemTags.DURABILITY_ENCHANTABLE, 2, 1, Enchantment.dynamicCost(25, 25), Enchantment.dynamicCost(75, 25), 4, EquipmentSlot.VALUES
)
)
);
public static final Enchantment VANISHING_CURSE = register(
- "vanishing_curse", new VanishingCurseEnchantment(Enchantment.Rarity.VERY_RARE, EquipmentSlot.values())
+ "vanishing_curse", new VanishingCurseEnchantment(Enchantment.Rarity.VERY_RARE, EquipmentSlot.VALUES)
"vanishing_curse",
new VanishingCurseEnchantment(
- Enchantment.definition(ItemTags.VANISHING_ENCHANTABLE, 1, 1, Enchantment.constantCost(25), Enchantment.constantCost(50), 8, EquipmentSlot.values())
+ Enchantment.definition(ItemTags.VANISHING_ENCHANTABLE, 1, 1, Enchantment.constantCost(25), Enchantment.constantCost(50), 8, EquipmentSlot.VALUES)
)
);
+ // Gale end - JettPack - reduce array allocations
private static Enchantment register(String name, Enchantment enchantment) {
return Registry.register(BuiltInRegistries.ENCHANTMENT, name, enchantment);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index e4d633411c53d867636a23451d5ff9ffd962d5b4..f239b14fd9c884dc7905a9e0456c2198bf1205e6 100644
index 50f660de3d94c2b30668f8fd09a590a2d1b3ba16..5854c76fadd8fe08d0d0ca5d01ce218b86a508c1 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -10,6 +10,8 @@ import java.util.function.Consumer;
@@ -734,7 +751,7 @@ index e4d633411c53d867636a23451d5ff9ffd962d5b4..f239b14fd9c884dc7905a9e0456c2198
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
import net.minecraft.core.BlockPos;
@@ -1873,7 +1875,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1870,7 +1872,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ);
if (slices == null) {
@@ -744,7 +761,7 @@ index e4d633411c53d867636a23451d5ff9ffd962d5b4..f239b14fd9c884dc7905a9e0456c2198
return slices.getChunkEntities();
}
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
index f9084e2605d7403721fe6b714bfad051f932aaef..689ba0cc4d3571efc2664e45fde00af724007934 100644
index d3d12f9114173f4971f95d7ef895a4374705bd3f..e467b96c028d0da3b1fe7c57fdf3220c63c1c6fa 100644
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
@@ -4,6 +4,8 @@ import com.mojang.serialization.MapCodec;
@@ -756,7 +773,7 @@ index f9084e2605d7403721fe6b714bfad051f932aaef..689ba0cc4d3571efc2664e45fde00af7
import net.minecraft.Util;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
@@ -422,7 +424,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@@ -430,7 +432,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
@@ -765,7 +782,7 @@ index f9084e2605d7403721fe6b714bfad051f932aaef..689ba0cc4d3571efc2664e45fde00af7
}
@Override
@@ -471,7 +473,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@@ -479,7 +481,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
@@ -774,7 +791,7 @@ index f9084e2605d7403721fe6b714bfad051f932aaef..689ba0cc4d3571efc2664e45fde00af7
}
@Override
@@ -513,7 +515,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@@ -521,7 +523,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
@@ -784,7 +801,7 @@ index f9084e2605d7403721fe6b714bfad051f932aaef..689ba0cc4d3571efc2664e45fde00af7
@Override
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index 89d06253b00604114e543ebbe12a9993ae95dc41..a6d2de3b8231168c7c38b4a83e99b2836c00af7c 100644
index a99fe191c429bb528209dd0f31b509acf9cccbb5..360f96689b2b0015b56d3a9954b8454193a3316f 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -9,6 +9,8 @@ import java.util.Iterator;
@@ -796,7 +813,7 @@ index 89d06253b00604114e543ebbe12a9993ae95dc41..a6d2de3b8231168c7c38b4a83e99b283
import net.minecraft.SharedConstants;
import net.minecraft.Util;
import net.minecraft.core.BlockPos;
@@ -66,7 +68,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
@@ -67,7 +69,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
protected static final int SLOT_FUEL = 1;
protected static final int SLOT_RESULT = 2;
public static final int DATA_LIT_TIME = 0;
@@ -806,36 +823,19 @@ index 89d06253b00604114e543ebbe12a9993ae95dc41..a6d2de3b8231168c7c38b4a83e99b283
private static final int[] SLOTS_FOR_SIDES = new int[]{1};
public static final int DATA_LIT_DURATION = 1;
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
index 63e187c65cb855031f286aad0d25ac4694f7a331..083849817786e08d23b05f8cc6c2469ce19e9107 100644
index 8ab7ca373a885fbe658013c9c6a2e38d32d77bb2..f970f3473c9dea78fd106342331f2b55bb5265c0 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -6,13 +6,14 @@ import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import javax.annotation.Nullable;
+
+import me.titaniumtown.ArrayConstants;
import net.minecraft.Util;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtAccounter;
@@ -16,7 +16,6 @@ import net.minecraft.nbt.NbtAccounter;
import net.minecraft.nbt.NbtIo;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.server.level.ServerPlayer;
-import net.minecraft.util.datafix.DataFixTypes;
import net.minecraft.world.entity.player.Player;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.slf4j.Logger;
@@ -124,7 +125,7 @@ public class PlayerDataStorage {
String[] astring = this.playerDir.list();
if (astring == null) {
- astring = new String[0];
+ astring = ArrayConstants.emptyStringArray; // Gale - JettPack - reduce array allocations
}
for (int i = 0; i < astring.length; ++i) {
diff --git a/src/main/java/net/minecraft/world/scores/Team.java b/src/main/java/net/minecraft/world/scores/Team.java
index f00791b89fdb1bb0fb358eff2af2e687bda15e85..9dbd771cb0a37928c403d8758b78684f73888775 100644
index b968d22e149bf9063f14167fe9856868e5933303..d4edeaec0e882b2ca642cd2d4fb5984df9d33647 100644
--- a/src/main/java/net/minecraft/world/scores/Team.java
+++ b/src/main/java/net/minecraft/world/scores/Team.java
@@ -5,6 +5,8 @@ import java.util.Collection;
@@ -857,10 +857,10 @@ index f00791b89fdb1bb0fb358eff2af2e687bda15e85..9dbd771cb0a37928c403d8758b78684f
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftEquipmentSlot.java b/src/main/java/org/bukkit/craftbukkit/CraftEquipmentSlot.java
index 402a238cf502003a232bb95473bd13e59e067fab..ea8d69acfe4452eaa48ea30559ba606c28e3abfc 100644
index ae86c45c1d49c7646c721991910592091e7333f8..3bf62117fb052a4d10fd4ccd4e1b63caff511f36 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftEquipmentSlot.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftEquipmentSlot.java
@@ -5,8 +5,10 @@ import org.bukkit.inventory.EquipmentSlot;
@@ -7,8 +7,10 @@ import org.bukkit.inventory.EquipmentSlot;
public class CraftEquipmentSlot {

View File

@@ -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 8d43764a305b4a7fcc34abc041dac735fc168e62..8e4314b4c8acc059dfc5878d4982fa9a6ba9fab1 100644
index 2ff752dfc7dcee936611613da934ccebe45c1cae..cb4f71f93f45ec1e91e7ca883cfce93c2260c990 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -308,7 +308,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -311,7 +311,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public double xo;
public double yo;
public double zo;
@@ -25,7 +25,7 @@ index 8d43764a305b4a7fcc34abc041dac735fc168e62..8e4314b4c8acc059dfc5878d4982fa9a
public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public
private ChunkPos chunkPosition;
private Vec3 deltaMovement;
@@ -2018,9 +2018,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -2073,9 +2073,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
/** @deprecated */
@Deprecated
public float getLightLevelDependentMagicValue() {
@@ -45,11 +45,11 @@ index 8d43764a305b4a7fcc34abc041dac735fc168e62..8e4314b4c8acc059dfc5878d4982fa9a
this.absMoveTo(x, y, z);
this.setYRot(yaw % 360.0F);
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 9df992ca013db3f54026aa5ebd3eb3d49b7c3969..33afd520babc33c5b296b39e2bd6c3586230cd84 100644
index 1b97a429c05ae8f77af3cea4852bac3966dd54e0..e0e7c35fa9c9395eec5b4504e250ee2d58f98e30 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1699,13 +1699,29 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1817,13 +1817,29 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
return flag;
}
+ // Gale start - JettPack - optimize sun burn tick - cache eye blockpos

View File

@@ -1,36 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 30 Nov 2022 13:49:11 +0100
Subject: [PATCH] Replace AI goal set with optimized collection
License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/collections/goals/GoalSelectorMixin.java"
By: 2No2Name <2No2Name@web.de>
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/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
index 91d1088dbf1c0cfb3694d37b4e491e601507421c..fc16161d352221be549760dcdd8c62dfba6a6798 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -12,6 +12,8 @@ import java.util.Map.Entry;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Stream;
+
+import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
import org.slf4j.Logger;
public class GoalSelector {
@@ -28,7 +30,7 @@ public class GoalSelector {
}
};
private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class);
- private final Set<WrappedGoal> availableGoals = Sets.newLinkedHashSet();
+ private final Set<WrappedGoal> availableGoals = new ObjectLinkedOpenHashSet<>(); // Gale - Lithium - replace AI goal set with optimized collection
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
private int tickCount;

View File

@@ -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/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index 4a340bd1f1859e43bb58e68aee4018fdb4ca7a5a..cf99427d3efbcb79dcc05807b65dc3dd6c32df99 100644
index 89e327bc3a45879fe68887c7aadb077f31a770eb..a90ebe3fd345034c85e95d4dddf3223ac5374b30 100644
--- a/src/main/java/net/minecraft/world/level/GameRules.java
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
@@ -19,6 +19,8 @@ import java.util.function.BiConsumer;
@@ -21,6 +21,8 @@ import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.Supplier;
import javax.annotation.Nullable;
@@ -25,7 +25,7 @@ index 4a340bd1f1859e43bb58e68aee4018fdb4ca7a5a..cf99427d3efbcb79dcc05807b65dc3dd
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.nbt.CompoundTag;
@@ -142,7 +144,7 @@ public class GameRules {
@@ -149,7 +151,7 @@ public class GameRules {
}
private GameRules(Map<GameRules.Key<?>, GameRules.Value<?>> rules) {

View File

@@ -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/util/ClassInstanceMultiMap.java b/src/main/java/net/minecraft/util/ClassInstanceMultiMap.java
index ebad17e6ec90a7f385cd38c5ec6c2772798d4562..df04721911a89c998d7b9d1e9228628e037de45e 100644
index 038710ba934a9a57815dfe9f414b98223b848385..cd28174187133550e418c0e748ce8a06739d0146 100644
--- a/src/main/java/net/minecraft/util/ClassInstanceMultiMap.java
+++ b/src/main/java/net/minecraft/util/ClassInstanceMultiMap.java
@@ -4,6 +4,8 @@ import com.google.common.collect.ImmutableList;
@@ -26,7 +26,7 @@ index ebad17e6ec90a7f385cd38c5ec6c2772798d4562..df04721911a89c998d7b9d1e9228628e
import java.util.Collection;
import java.util.Collections;
@@ -14,7 +16,7 @@ import java.util.Map.Entry;
import java.util.stream.Collectors;
import net.minecraft.Util;
public class ClassInstanceMultiMap<T> extends AbstractCollection<T> {
- private final Map<Class<?>, List<T>> byClass = Maps.newHashMap();

View File

@@ -1,50 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 30 Nov 2022 20:54:31 +0100
Subject: [PATCH] Replace AI attributes with optimized collections
License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/collections/attributes/AttributeContainerMixin.java"
By: 2No2Name <2No2Name@web.de>
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/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 58b82ac5b861ccb489f5586452ae020050be5ec8..0c804e597b08eb1fce53a1161aad3405b63c8058 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
@@ -1,8 +1,6 @@
package net.minecraft.world.entity.ai.attributes;
-import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
import com.mojang.logging.LogUtils;
import java.util.Collection;
import java.util.Map;
@@ -10,6 +8,9 @@ import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
+
+import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
+import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
import net.minecraft.Util;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.BuiltInRegistries;
@@ -20,8 +21,10 @@ import org.slf4j.Logger;
public class AttributeMap {
private static final Logger LOGGER = LogUtils.getLogger();
- private final Map<Attribute, AttributeInstance> attributes = Maps.newHashMap();
- private final Set<AttributeInstance> dirtyAttributes = Sets.newHashSet();
+ // Gale start - Lithium - replace AI attributes with optimized collections
+ private final Map<Attribute, AttributeInstance> attributes = new Reference2ReferenceOpenHashMap<>(0);
+ private final Set<AttributeInstance> dirtyAttributes = new ReferenceOpenHashSet<>(0);
+ // Gale end - Lithium - replace AI attributes with optimized collections
private final AttributeSupplier supplier;
private final java.util.function.Function<Attribute, AttributeInstance> createInstance; // Gale - Airplane - reduce entity allocations

View File

@@ -33,7 +33,7 @@ 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 a53dd1ea02bd19826cd9fd337459b08e9533bce8..dec666713a1d3b5e3f2aa4bcbe8094ade8be1b05 100644
index a57235284cfa2d289b601a53415b205d4193a243..cd9cf7e09d9d271001ef378496fd0955c39bf13e 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 @@
@@ -44,7 +44,7 @@ index a53dd1ea02bd19826cd9fd337459b08e9533bce8..dec666713a1d3b5e3f2aa4bcbe8094ad
import net.minecraft.SharedConstants;
import net.minecraft.network.Connection;
import net.minecraft.network.chat.Component;
@@ -13,7 +15,8 @@ import net.minecraft.server.MinecraftServer;
@@ -14,7 +16,8 @@ import net.minecraft.server.MinecraftServer;
// CraftBukkit start
import java.net.InetAddress;
@@ -54,7 +54,7 @@ index a53dd1ea02bd19826cd9fd337459b08e9533bce8..dec666713a1d3b5e3f2aa4bcbe8094ad
// CraftBukkit end
public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketListener {
@@ -24,7 +27,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
@@ -25,7 +28,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
@@ -63,7 +63,7 @@ index a53dd1ea02bd19826cd9fd337459b08e9533bce8..dec666713a1d3b5e3f2aa4bcbe8094ad
private static int throttleCounter = 0;
// CraftBukkit end
private static final Component IGNORE_STATUS_REASON = Component.translatable("disconnect.ignoring_status_request");
@@ -51,7 +54,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
@@ -82,7 +85,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
InetAddress address = ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getAddress();
synchronized (ServerHandshakePacketListenerImpl.throttleTracker) {
@@ -72,7 +72,7 @@ index a53dd1ea02bd19826cd9fd337459b08e9533bce8..dec666713a1d3b5e3f2aa4bcbe8094ad
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));
@@ -65,13 +68,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
@@ -96,13 +99,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
ServerHandshakePacketListenerImpl.throttleCounter = 0;
// Cleanup stale entries

View File

@@ -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/util/ClassInstanceMultiMap.java b/src/main/java/net/minecraft/util/ClassInstanceMultiMap.java
index df04721911a89c998d7b9d1e9228628e037de45e..0d24957d6efba8aae172c5772f10cb8785c5d9db 100644
index cd28174187133550e418c0e748ce8a06739d0146..99c90bc178975b87c8588998bd8d0b301ec79202 100644
--- a/src/main/java/net/minecraft/util/ClassInstanceMultiMap.java
+++ b/src/main/java/net/minecraft/util/ClassInstanceMultiMap.java
@@ -58,13 +58,33 @@ public class ClassInstanceMultiMap<T> extends AbstractCollection<T> {
@@ -24,7 +24,7 @@ index df04721911a89c998d7b9d1e9228628e037de45e..0d24957d6efba8aae172c5772f10cb87
- throw new IllegalArgumentException("Don't know how to search for " + type);
- } else {
- List<? extends T> list = this.byClass
- .computeIfAbsent(type, typeClass -> this.allInstances.stream().filter(typeClass::isInstance).collect(Collectors.toList()));
- .computeIfAbsent(type, typeClass -> this.allInstances.stream().filter(typeClass::isInstance).collect(Util.toMutableList()));
- return (Collection<S>)Collections.unmodifiableCollection(list);
+ // Gale start - Lithium - avoid Class#isAssignableFrom call in ClassInstanceMultiMap
+ /*

View File

@@ -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 22036ed3ea0629bc12981a8d91a03e55cc2117d6..154b5a8520b13928686c6eb0e2481c3dd1d1de28 100644
index cf8b8c8efd1c9c81eb5f02d75bd75875eb66771f..d195687595d021423478d8e339659b2c0ec9c7e0 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -615,11 +615,18 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -603,11 +603,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 22036ed3ea0629bc12981a8d91a03e55cc2117d6..154b5a8520b13928686c6eb0e2481c3d
}
public boolean equals(Object object) {
@@ -635,11 +642,7 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -623,11 +630,7 @@ public class Block extends BlockBehaviour implements ItemLike {
}
public int hashCode() {

View File

@@ -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/CubeVoxelShape.java b/src/main/java/net/minecraft/world/phys/shapes/CubeVoxelShape.java
index 110405e6e70d980d3e09f04d79562b32a7413071..80ac976e1fcf8b9e584a19aad03b204bea4875b4 100644
index b9af1d14c7815c99273bce8165cf384d669c1a75..93cc8fed22e21f45722f6de30a197b2aaacb1f44 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;

View File

@@ -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 da8cbae05465cd36b87598507f2cd16ca1d82a38..6560fda6525dceddc91b95c8dd82b10debd6b62f 100644
index 70f1aec3e396561b111696b7ddc31ce848702671..4c35356e5a0f5901e640ca0657c0b92d29be766e 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -583,11 +583,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -594,11 +594,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void tryAddFrost() {
@@ -29,9 +29,9 @@ index da8cbae05465cd36b87598507f2cd16ca1d82a38..6560fda6525dceddc91b95c8dd82b10d
if (attributemodifiable == null) {
return;
@@ -597,7 +596,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -608,7 +607,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.ADDITION));
attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADD_VALUE));
}
- }

View File

@@ -321,7 +321,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 adfbdca12fbdee2602feb0158674166d5256e49e..6a9f0daa5644beebc3f7482e25b6c253201bf9e4 100644
index 81368bf186365878db2e1ed305bb7bf36c26f61f..6402665ae8cc8664921ae0298e8b6fa4c31d8b23 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;

View File

@@ -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 bf2c23fad919820512ce031cf28a000b249b2876..d422f6fee7c0fb5ee2f751ede3b894846e61374c 100644
index fdff9788eaf663be79214b2ca491f0f0444f6136..774da40408225b0961b4dea50c4358a03d58b2ff 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -111,6 +111,7 @@ public class Raid {
@@ -115,6 +115,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 bf2c23fad919820512ce031cf28a000b249b2876..d422f6fee7c0fb5ee2f751ede3b89484
public Raid(int id, ServerLevel world, BlockPos pos) {
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
@@ -282,6 +283,12 @@ public class Raid {
@@ -294,6 +295,12 @@ public class Raid {
}
public void tick() {
@@ -37,7 +37,7 @@ index bf2c23fad919820512ce031cf28a000b249b2876..d422f6fee7c0fb5ee2f751ede3b89484
if (!this.isStopped()) {
if (this.status == Raid.RaidStatus.ONGOING) {
boolean flag = this.active;
@@ -652,6 +659,12 @@ public class Raid {
@@ -664,6 +671,12 @@ public class Raid {
}
public void updateBossbar() {

View File

@@ -115,18 +115,10 @@ index 0000000000000000000000000000000000000000..f2f10b651e4fbecdd1ea1bc28ebf40d6
+
+}
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 12898276aae034673484cd60cb598a520a47ce21..21b72322232c5e0c90f579f1816bea9b372767a9 100644
index 59b7d9c9a2a0203f8135a9dcdce302bbf0b2d0f4..c8ff093e5bb8295e61e70d6fb447ed86baa350a4 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -8,6 +8,7 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Predicate;
import java.util.function.Supplier;
import javax.annotation.Nullable;
+
import net.minecraft.Util;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
@@ -84,6 +85,10 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -87,6 +87,10 @@ public class WorldGenRegion implements WorldGenLevel {
private Supplier<String> currentlyGenerating;
private final AtomicLong subTickCount = new AtomicLong();
private static final ResourceLocation WORLDGEN_REGION_RANDOM = new ResourceLocation("worldgen_region_random");
@@ -137,9 +129,9 @@ index 12898276aae034673484cd60cb598a520a47ce21..21b72322232c5e0c90f579f1816bea9b
public WorldGenRegion(ServerLevel world, List<ChunkAccess> chunks, ChunkStatus status, int placementRadius) {
this.generatingStatus = status;
@@ -106,6 +111,11 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -108,6 +112,11 @@ public class WorldGenRegion implements WorldGenLevel {
this.firstPos = ((ChunkAccess) chunks.get(0)).getPos();
this.lastPos = ((ChunkAccess) chunks.get(chunks.size() - 1)).getPos();
this.structureManager = world.structureManager().forWorldGenRegion(this);
}
+ // Gale start - Lithium - optimize world generation chunk and block access
+ this.minChunkX = this.firstPos.x;
@@ -149,7 +141,7 @@ index 12898276aae034673484cd60cb598a520a47ce21..21b72322232c5e0c90f579f1816bea9b
}
// Paper start - starlight
@@ -144,9 +154,29 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -146,8 +155,28 @@ public class WorldGenRegion implements WorldGenLevel {
@Override
public ChunkAccess getChunk(int chunkX, int chunkZ) {
@@ -165,8 +157,8 @@ index 12898276aae034673484cd60cb598a520a47ce21..21b72322232c5e0c90f579f1816bea9b
+ throw new NullPointerException("No chunk exists at " + new ChunkPos(chunkX, chunkZ));
+ }
+ // Gale end - Lithium - optimize world generation chunk and block access - use the chunk array for faster access
}
+ }
+
+ // Gale start - Lithium - optimize world generation chunk and block access
+ /**
+ * Use our chunk fetch function
@@ -174,13 +166,12 @@ index 12898276aae034673484cd60cb598a520a47ce21..21b72322232c5e0c90f579f1816bea9b
+ public ChunkAccess getChunk(BlockPos pos) {
+ // Skip checking chunk.getStatus().isAtLeast(ChunkStatus.EMPTY) here, because it is always true
+ return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ()));
+ }
}
+ // Gale end - Lithium - optimize world generation chunk and block access
+
@Nullable
@Override
public ChunkAccess getChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
@@ -204,7 +234,17 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -212,7 +241,17 @@ public class WorldGenRegion implements WorldGenLevel {
@Override
public BlockState getBlockState(BlockPos pos) {

View File

@@ -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/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
index 98c7f695093acbcf9382a5f07a7a89e373709763..b6059fdc93bcbede66679081c9d1ff564838ac7a 100644
index 8ce870a5341a61fbbaf42021ef7f7f615a6a3e09..0b8c15b079f9b57876692e272b3535cfb125829b 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 {

View File

@@ -1,95 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Thu, 1 Dec 2022 00:37:50 +0100
Subject: [PATCH] Cache ominous banner item
License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/ai/raid/RaiderEntityMixin.java"
By: 2No2Name <2No2Name@web.de>
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/advancements/critereon/EntityEquipmentPredicate.java b/src/main/java/net/minecraft/advancements/critereon/EntityEquipmentPredicate.java
index 96f5ccfa0369ca5dd7a327126dbe9b3cfe86ec1b..e4f1c486639d3488b40fe22ac6c4764ca5f043bd 100644
--- a/src/main/java/net/minecraft/advancements/critereon/EntityEquipmentPredicate.java
+++ b/src/main/java/net/minecraft/advancements/critereon/EntityEquipmentPredicate.java
@@ -31,7 +31,7 @@ public record EntityEquipmentPredicate(
.apply(instance, EntityEquipmentPredicate::new)
);
public static final EntityEquipmentPredicate CAPTAIN = EntityEquipmentPredicate.Builder.equipment()
- .head(ItemPredicate.Builder.item().of(Items.WHITE_BANNER).hasNbt(Raid.getLeaderBannerInstance().getTag()))
+ .head(ItemPredicate.Builder.item().of(Items.WHITE_BANNER).hasNbt(Raid.LEADER_BANNER.getTag())) // Gale - Lithium - cache ominous banner item
.build();
public boolean matches(@Nullable Entity entity) {
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 d422f6fee7c0fb5ee2f751ede3b894846e61374c..541f6491b8578ba9681b6937f9df02b1a742a5cd 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -716,7 +716,7 @@ public class Raid {
this.level.getRaids().setDirty();
}
- public static ItemStack getLeaderBannerInstance() {
+ private static ItemStack createLeaderBanner() { // Gale - Lithium - cache ominous banner item
ItemStack itemstack = new ItemStack(Items.WHITE_BANNER);
CompoundTag nbttagcompound = new CompoundTag();
ListTag nbttaglist = (new BannerPattern.Builder()).addPattern(BannerPatterns.RHOMBUS_MIDDLE, DyeColor.CYAN).addPattern(BannerPatterns.STRIPE_BOTTOM, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.STRIPE_CENTER, DyeColor.GRAY).addPattern(BannerPatterns.BORDER, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.STRIPE_MIDDLE, DyeColor.BLACK).addPattern(BannerPatterns.HALF_HORIZONTAL, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.CIRCLE_MIDDLE, DyeColor.LIGHT_GRAY).addPattern(BannerPatterns.BORDER, DyeColor.BLACK).toListTag();
@@ -728,6 +728,14 @@ public class Raid {
return itemstack;
}
+ // Gale start - Lithium - cache ominous banner item
+ public static final ItemStack LEADER_BANNER = createLeaderBanner();
+
+ public static ItemStack getLeaderBannerInstance() {
+ return LEADER_BANNER.copy();
+ }
+ // Gale end - Lithium - cache ominous banner item
+
@Nullable
public Raider getLeader(int wave) {
return (Raider) this.groupToLeaderMap.get(wave);
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
index 93bbf7556f9599e9dd90761085a57d78bd521867..031355802d86f51489a58561b8806d7d672e4a3b 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -50,7 +50,7 @@ public abstract class Raider extends PatrollingMonster {
protected static final EntityDataAccessor<Boolean> IS_CELEBRATING = SynchedEntityData.defineId(Raider.class, EntityDataSerializers.BOOLEAN);
static final Predicate<ItemEntity> ALLOWED_ITEMS = (entityitem) -> {
- return !entityitem.hasPickUpDelay() && entityitem.isAlive() && ItemStack.matches(entityitem.getItem(), Raid.getLeaderBannerInstance());
+ return !entityitem.hasPickUpDelay() && entityitem.isAlive() && ItemStack.matches(entityitem.getItem(), Raid.LEADER_BANNER); // Gale - Lithium - cache ominous banner item
};
@Nullable
protected Raid raid;
@@ -152,7 +152,7 @@ public abstract class Raider extends PatrollingMonster {
}
}
- if (!itemstack.isEmpty() && ItemStack.matches(itemstack, Raid.getLeaderBannerInstance()) && entityhuman != null) {
+ if (!itemstack.isEmpty() && ItemStack.matches(itemstack, Raid.LEADER_BANNER) && entityhuman != null) { // Gale - Lithium - cache ominous banner item
MobEffectInstance mobeffect = entityhuman.getEffect(MobEffects.BAD_OMEN);
byte b0 = 1;
int i;
@@ -247,7 +247,7 @@ public abstract class Raider extends PatrollingMonster {
ItemStack itemstack = item.getItem();
boolean flag = this.hasActiveRaid() && this.getCurrentRaid().getLeader(this.getWave()) != null;
- if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.getLeaderBannerInstance())) {
+ if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.LEADER_BANNER)) { // Gale - Lithium - cache ominous banner item
// Paper start - EntityPickupItemEvent fixes
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, item, 0, false).isCancelled()) {
return;
@@ -325,7 +325,7 @@ public abstract class Raider extends PatrollingMonster {
if (!this.mob.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
Raid raid = this.mob.getCurrentRaid();
- if (this.mob.hasActiveRaid() && !this.mob.getCurrentRaid().isOver() && this.mob.canBeLeader() && !ItemStack.matches(this.mob.getItemBySlot(EquipmentSlot.HEAD), Raid.getLeaderBannerInstance())) {
+ if (this.mob.hasActiveRaid() && !this.mob.getCurrentRaid().isOver() && this.mob.canBeLeader() && !ItemStack.matches(this.mob.getItemBySlot(EquipmentSlot.HEAD), Raid.LEADER_BANNER)) { // Gale - Lithium - cache ominous banner item
Raider entityraider = raid.getLeader(this.mob.getWave());
if (entityraider == null || !entityraider.isAlive()) {

View File

@@ -17,7 +17,7 @@ Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
villagers that have no secondary POI (farmland) do not search for it
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
index cb1d91f9fe98f21c2afbe3894dfd9bca3bdd3ba6..75dc06a3041bfdfb08c914eb50cfa282ae9eb2fe 100644
index a0e0692d17760f440fe81d52887284c787e562db..1595568f3140a62b0f2236644ac2da11db12af05 100644
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
@@ -22,6 +22,13 @@ public class SecondaryPoiSensor extends Sensor<Villager> {

View File

@@ -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/world/Container.java b/src/main/java/net/minecraft/world/Container.java
index adbc0a9caf5daad2655658f06e42d75270b574b0..965f2bb79a09ee9a0040a8a157a3b8c6a6b6e8a9 100644
index 2c6388d892d0b58ba1800b795418fc9541c3b94c..46e1233036b16cf593c46b9d4ccbbdab4db3a53b 100644
--- a/src/main/java/net/minecraft/world/Container.java
+++ b/src/main/java/net/minecraft/world/Container.java
@@ -127,6 +127,20 @@ public interface Container extends Clearable {
@@ -130,6 +130,20 @@ public interface Container extends Clearable {
});
}
@@ -32,7 +32,7 @@ index adbc0a9caf5daad2655658f06e42d75270b574b0..965f2bb79a09ee9a0040a8a157a3b8c6
for (int i = 0; i < this.getContainerSize(); ++i) {
ItemStack itemstack = this.getItem(i);
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java b/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
index e215491ebaebfc51445adc01452ce768fff3e2dc..a866e254b7faf50e2e64829a7e40db62d4d26424 100644
index 8508ac7de8cda3127b73e11ff4aee62502e65ead..3232f40ef11f59091cec469f0dd40c60ee2a16e9 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
@@ -1,9 +1,8 @@
@@ -47,7 +47,7 @@ index e215491ebaebfc51445adc01452ce768fff3e2dc..a866e254b7faf50e2e64829a7e40db62
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.EntityType;
@@ -15,11 +14,16 @@ import net.minecraft.world.entity.npc.VillagerProfession;
@@ -15,9 +14,14 @@ import net.minecraft.world.entity.npc.VillagerProfession;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
@@ -55,8 +55,6 @@ index e215491ebaebfc51445adc01452ce768fff3e2dc..a866e254b7faf50e2e64829a7e40db62
+import org.jetbrains.annotations.Nullable;
public class TradeWithVillager extends Behavior<Villager> {
private static final int INTERACT_DIST_SQR = 5;
private static final float SPEED_MODIFIER = 0.5F;
- private Set<Item> trades = ImmutableSet.of();
+ // Gale start - optimize villager data storage
+ private static final Item[] WHEAT_SINGLETON_ARRAY = {Items.WHEAT};
@@ -65,8 +63,8 @@ index e215491ebaebfc51445adc01452ce768fff3e2dc..a866e254b7faf50e2e64829a7e40db62
public TradeWithVillager() {
super(
@@ -53,16 +57,18 @@ public class TradeWithVillager extends Behavior<Villager> {
BehaviorUtils.lockGazeAndWalkToEachOther(entity, villager, 0.5F);
@@ -51,16 +55,18 @@ public class TradeWithVillager extends Behavior<Villager> {
BehaviorUtils.lockGazeAndWalkToEachOther(entity, villager, 0.5F, 2);
entity.gossip(world, villager, time);
if (entity.hasExcessFood() && (entity.getVillagerData().getProfession() == VillagerProfession.FARMER || villager.wantsMoreFood())) {
- throwHalfStack(entity, Villager.FOOD_POINTS.keySet(), villager);
@@ -74,7 +72,7 @@ index e215491ebaebfc51445adc01452ce768fff3e2dc..a866e254b7faf50e2e64829a7e40db62
}
if (villager.getVillagerData().getProfession() == VillagerProfession.FARMER
&& entity.getInventory().countItem(Items.WHEAT) > Items.WHEAT.getMaxStackSize() / 2) {
&& entity.getInventory().countItem(Items.WHEAT) > Items.WHEAT.getDefaultMaxStackSize() / 2) {
- throwHalfStack(entity, ImmutableSet.of(Items.WHEAT), villager);
+ throwHalfStack(entity, Villager.FOOD_POINTS_KEY_ARRAY, villager); // Gale - optimize villager data storage
}
@@ -87,7 +85,7 @@ index e215491ebaebfc51445adc01452ce768fff3e2dc..a866e254b7faf50e2e64829a7e40db62
}
}
}
@@ -72,13 +78,36 @@ public class TradeWithVillager extends Behavior<Villager> {
@@ -70,13 +76,36 @@ public class TradeWithVillager extends Behavior<Villager> {
villager.getBrain().eraseMemory(MemoryModuleType.INTERACTION_TARGET);
}
@@ -129,7 +127,7 @@ index e215491ebaebfc51445adc01452ce768fff3e2dc..a866e254b7faf50e2e64829a7e40db62
SimpleContainer simpleContainer = villager.getInventory();
ItemStack itemStack = ItemStack.EMPTY;
int i = 0;
@@ -91,7 +120,16 @@ public class TradeWithVillager extends Behavior<Villager> {
@@ -89,7 +118,16 @@ public class TradeWithVillager extends Behavior<Villager> {
itemStack2 = simpleContainer.getItem(i);
if (!itemStack2.isEmpty()) {
item = itemStack2.getItem();
@@ -212,7 +210,7 @@ index 1595568f3140a62b0f2236644ac2da11db12af05..ce8851c2cacfd3145b1e2c11443140a0
} else {
brain.eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE);
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index 5fb3a32991b32132b0db56933671d2f999df667d..d88cebe9a348ec99bff05c650d101c80cc38c747 100644
index 64ec94ba2b2ce3884f56c95464384fbc1d29e36c..de41f5b57cb4220daf312cc8724cc32d3dd6f7a6 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -90,6 +90,7 @@ import net.minecraft.world.item.trading.MerchantOffers;
@@ -234,7 +232,7 @@ index 5fb3a32991b32132b0db56933671d2f999df667d..d88cebe9a348ec99bff05c650d101c80
private static final int MAX_GOSSIP_TOPICS = 10;
private static final int GOSSIP_COOLDOWN = 1200;
private static final int GOSSIP_DECAY_INTERVAL = 24000;
@@ -916,7 +918,28 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@@ -908,7 +910,28 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
public boolean wantsToPickUp(ItemStack stack) {
Item item = stack.getItem();

View File

@@ -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 7db079ab7670be9cfb72c3f2efa492fabb469405..4f34ca69a0f417028bad01f4a29644a1e08bb9ca 100644
index cb4f71f93f45ec1e91e7ca883cfce93c2260c990..bdec8d108b7b5544c42d37667c53613cab35e8ea 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -317,6 +317,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -320,6 +320,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public float yRotO;
public float xRotO;
private AABB bb;
@@ -24,7 +24,7 @@ index 7db079ab7670be9cfb72c3f2efa492fabb469405..4f34ca69a0f417028bad01f4a29644a1
public boolean onGround;
public boolean horizontalCollision;
public boolean verticalCollision;
@@ -1088,6 +1089,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -1130,6 +1131,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Paper end - detailed watchdog information
public void move(MoverType movementType, Vec3 movement) {
@@ -36,7 +36,7 @@ index 7db079ab7670be9cfb72c3f2efa492fabb469405..4f34ca69a0f417028bad01f4a29644a1
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");
@@ -4089,6 +4095,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4140,6 +4146,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public final void setBoundingBox(AABB boundingBox) {

View File

@@ -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/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 0d7bc05bd4a0195ca3136d0e876907eac2da79b9..1a5f1c825598dbc05f446273632ed8c4a45ef43a 100644
index aaff62e2706b67772684193a9d05ebda1ff9e343..a2c5b824a3126f0c7970550f509db9407c66ee28 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -14,6 +14,7 @@ import com.mojang.datafixers.util.Either;
@@ -13,6 +13,7 @@ import com.mojang.datafixers.DataFixer;
import com.mojang.logging.LogUtils;
import com.mojang.serialization.DataResult;
import com.mojang.serialization.JsonOps;
@@ -24,7 +24,7 @@ index 0d7bc05bd4a0195ca3136d0e876907eac2da79b9..1a5f1c825598dbc05f446273632ed8c4
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.longs.Long2ByteMap;
@@ -250,7 +251,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -253,7 +254,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper - rewrite chunk system
this.tickingGenerated = new AtomicInteger();
this.playerMap = new PlayerMap();

View File

@@ -46,11 +46,11 @@ 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 1d80678f7e8f658e43616f0baf723f096a99122a..865f244de1605303f22d8944174b0fe00115cab0 100644
index 3ce86f952a18cae7fda1903916903b31a63a40b4..0dfc2ccd8f454d0252542312661f65f41a6209ab 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
@@ -418,7 +418,59 @@ public class Sheep extends Animal implements Shearable {
return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
@@ -421,7 +421,59 @@ public class Sheep extends Animal implements Shearable {
return super.finalizeSpawn(world, difficulty, spawnReason, entityData);
}
+ // Gale start - carpet-fixes - optimize sheep offspring color

View File

@@ -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 4f34ca69a0f417028bad01f4a29644a1e08bb9ca..b4d78f2609a58e4aba0340ebfce229bb78135475 100644
index bdec8d108b7b5544c42d37667c53613cab35e8ea..394e7d59b0c625ed9f30e611a255768a98229e23 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -891,7 +891,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -935,7 +935,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.checkBelowWorld();
if (!this.level().isClientSide) {

View File

@@ -13,10 +13,10 @@ 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 366ce8120b0cc7136d2756070d710ec65ae7f44d..98c5da21177665d9d3b0e6a4136ae6a21d0154af 100644
index 6d04be3a75df1f847389b985c9b1c0330c9e2415..fd7057487e4c86ff584ceb30c08b26b0fde5caad 100644
--- a/src/main/java/net/minecraft/advancements/Advancement.java
+++ b/src/main/java/net/minecraft/advancements/Advancement.java
@@ -62,7 +62,7 @@ public record Advancement(
@@ -60,7 +60,7 @@ public record Advancement(
AdvancementRequirements requirements,
boolean sendsTelemetryEvent
) {

View File

@@ -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 9805ee5989d813f45b5b0829d73ebce3909b5f07..ab0ac738f3e3d231d8fbc663230892d3a5f07660 100644
index 44424717623aa45c00dc69b23fc9741117650de3..cf51f108753a19e3ab97a6df3e5cecaa4d39f293 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1737,7 +1737,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1743,7 +1743,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public void destroyBlockProgress(int entityId, BlockPos pos, int progress) {
@@ -35,7 +35,7 @@ index 9805ee5989d813f45b5b0829d73ebce3909b5f07..ab0ac738f3e3d231d8fbc663230892d3
// CraftBukkit start
Player entityhuman = null;
@@ -1771,7 +1781,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1777,7 +1787,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit end
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {

View File

@@ -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 c28ad37a7b69992ef80aeffefb04028a084deb5c..2cbac277c6f404458d2277c37287acb382e733ad 100644
index d502cc7221851e92b6f9d1522d33e9817ff18f6f..a4e813aeae443aecf78515d3759b2a65fd14f8ea 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 c28ad37a7b69992ef80aeffefb04028a084deb5c..2cbac277c6f404458d2277c37287acb3
import java.util.Collection;
import java.util.EnumSet;
import java.util.Iterator;
@@ -134,10 +136,11 @@ public abstract class PlayerList {
@@ -136,10 +138,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 c28ad37a7b69992ef80aeffefb04028a084deb5c..2cbac277c6f404458d2277c37287acb3
private final Map<UUID, ServerPlayer> playersByUUID = Maps.newHashMap();
private final UserBanList bans;
private final IpBanList ipBans;
@@ -328,6 +331,7 @@ public abstract class PlayerList {
@@ -330,6 +333,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 c28ad37a7b69992ef80aeffefb04028a084deb5c..2cbac277c6f404458d2277c37287acb3
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
@@ -671,6 +675,7 @@ public abstract class PlayerList {
@@ -669,6 +673,7 @@ public abstract class PlayerList {
entityplayer.retireScheduler(); // Paper - Folia schedulers
entityplayer.getAdvancements().stopListening();
this.players.remove(entityplayer);
@@ -78,7 +78,7 @@ index c28ad37a7b69992ef80aeffefb04028a084deb5c..2cbac277c6f404458d2277c37287acb3
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
this.server.getCustomBossEvents().onPlayerDisconnect(entityplayer);
UUID uuid = entityplayer.getUUID();
@@ -832,6 +837,7 @@ public abstract class PlayerList {
@@ -831,6 +836,7 @@ public abstract class PlayerList {
// Paper end - Expand PlayerRespawnEvent
entityplayer.stopRiding(); // CraftBukkit
this.players.remove(entityplayer);
@@ -86,7 +86,7 @@ index c28ad37a7b69992ef80aeffefb04028a084deb5c..2cbac277c6f404458d2277c37287acb3
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
entityplayer.serverLevel().removePlayerImmediately(entityplayer, Entity.RemovalReason.DISCARDED);
BlockPos blockposition = entityplayer.getRespawnPosition();
@@ -968,6 +974,7 @@ public abstract class PlayerList {
@@ -967,6 +973,7 @@ public abstract class PlayerList {
if (!entityplayer.connection.isDisconnected()) {
worldserver1.addRespawnedPlayer(entityplayer1);
this.players.add(entityplayer1);
@@ -94,7 +94,7 @@ index c28ad37a7b69992ef80aeffefb04028a084deb5c..2cbac277c6f404458d2277c37287acb3
this.playersByName.put(entityplayer1.getScoreboardName().toLowerCase(java.util.Locale.ROOT), entityplayer1); // Spigot
this.playersByUUID.put(entityplayer1.getUUID(), entityplayer1);
}
@@ -1026,20 +1033,55 @@ public abstract class PlayerList {
@@ -1025,20 +1032,55 @@ public abstract class PlayerList {
this.sendPlayerPermissionLevel(player, i, recalculatePermissions); // Paper - avoid recalculating permissions if possible
}
@@ -157,10 +157,10 @@ index c28ad37a7b69992ef80aeffefb04028a084deb5c..2cbac277c6f404458d2277c37287acb3
}
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 e1b2b6a55d0a837d2a447dcc636a9f29aa4597e7..d330bc19eff2d2147eec2ad52bdeb1d12f2a5a1f 100644
index f4f45fa391c36f66abdf1c16c0f3e31f5dda1c1a..82d3fdc8fb10724c40015349b0ddc60143dc86b2 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -39,6 +39,7 @@ import net.minecraft.network.syncher.SynchedEntityData;
@@ -38,6 +38,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 e1b2b6a55d0a837d2a447dcc636a9f29aa4597e7..d330bc19eff2d2147eec2ad52bdeb1d1
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
@@ -194,12 +195,15 @@ public abstract class Player extends LivingEntity {
@@ -206,12 +207,15 @@ public abstract class Player extends LivingEntity {
}
// CraftBukkit end

View File

@@ -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 2cbac277c6f404458d2277c37287acb382e733ad..7809a28bb9029d4ab5a995471bb1b9133305598c 100644
index a4e813aeae443aecf78515d3759b2a65fd14f8ea..e37c9320083334680e7ccdd12e875feb78f29414 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1069,14 +1069,18 @@ public abstract class PlayerList {
@@ -1068,14 +1068,18 @@ public abstract class PlayerList {
// Gale start - Purpur - spread out sending all player info
ServerPlayer[] sendAllPlayerInfoBucket = this.sendAllPlayerInfoBuckets[this.sendAllPlayerInfoIn];
if (sendAllPlayerInfoBucket != null) {

View File

@@ -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 7600991949de84b6667c0a80bfec4a13823ab9b8..3842fcd51f2a56aaa6d2fd190e837f5862e6ab87 100644
index 7ab8f7cae70d3ab730bd532caff4cb97e639db6e..58e0de81eea9626a177e2ccdf1a4542cf9f4552e 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -499,6 +499,7 @@ public class Commands {
@@ -494,6 +494,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 7600991949de84b6667c0a80bfec4a13823ab9b8..3842fcd51f2a56aaa6d2fd190e837f58
PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit));
event.getPlayer().getServer().getPluginManager().callEvent(event);
@@ -509,6 +510,7 @@ public class Commands {
@@ -504,6 +505,7 @@ public class Commands {
}
}
// CraftBukkit end

View File

@@ -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 e7583996cc6d750cbd72f749de39ecded56d7f7c..d791c2f2facfc46d8664225c8b28f95f92df3413 100644
index aeb1db18e864e419bb30e75d24715794d52c40d1..83196467cf7152ba756f5f6d179ee17c00a4325f 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 e7583996cc6d750cbd72f749de39ecded56d7f7c..d791c2f2facfc46d8664225c8b28f95f
import net.minecraft.ChatFormatting;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
@@ -28,6 +31,7 @@ import net.minecraft.server.level.ClientInformation;
@@ -30,6 +33,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,10 +58,10 @@ index e7583996cc6d750cbd72f749de39ecded56d7f7c..d791c2f2facfc46d8664225c8b28f95f
import org.slf4j.Logger;
// CraftBukkit start
@@ -51,10 +55,14 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private long keepAliveTime = Util.getMillis(); // Paper
private boolean keepAlivePending;
@@ -73,10 +77,14 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private long keepAliveChallenge;
private long closedListenerTime;
private boolean closed = false;
+ private LongList keepAlives = new LongArrayList(); // Gale - Purpur - send multiple keep-alive packets
private int latency;
private volatile boolean suspendFlushingOnServerThread = false;
@@ -74,7 +74,7 @@ index e7583996cc6d750cbd72f749de39ecded56d7f7c..d791c2f2facfc46d8664225c8b28f95f
protected static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support
public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit
@@ -92,6 +100,16 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -124,6 +132,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 e7583996cc6d750cbd72f749de39ecded56d7f7c..d791c2f2facfc46d8664225c8b28f95f
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
int i = (int) (Util.getMillis() - this.keepAliveTime);
@@ -104,6 +122,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -136,6 +154,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 e7583996cc6d750cbd72f749de39ecded56d7f7c..d791c2f2facfc46d8664225c8b28f95f
}
@@ -208,6 +227,20 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -251,6 +270,20 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
long currentTime = Util.getMillis();
long elapsedTime = currentTime - this.keepAliveTime;
@@ -117,10 +117,10 @@ index e7583996cc6d750cbd72f749de39ecded56d7f7c..d791c2f2facfc46d8664225c8b28f95f
+ }
+ } else {
+ // Gale end - Purpur - send multiple keep-alive packets
if (this.keepAlivePending) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info
@@ -221,6 +254,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
if (!this.isSingleplayerOwner() && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected
if (this.keepAlivePending && !this.processedDisconnect) { // Paper
this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
@@ -261,6 +294,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge));
}
}
@@ -129,10 +129,10 @@ index e7583996cc6d750cbd72f749de39ecded56d7f7c..d791c2f2facfc46d8664225c8b28f95f
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 6d7d6858c021d2d14a83bbe40404c749c449e589..718616e97de1442930dc755c83c58946800f28d8 100644
index f0436b9a2457eac9904e56f45fa1118e83d090cc..5d02133cffb226ea7e48f517c1414ee7933b300f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -8,6 +8,8 @@ import com.mojang.brigadier.StringReader;
@@ -9,6 +9,8 @@ import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.logging.LogUtils;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry;
import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
@@ -141,7 +141,7 @@ index 6d7d6858c021d2d14a83bbe40404c749c449e589..718616e97de1442930dc755c83c58946
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectIterator;
import java.net.SocketAddress;
@@ -3413,6 +3415,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3489,6 +3491,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
@Override

View File

@@ -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/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index a87be49d91e0bd95d5d5aa9f140f3f29f1c8b565..e072edfb1f51f3e219e6deb10b19b4b2502ea87f 100644
index 0588e43e7607b10f66db6d0b615141250031699a..056bfdaa4d9a12b9442dfa76c8094dc7e26febe9 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -94,7 +94,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -121,7 +121,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
this.finishLoginAndWaitForClient(this.authenticatedProfile);
}

View File

@@ -13,10 +13,10 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
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 b4d78f2609a58e4aba0340ebfce229bb78135475..c445d59036c9de418997ad3be9bc3912e8fefff4 100644
index 394e7d59b0c625ed9f30e611a255768a98229e23..93fb3fe1e411675854aee41e57aee788ee32e40e 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3712,6 +3712,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3759,6 +3759,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
Entity entity = this.getType().create(worldserver);
if (entity != null) {
@@ -31,10 +31,10 @@ index b4d78f2609a58e4aba0340ebfce229bb78135475..c445d59036c9de418997ad3be9bc3912
entity.moveTo(position.x, position.y, position.z, yaw, pitch); // Paper - EntityPortalExitEvent
entity.setDeltaMovement(velocity); // Paper - EntityPortalExitEvent
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
index c5b23bafb7909130a8a294e3b5bf94daa313ee11..f6e4fada132faeb37c076013ef7c54147de42ba8 100644
index 5d499e77800466210473e36b2355873807b9f86a..50202c41535f823240e9e8fd5348e3d474814c1b 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
@@ -126,6 +126,11 @@ public class GaleWorldConfiguration extends ConfigurationPart {
@@ -125,6 +125,11 @@ public class GaleWorldConfiguration extends ConfigurationPart {
}

View File

@@ -13,10 +13,10 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
index ed80960777b18faca2d6a99783e53daf5fa19e09..3380125f68b865977ac627579615820405bc98df 100644
index 1b1b475ca27e799e251d6f8a8c9fe1a4fd8bae83..ae1e164285f5675371bf036c8a564d9f5c1dd395 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -71,7 +71,15 @@ public class PhantomSpawner implements CustomSpawner {
@@ -70,7 +70,15 @@ public class PhantomSpawner implements CustomSpawner {
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper - Ability to control player's insomnia and phantoms
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21));
@@ -34,10 +34,10 @@ index ed80960777b18faca2d6a99783e53daf5fa19e09..3380125f68b865977ac6275796158204
if (NaturalSpawner.isValidEmptySpawnBlock(world, blockposition1, iblockdata, fluid, EntityType.PHANTOM)) {
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
index f6e4fada132faeb37c076013ef7c54147de42ba8..bc8af8c6b5f0d4717317e072b3be7348b2eeee76 100644
index 50202c41535f823240e9e8fd5348e3d474814c1b..fb7159842ae81899514267fcaba077638d999348 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
@@ -93,6 +93,11 @@ public class GaleWorldConfiguration extends ConfigurationPart {
@@ -92,6 +92,11 @@ public class GaleWorldConfiguration extends ConfigurationPart {
}

View File

@@ -7,20 +7,20 @@ 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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index c445d59036c9de418997ad3be9bc3912e8fefff4..3245cbbd3b5c14e234a4b79279792b961c45ebd1 100644
index 93fb3fe1e411675854aee41e57aee788ee32e40e..3839f54583c0bbc73a0c48f1ef068ecf81c7553e 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4624,6 +4624,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return this.feetBlockState;
@@ -4681,6 +4681,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return this.inBlockState;
}
+ // Gale start - don't load chunks to activate climbing entities
+ public @Nullable BlockState getFeetBlockStateIfLoaded() {
+ if (this.feetBlockState == null) {
+ this.feetBlockState = this.level.getBlockStateIfLoaded(this.blockPosition());
+ public @Nullable BlockState getInBlockStateIfLoaded() {
+ if (this.inBlockState == null) {
+ this.inBlockState = this.level.getBlockStateIfLoaded(this.blockPosition());
+ }
+
+ return this.feetBlockState;
+ return this.inBlockState;
+ }
+ // Gale end - don't load chunks to activate climbing entities
+
@@ -28,10 +28,10 @@ index c445d59036c9de418997ad3be9bc3912e8fefff4..3245cbbd3b5c14e234a4b79279792b96
return this.chunkPosition;
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6560fda6525dceddc91b95c8dd82b10debd6b62f..9b33b8b6aa769aceeb8080814b0682cbcb035ffb 100644
index 4c35356e5a0f5901e640ca0657c0b92d29be766e..5ff0232c18bae1f9e149c3d065f89350de8e6d12 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2038,19 +2038,43 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -2064,19 +2064,43 @@ public abstract class LivingEntity extends Entity implements Attackable {
public boolean onClimbableCached() {
if (!this.blockPosition().equals(this.lastClimbingPosition)) {
@@ -63,13 +63,13 @@ index 6560fda6525dceddc91b95c8dd82b10debd6b62f..9b33b8b6aa769aceeb8080814b0682cb
return false;
} else {
BlockPos blockposition = this.blockPosition();
- BlockState iblockdata = this.getFeetBlockState();
- BlockState iblockdata = this.getInBlockState();
+ // Gale start - don't load chunks to activate climbing entities
+ BlockState iblockdata;
+ if (loadChunk) {
+ iblockdata = this.getFeetBlockState();
+ iblockdata = this.getInBlockState();
+ } else {
+ iblockdata = this.getFeetBlockStateIfLoaded();
+ iblockdata = this.getInBlockStateIfLoaded();
+ if (iblockdata == null) {
+ return null;
+ }
@@ -79,10 +79,10 @@ index 6560fda6525dceddc91b95c8dd82b10debd6b62f..9b33b8b6aa769aceeb8080814b0682cb
if (iblockdata.is(BlockTags.CLIMBABLE)) {
this.lastClimbablePos = Optional.of(blockposition);
diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
index bc8af8c6b5f0d4717317e072b3be7348b2eeee76..9c7342ed33eb0051a8f8b7b18a02cdbccd003eb9 100644
index fb7159842ae81899514267fcaba077638d999348..627d56be7682cad2c713911a3a3603079d109573 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java
@@ -96,6 +96,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
@@ -95,6 +95,7 @@ public class GaleWorldConfiguration extends ConfigurationPart {
public LoadChunks loadChunks;
public class LoadChunks extends ConfigurationPart {
public boolean toSpawnPhantoms = false; // Gale - MultiPaper - don't load chunks to spawn phantoms

Some files were not shown because too many files have changed in this diff Show More