Compare commits

...

14 Commits

Author SHA1 Message Date
AlphaKR93
491c491ba6 Updated Upstream (Paper, Purpur) 2024-05-04 18:13:25 +09:00
AlphaKR93
4815251655 1.20.6 2024-05-04 17:41:34 +09:00
AlphaKR93
4fc2eec8b7 fix compile 2024-05-04 17:29:16 +09:00
AlphaKR93
39a32b7ea3 done. 2024-05-04 17:13:01 +09:00
AlphaKR93
5b5d1c1281 30/37 2024-05-04 17:07:01 +09:00
AlphaKR93
aede6b2591 20/37 2024-05-04 16:50:58 +09:00
AlphaKR93
d526550c66 work 2024-05-03 21:51:38 +09:00
AlphaKR93
8e50bc4b0c aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 2024-05-03 17:12:08 +09:00
AlphaKR93
e25871e11c 10/37 2024-05-01 21:02:18 +09:00
AlphaKR93
75f1875e4b Reduce allocations 2024-05-01 19:34:01 +09:00
AlphaKR93
f495171031 work 2024-05-01 13:18:20 +09:00
AlphaKR93
9b1303d849 API patches done 2024-04-30 23:49:03 +09:00
AlphaKR93
cee005f2b9 work 2024-04-30 23:18:39 +09:00
AlphaKR93
6b4bc276a0 initial work 2024-04-30 15:24:46 +09:00
72 changed files with 5052 additions and 9578 deletions

View File

@@ -1,4 +1,4 @@
name: Release Plazma (1.20.4)
name: Release Plazma (1.20.6)
on:
push:
@@ -9,14 +9,14 @@ on:
env:
ORG_NAME: PlazmaMC
MC_VERSION: 1.20.4
MC_VERSION: 1.20.6
jobs:
release:
name: Release Plazma
strategy:
matrix:
base_jdk: [17]
base_jdk: [21]
os: [ubuntu-22.04]
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"

View File

@@ -10,8 +10,10 @@ plugins {
alias(libs.plugins.paperweight)
}
val jdkVersion = property("jdkVersion").toString().toInt()
kotlin.jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(jdkVersion)
}
repositories {
@@ -33,7 +35,7 @@ allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
java.toolchain.languageVersion.set(JavaLanguageVersion.of(jdkVersion))
publishing {
repositories {
@@ -59,7 +61,7 @@ subprojects {
withType<JavaCompile>().configureEach {
options.compilerArgs.addAll(listOf("--add-modules=jdk.incubator.vector", "-Xmaxwarns", "1"))
options.encoding = Charsets.UTF_8.name()
options.release = 17
options.release = jdkVersion
}
withType<Javadoc> {
@@ -83,6 +85,9 @@ subprojects {
mavenCentral()
maven("https://jitpack.io")
maven("https://papermc.io/repo/repository/maven-public/")
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
name = "sonatype-oss-snapshots"
}
}
}
@@ -118,12 +123,19 @@ paperweight {
}
alwaysUpToDate {
paperRepository.set("https://github.com/PaperMC/Paper")
paperBranch.set("master")
purpurRepository.set("https://github.com/PurpurMC/Purpur")
purpurBranch.set("ver/1.20.4")
pufferfishRepository.set("https://github.com/pufferfish-gg/Pufferfish")
pufferfishBranch.set("ver/1.20")
paperRepoName.set("org.plazmamc.alwaysuptodate.paper.repository")
paperBranchName.set("paperBranch")
paperCommitName.set("paperCommit")
purpurRepoName.set("org.plazmamc.alwaysuptodate.purpur.repository")
purpurBranchName.set("purpurBranch")
purpurCommitName.set("purpurCommit")
pufferfishRepoName.set("pufferfishRepo")
pufferfishBranchName.set("pufferfishBranch")
pufferfishToggleName.set("usePufferfish")
}
tasks {

View File

@@ -14,7 +14,7 @@ kotlin.jvmToolchain {
}
dependencies {
shadow("io.papermc.paperweight:paperweight-patcher:1.5.11-SNAPSHOT")
shadow("io.papermc.paperweight:paperweight-patcher:1.6.2-SNAPSHOT")
}
tasks {

View File

@@ -10,11 +10,13 @@ import org.plazmamc.alwaysuptodate.tasks.PurpurUpdateTask
class AlwaysUpToDate : Plugin<Project> {
override fun apply(target: Project) {
target.extensions.create("alwaysUpToDate", AlwaysUpToDateExtension::class.java)
target.tasks.register("updatePaper", PaperUpdateTask::class.java)
target.tasks.register("updatePurpur", PurpurUpdateTask::class.java)
target.tasks.register("checkPaperCommit", CheckPaperCommitTask::class.java)
target.tasks.register("checkPurpurCommit", CheckPurpurCommitTask::class.java)
}
}

View File

@@ -4,13 +4,16 @@ import org.gradle.api.provider.Property
interface AlwaysUpToDateExtension {
val paperRepository: Property<String>
val paperBranch: Property<String>
val paperBranchName: Property<String>
val paperRepoName: Property<String>
val paperCommitName: Property<String>
val pufferfishRepository: Property<String>
val pufferfishBranch: Property<String>
val pufferfishToggleName: Property<String>
val pufferfishBranchName: Property<String>
val pufferfishRepoName: Property<String>
val purpurRepository: Property<String>
val purpurBranch: Property<String>
val purpurBranchName: Property<String>
val purpurRepoName: Property<String>
val purpurCommitName: Property<String>
}

View File

@@ -18,7 +18,11 @@ abstract class CheckPaperCommitTask : Task() {
@TaskAction
fun check() {
println(project.checkCommit(property.paperRepository.get(), property.paperBranch.get(), "paperCommit"))
println(project.checkCommit(
project.property(property.paperRepoName.get()).toString(),
project.property(property.paperBranchName.get()).toString(),
property.paperCommitName.get()
))
}
}
@@ -29,17 +33,21 @@ abstract class CheckPurpurCommitTask : Task() {
@TaskAction
fun check() {
println(project.checkCommit(property.purpurRepository.get(), property.purpurBranch.get(), "purpurCommit"))
println(project.checkCommit(
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
property.purpurCommitName.get()
))
}
}
fun Project.getLatest(repository: String, branch: String) : String {
val regex = "[a-z0-9]{40}\trefs/heads/$branch".toRegex()
val temp = Git(project.pathIO)("ls-remote", repository).readText()
return Git(project.pathIO)("ls-remote", repository).readText()?.lines()
?.filterNot { regex.matches(it) }?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Purpur commit")
return temp?.lines()?.first { regex.matches(it) }?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest commit of $repository")
}
fun Project.checkCommit(repository: String, branch: String, propertyName: String) : Boolean {
@@ -54,7 +62,7 @@ fun Project.createCompareComment(repository: String, branch: String, before: Str
val rawRepo = URI.create(repository).path.substring(1)
if (!clear) builder.append(project.file("compare.txt").readText())
builder.append("\n\n[${rawRepo.split("/").last()} Changes]")
builder.append("\n\n[${rawRepo.split("/").last()} Changes]\n")
gson.fromJson<JsonObject>(URI.create("https://api.github.com/repos/$rawRepo/compare/$before...$branch").toURL().readText())["commits"].asJsonArray.forEach {
val commit = it.asJsonObject

View File

@@ -14,23 +14,33 @@ abstract class PaperUpdateTask : Task() {
override fun init() {
outputs.upToDateWhen {
project.checkCommit(
property.paperRepository.get(),
property.paperBranch.get(),
"purpurCommit"
project.property(property.paperRepoName.get()).toString(),
project.property(property.paperBranchName.get()).toString(),
property.paperCommitName.get()
)
}
}
@TaskAction
fun update() {
if (project.checkCommit(property.paperRepository.get(), property.paperBranch.get(), "purpurCommit")) return
if (project.checkCommit(
project.property(property.paperRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
property.purpurCommitName.get()
)) return
project.createCompareComment(
property.paperRepository.get(),
property.paperBranch.get(),
project.properties["paperCommit"] as String,
project.property(property.paperRepoName.get()).toString(),
project.property(property.paperBranchName.get()).toString(),
project.property(property.paperCommitName.get()).toString(),
true
)
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), project.file("gradle.properties"))
updatePaperCommit(
project.property(property.paperRepoName.get()).toString(),
project.property(property.paperBranchName.get()).toString(),
project.file("gradle.properties")
)
}
}

View File

@@ -11,6 +11,7 @@ import org.plazmamc.alwaysuptodate.utils.Gradle
import org.plazmamc.alwaysuptodate.utils.addCommit
import org.plazmamc.alwaysuptodate.utils.clone
import java.nio.file.Path
import java.util.Calendar
import kotlin.io.path.createDirectories
import kotlin.io.path.exists
@@ -19,7 +20,7 @@ abstract class PurpurUpdateTask : Task() {
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
private val pufferfishCommit = """
Pufferfish
Copyright (C) 2024 Pufferfish Studios LLC
Copyright (C) ${Calendar.getInstance().get(Calendar.YEAR)} Pufferfish Studios LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +37,7 @@ abstract class PurpurUpdateTask : Task() {
""".trimIndent()
private val purpurCommit = """
PurpurMC
Copyright (C) 2024 PurpurMC
Copyright (C) ${Calendar.getInstance().get(Calendar.YEAR)} PurpurMC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -60,51 +61,137 @@ abstract class PurpurUpdateTask : Task() {
override fun init() {
outputs.upToDateWhen {
project.checkCommit(
property.purpurRepository.get(),
property.purpurBranch.get(),
"purpurCommit"
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
property.purpurCommitName.get()
)
}
}
@TaskAction
fun update() {
if (project.checkCommit(property.purpurRepository.get(), property.purpurBranch.get(), "purpurCommit")) return
Git.checkForGit()
project.createCompareComment(
property.purpurRepository.get(),
property.purpurBranch.get(),
project.properties["purpurCommit"] as String,
true
)
val dir = project.layout.cache.resolve("AlwaysUpToDate/UpdatePurpur")
if (dir.exists()) dir.toFile().deleteRecursively()
dir.createDirectories()
private fun withoutPufferfish(dir: Path) {
val git = Git(dir)
val pufferfish = git.clone("Pufferfish", property.pufferfishRepository.get(), property.pufferfishBranch.get(), dir)
val purpur = git.clone("Purpur", property.purpurRepository.get(), property.purpurBranch.get(), dir)
val purpur = git.clone(
"Purpur",
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
dir
)
val purpurPatches = purpur.resolve("patches")
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), pufferfish.resolve("gradle.properties").toFile(), "paperRef=")
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), purpur.resolve("gradle.properties").toFile())
project.properties.let {
it[property.paperRepoName.get()].toString() to it[property.paperBranchName.get()].toString()
}.also {
updatePaperCommit(it.first, it.second, purpur.resolve("gradle.properties").toFile())
if (project.checkCommit(
it.first,
it.second,
property.paperCommitName.get()
)) return@also
if (!project.checkCommit(property.paperRepository.get(), property.paperBranch.get(), "paperCommit")) {
project.createCompareComment(
property.paperRepository.get(),
property.paperBranch.get(),
project.properties["paperCommit"] as String
it.first,
it.second,
project.property(property.paperCommitName.get()).toString()
)
updatePaperCommit(
property.paperRepository.get(),
property.paperBranch.get(),
it.first,
it.second,
project.file("gradle.properties")
)
}
val latestCommit = git("ls-remote", property.purpurRepository.get()).readText()?.lines()
?.filterNot { "[a-z0-9]{40}\trefs/heads/${property.purpurBranch.get()}".toRegex().matches(it) }?.first()?.split("\t")?.first()
val latestCommit = git("ls-remote", project.property(property.purpurRepoName.get()).toString()).readText()?.lines()
?.filterNot { "[a-z0-9]{40}\trefs/heads/${project.property(property.purpurBranchName.get())}".toRegex().matches(it) }
?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Purpur commit")
val purpurGradle = Gradle(purpur)
purpurGradle("applyPatches").executeOut()
purpur.resolve("Purpur-Server").also {
val dotGit = it.resolve(".git").toFile()
dotGit.deleteRecursively()
copySource(it)
val paper = purpur.resolve(".gradle/caches/paperweight/upstreams/paper/Paper-Server")
copySource(paper)
Git(paper).addCommit("Vanilla Sources", "--author=Vanilla <auto@mated.null>")
Thread.sleep(1_000)
paper.resolve(".git").toFile().copyRecursively(dotGit, overwrite = true)
Git(it).addCommit("Purpur Server Changes\n\n$purpurCommit", "--author=granny <contact@granny.dev>")
}
purpur.resolve("Purpur-API").also {
val dotGit = it.resolve(".git").toFile()
dotGit.deleteRecursively()
val paper = purpur.resolve(".gradle/caches/paperweight/upstreams/paper/Paper-API")
paper.resolve(".git").toFile().copyRecursively(dotGit, overwrite = true)
Git(it).addCommit("Purpur API Changes\n\n$purpurCommit", "--author=granny <contact@granny.dev>")
}
purpurGradle("rebuildPatches").executeOut()
project.layout.projectDirectory.path.resolve("patches").also {
with(purpurPatches.resolve("server")) {
val target = it.resolve("server")
copyPatch(this, target, "0001-Purpur-Server-Changes.patch")
}
with(purpurPatches.resolve("api")) {
val target = it.resolve("api")
copyPatch(this, target, "0001-Purpur-API-Changes.patch")
}
}
project.file("gradle.properties").writeText(
project.file("gradle.properties").readText()
.replace("purpurCommit = .*".toRegex(), "purpurCommit = $latestCommit")
)
}
private fun withPufferfish(dir: Path) {
val git = Git(dir)
val pufferfish = git.clone(
"Pufferfish",
project.property(property.pufferfishRepoName.get()).toString(),
project.property(property.pufferfishBranchName.get()).toString(),
dir
)
val purpur = git.clone(
"Purpur",
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
dir
)
project.properties.let {
it[property.paperRepoName.get()].toString() to it[property.paperBranchName.get()].toString()
}.also {
updatePaperCommit(it.first, it.second, pufferfish.resolve("gradle.properties").toFile(), "paperRef=")
updatePaperCommit(it.first, it.second, purpur.resolve("gradle.properties").toFile())
if (project.checkCommit(
it.first,
it.second,
property.paperCommitName.get()
)) return@also
project.createCompareComment(
it.first,
it.second,
project.property(property.paperCommitName.get()).toString()
)
updatePaperCommit(
it.first,
it.second,
project.file("gradle.properties")
)
}
val latestCommit = git("ls-remote", project.property(property.purpurRepoName.get()).toString()).readText()?.lines()
?.filterNot { "[a-z0-9]{40}\trefs/heads/${project.property(property.purpurBranchName.get())}".toRegex().matches(it) }
?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Purpur commit")
val purpurGradle = Gradle(purpur)
@@ -124,8 +211,7 @@ abstract class PurpurUpdateTask : Task() {
val paper = pufferfish.resolve(".gradle/caches/paperweight/upstreams/paper/Paper-Server")
copySource(paper)
Git(paper)("add", ".").executeOut()
Git(paper)("commit", "-m", "Vanilla Sources", "--author=Vanilla <auto@mated.null>").executeOut()
Git(paper).addCommit("Vanilla Sources", "--author=Vanilla <auto@mated.null>")
Thread.sleep(1_000)
paper.resolve(".git").toFile().copyRecursively(dotGit, overwrite = true)
@@ -161,6 +247,31 @@ abstract class PurpurUpdateTask : Task() {
project.file("gradle.properties").writeText(project.file("gradle.properties").readText().replace("purpurCommit = .*".toRegex(), "purpurCommit = $latestCommit"))
}
@TaskAction
fun update() {
if (project.checkCommit(
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
property.purpurCommitName.get()
)) return
Git.checkForGit()
project.createCompareComment(
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
project.property(property.purpurCommitName.get()).toString(),
true
)
val dir = project.layout.cache.resolve("AlwaysUpToDate/UpdatePurpur")
if (dir.exists()) dir.toFile().deleteRecursively()
dir.createDirectories()
if (project.property(property.pufferfishToggleName.get()).toString().toBoolean()) withPufferfish(dir)
else withoutPufferfish(dir)
}
private fun copySource(dir: Path) {
with(dir.resolve(".gradle/caches/paperweight/mc-dev-sources")) {
val target = dir.resolve("src/main")

View File

@@ -13,6 +13,6 @@ fun Git.clone(name: String, uri: String, branch: String, dir: Path): Path {
}
fun Git.addCommit(vararg args: String) {
this("add", ".").executeSilently(silenceErr = true)
this("commit", "-m", *args).executeSilently(silenceErr = true)
this("add", ".").executeOut()
this("commit", "-m", *args).executeOut()
}

View File

@@ -1,12 +1,21 @@
group = org.plazmamc.plazma
org.gradle.deamon = true
org.gradle.daemon = true
org.gradle.caching = true
org.gradle.parallel = true
org.gradle.vfs.watch = false
org.gradle.jvmargs = -Xmx4G -Dfile.encoding=UTF-8 -Dgraal.CompilerConfiguration=community -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true -Dgraal.SpeculativeGuardMovement=true -Dgraal.WriteableCodeCache=true
version = 1.20.4-R0.1-SNAPSHOT
mcVersion = 1.20.4
org.plazmamc.alwaysuptodate.paper.repository = https://github.com/PaperMC/Paper
org.plazmamc.alwaysuptodate.purpur.repository = https://github.com/PurpurMC/Purpur
paperCommit = f4c7d373e4a1aff23539fe099745bf29a28559b9
purpurCommit = 6b1ee98f813ee19f8046b3c528feeee61840a35b
version = 1.20.6-R0.1-SNAPSHOT
mcVersion = 1.20.6
jdkVersion = 21
paperBranch = master
purpurBranch = ver/1.20.6
pufferfishBranch = ver/1.20
usePufferfish = false
paperCommit = 0db72ac19e735d398e85b2152d5a32317bb03dc8
purpurCommit = 1ddead8ef8f0d1e2fcfb32e30c8dbe18792a53d7

View File

@@ -1,6 +1,6 @@
[versions]
shadow = "8.1.1"
paperweight = "1.5.15"
paperweight = "1.6.2"
paperclip = "3.0.3"
decompiler = "1.10.1"
remapper = "0.10.1"

View File

@@ -25,5 +25,5 @@ annotations = { group = "org.jetbrains", name = "annotations", version.ref = "an
checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" }
[bundles]
api = [ "guava", "gson", "bungeechat", "joml", "fastutil", "slf4j-api", "sentry" ]
api = [ "guava", "gson", "joml", "fastutil", "slf4j-api", "sentry" ]
annotations = [ "annotations", "checkerqual" ]

View File

@@ -5,7 +5,7 @@ mockito = "5.5.0"
jupiter = "5.10.0"
hamcrest = "2.2"
snakeyaml = "2.2"
adventure = "4.16.0"
adventure = "4.17.0-SNAPSHOT"
commons-lang2 = "2.6"
commons-lang3 = "3.12.0"
maven-provider = "3.9.6"

View File

@@ -1,4 +1,6 @@
[versions]
art = "2.0.3"
tca = "1.3.0"
upnp = "1.0"
ansi = "1.0.3"
jansi = "3.21.0"
@@ -7,15 +9,18 @@ mysql = "8.2.0"
sqlite = "3.42.0.1"
pioneer = "2.2.0"
haproxy = "4.1.97.Final"
rewriter = "0.0.1"
srgutils = "1.0.9"
velocity = "3.1.2-SNAPSHOT"
disruptor = "3.4.4"
simpleyaml = "1.8.4"
classgraph = "4.8.47"
mapping-io = "0.5.0"
configurate = "4.2.0-SNAPSHOT"
terminal-appender = "1.3.0"
[libraries]
art = { group = "net.neoforged", name = "AutoRenamingTool", version.ref = "art" }
tca = { group = "net.minecrell", name = "terminalconsoleappender", version.ref="tca" }
ansi = { group = "net.kyori", name = "ansi", version.ref = "ansi" }
upnp = { group = "dev.omega24", name = "upnp4j", version.ref = "upnp" }
mysql = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysql" }
@@ -23,6 +28,7 @@ jansi = { group = "org.jline", name = "jline-terminal-jansi", version.ref = "jan
sqlite = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite" }
pioneer = { group = "org.junit-pioneer", name = "junit-pioneer", version.ref = "pioneer" }
haproxy = { group = "io.netty", name = "netty-codec-haproxy", version.ref = "haproxy" }
srgutils = { group = "net.neoforged", name = "srgutils", version.ref = "srgutils" }
velocity = { group = "com.velocitypowered", name = "velocity-native", version.ref = "velocity" }
disruptor = { group = "com.lmax", name = "disruptor", version.ref = "disruptor" }
mappingio = { group = "net.fabricmc", name = "mapping-io", version.ref = "mapping-io" }
@@ -32,9 +38,12 @@ configurate = { group = "org.spongepowered", name = "configurate-yaml", version.
rhino-engine = { group = "org.mozilla", name = "rhino-engine", version.ref = "rhino" }
rhino-runtime = { group = "org.mozilla", name = "rhino-runtime", version.ref = "rhino" }
terminal-appender = { group = "net.minecrell", name = "terminalconsoleappender", version.ref="terminal-appender" }
rewriter = { group = "io.papermc", name = "reflection-rewriter", version.ref = "rewriter" }
rewriter-runtime = { group = "io.papermc", name = "reflection-rewriter-runtime", version.ref = "rewriter" }
rewriter-generator = { group = "io.papermc", name = "reflection-rewriter-proxy-generator", version.ref = "rewriter" }
[bundles]
runtime = [ "sqlite", "mysql", "disruptor" ]
implementation = [ "jansi", "terminal-appender", "ansi", "upnp", "haproxy", "configurate", "mappingio", "rhino-engine", "rhino-runtime" ]
implementation = [ "jansi", "tca", "ansi", "upnp", "haproxy", "configurate", "mappingio", "rhino-engine", "rhino-runtime", "srgutils", "art", "rewriter", "rewriter-runtime", "rewriter-generator" ]
test = [ "classgraph", "pioneer" ]

View File

@@ -89,7 +89,7 @@ index 190c5f0b02a3d99054704ae1afbffb3498ddffe1..042ea49ec61ee327c0f67ddcf0807740
public int size() {
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
index 17ce14f2dcbf900890efbc2351782bc6f8867068..a8d4acc1dbb3e8e5cd8d181fbd8335f84e252d0c 100644
index 049e20407..bbd0b944c 100644
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
@@ -42,6 +42,7 @@ import java.util.function.Consumer;
@@ -123,7 +123,7 @@ index ae60bd96b5284d54676d8e7e4dd5d170b526ec1e..359c4b080bd47234e569dce7055da03d
return true;
}
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
index eedbf46e04b5ae420f9bedcbc2bbb10643ba7e22..1ac70b965f5dd9441658156e19a38419cbcc47d6 100644
index 3e82ea07c..692bef556 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
@@ -47,6 +47,8 @@ import java.util.logging.Level;
@@ -144,7 +144,7 @@ index eedbf46e04b5ae420f9bedcbc2bbb10643ba7e22..1ac70b965f5dd9441658156e19a38419
}
public boolean isPluginEnabled(@NotNull String name) {
@@ -136,7 +138,7 @@ class PaperPluginInstanceManager {
@@ -133,7 +135,7 @@ class PaperPluginInstanceManager {
this.server.getLogger().log(Level.SEVERE, "Unknown error occurred while loading plugins through PluginManager.", e);
}
@@ -152,9 +152,9 @@ index eedbf46e04b5ae420f9bedcbc2bbb10643ba7e22..1ac70b965f5dd9441658156e19a38419
+ return runtimePluginEntrypointHandler.getPluginProviderStorage().getLoaded().toArray(EMPTY_JPLUGIN); // Plazma - Reduce allocations
}
// Plugins are disabled in order like this inorder to "rougly" prevent
// The behavior of this is that all errors are logged instead of being thrown
diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java
index ee0331a6bc40cdde08d926fd8eb1dc642630c2e5..bafa781ea77afa159576afca3449bacb01ab387d 100644
index ee8e9c0e3..f2598e139 100644
--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java
+++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java
@@ -1149,7 +1149,7 @@ public final class CollisionUtil {
@@ -250,7 +250,7 @@ index 06648f9751fd8a322d0809ffebf6a544596ee1a4..b0ea87e2ed8f9bf04b33c2ff8a827d4f
@Override
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
index 23916b011ed0645ab284fb080c9555921290d875..2abe6c8dcbf20bf550bb790fd4e18ccc848d1065 100644
index 4e005b7b0..059a1e49f 100644
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
@@ -409,7 +409,7 @@ public class CompoundTag implements Tag {
@@ -294,10 +294,10 @@ index ff13d67151c50ea11a45117e524c7524e2b1a202..5048ec707c147b9a5b2dd8736d518d93
@Override
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
index 24ad8d22b5180cd7d7f793e3074e438f9192448f..c902b478d331a1cad9ac66a6eeb66c19fbcd8789 100644
index 154bffd34..83c36d452 100644
--- a/src/main/java/net/minecraft/nbt/ListTag.java
+++ b/src/main/java/net/minecraft/nbt/ListTag.java
@@ -279,7 +279,7 @@ public class ListTag extends CollectionTag<Tag> {
@@ -258,7 +258,7 @@ public class ListTag extends CollectionTag<Tag> {
}
}
@@ -306,7 +306,7 @@ index 24ad8d22b5180cd7d7f793e3074e438f9192448f..c902b478d331a1cad9ac66a6eeb66c19
}
public long[] getLongArray(int index) {
@@ -291,7 +291,7 @@ public class ListTag extends CollectionTag<Tag> {
@@ -269,7 +269,7 @@ public class ListTag extends CollectionTag<Tag> {
}
}
@@ -329,10 +329,10 @@ index 2e5c34ebb94a1536cf09d71bdf052a49ecb9159d..144d3bbe80fc0f459a06017a19929e3e
@Override
diff --git a/src/main/java/net/minecraft/nbt/NbtIo.java b/src/main/java/net/minecraft/nbt/NbtIo.java
index c2044d2e8ce2d4747aa73ba90e5b975b1b7d2c19..b4e043379ece86ce39eacd4c1eb9114a2b6727ca 100644
index 9f659af04..d2969c1ce 100644
--- a/src/main/java/net/minecraft/nbt/NbtIo.java
+++ b/src/main/java/net/minecraft/nbt/NbtIo.java
@@ -249,7 +249,7 @@ public class NbtIo {
@@ -277,7 +277,7 @@ public class NbtIo {
@Nullable
public static CompoundTag read(Path path) throws IOException {
@@ -357,23 +357,23 @@ index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..70d776d5cfdb0612f65d92333d6f872a
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 9e31954212b1d6162dca2fbc91d373e908560335..5e7b4363e6f83d4145954a96d6b6b610d392c7d1 100644
index 9f274048b..ba54c16f1 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -322,7 +322,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -316,7 +316,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
public void setListener(PacketListener packetListener) {
- Validate.notNull(packetListener, "packetListener", new Object[0]);
+ Validate.notNull(packetListener, "packetListener"/*, new Object[0]*/); // Plazma - Reduce allocations
PacketFlow enumprotocoldirection = packetListener.flow();
private void validateListener(ProtocolInfo<?> state, PacketListener listener) {
- Validate.notNull(listener, "packetListener", new Object[0]);
+ Validate.notNull(listener, "packetListener"/*, new Object[0]*/); // Plazma - Reduce allocations
PacketFlow enumprotocoldirection = listener.flow();
String s;
if (enumprotocoldirection != this.receiving) {
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
index d3a80d0a23be762c05931ae8001d98e43cab2b4a..a94feef330b1836a2fc009405c52945551b7590a 100644
index 6dcade427..4a0b4b0fa 100644
--- a/src/main/java/net/minecraft/network/chat/Component.java
+++ b/src/main/java/net/minecraft/network/chat/Component.java
@@ -191,7 +191,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
@@ -189,7 +189,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
}
static MutableComponent translatable(String key) {
@@ -382,7 +382,7 @@ index d3a80d0a23be762c05931ae8001d98e43cab2b4a..a94feef330b1836a2fc009405c529455
}
static MutableComponent translatable(String key, Object... args) {
@@ -211,7 +211,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
@@ -209,7 +209,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
}
static MutableComponent translatableWithFallback(String key, @Nullable String fallback) {
@@ -392,7 +392,7 @@ index d3a80d0a23be762c05931ae8001d98e43cab2b4a..a94feef330b1836a2fc009405c529455
static MutableComponent translatableWithFallback(String key, @Nullable String fallback, Object... args) {
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..c922919e15a4157b7a46728caa4a7df0b5fcce1f 100644
index 4aa6232bf..84e8a29f0 100644
--- a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
+++ b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
@@ -29,7 +29,7 @@ import net.minecraft.util.ExtraCodecs;
@@ -401,7 +401,7 @@ index 18e53db59082bae94922edc4baa812aa6f089576..c922919e15a4157b7a46728caa4a7df0
public class TranslatableContents implements ComponentContents {
- public static final Object[] NO_ARGS = new Object[0];
+ // public static final Object[] NO_ARGS = new Object[0]; // Plazma - Reduce 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(
@@ -69,7 +69,7 @@ public class TranslatableContents implements ComponentContents {
@@ -409,15 +409,15 @@ index 18e53db59082bae94922edc4baa812aa6f089576..c922919e15a4157b7a46728caa4a7df0
private static Object[] adjustArgs(Optional<List<Object>> args) {
- return args.<Object[]>map(list -> list.isEmpty() ? NO_ARGS : list.toArray()).orElse(NO_ARGS);
+ return args.<Object[]>map(list -> list.isEmpty() ? org.plazmamc.plazma.constants.Empty.OBJECT : list.toArray()).orElse(org.plazmamc.plazma.constants.Empty.OBJECT);
+ return args.<Object[]>map(list -> list.isEmpty() ? org.plazmamc.plazma.constants.Empty.OBJECT : list.toArray()).orElse(org.plazmamc.plazma.constants.Empty.OBJECT); // Plazma - Reduce allocations
}
private static TranslatableContents create(String key, Optional<String> fallback, Optional<List<Object>> args) {
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
index ccdc2345465313991f065e1176b58fb7d5e8722f..bb50e69a4d84e4753db77be071cc6fc73b08a981 100644
index 1a37654af..0e61f8cb3 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
@@ -63,7 +63,7 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
@@ -66,7 +66,7 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<BlockState> blockChanges) {
this.sectionPos = sectionPos;
this.positions = blockChanges.keySet().toShortArray();
@@ -427,10 +427,10 @@ index ccdc2345465313991f065e1176b58fb7d5e8722f..bb50e69a4d84e4753db77be071cc6fc7
// Paper end - Multi Block Change API
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ac12ccf60b45b150982e79f32d3cdd21c4017cc8..1032916def98f0607fabb1bbb550ba2ff70b3019 100644
index e121cc57e..7b27af22a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1499,13 +1499,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1541,13 +1541,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
private Optional<ServerStatus.Favicon> loadStatusIcon() {
@@ -449,7 +449,7 @@ index ac12ccf60b45b150982e79f32d3cdd21c4017cc8..1032916def98f0607fabb1bbb550ba2f
return optional.flatMap((path) -> {
try {
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
index ba8a8575af92541cef2e116743d51cd68d1e794a..140079be22acbb898720c538c4ffb06194da0860 100644
index ef520d1dd..b3b0c18b4 100644
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
@@ -130,7 +130,7 @@ public class PlayerAdvancements {
@@ -494,10 +494,10 @@ index bae0d208b31aa0a6977c30f2f8484ab3c316bc71..981c3023044f3cc6dc22ada20cd4bedc
}
);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index bb412ca874b85d777c0e3565fcefcee15b23182b..9116b3d298a9bb6e550d299f76ff1243da824cbe 100644
index 4e6fccec4..618dc900d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -109,6 +109,7 @@ import org.bukkit.craftbukkit.generator.CustomChunkGenerator;
@@ -112,6 +112,7 @@ import org.bukkit.craftbukkit.generator.CustomChunkGenerator;
public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
@@ -505,7 +505,7 @@ index bb412ca874b85d777c0e3565fcefcee15b23182b..9116b3d298a9bb6e550d299f76ff1243
private static final byte CHUNK_TYPE_REPLACEABLE = -1;
private static final byte CHUNK_TYPE_UNKNOWN = 0;
private static final byte CHUNK_TYPE_FULL = 1;
@@ -1347,7 +1348,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1361,7 +1362,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// stuff could have been removed, so we need to check the trackedPlayers set
// for players that were removed
@@ -515,10 +515,10 @@ index bb412ca874b85d777c0e3565fcefcee15b23182b..9116b3d298a9bb6e550d299f76ff1243
this.updatePlayer(conn.getPlayer());
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 00ac2902be93327c7dd1bf78ee5922d7954f1b26..2ac8c77684c2e4cfc30bc0d39bcaf853dcd3bfb9 100644
index f72af2feb..0aaa0e63f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1449,7 +1449,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1439,7 +1439,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public static List<Entity> getCurrentlyTickingEntities() {
Entity ticking = currentlyTickingEntity.get();
@@ -528,21 +528,25 @@ index 00ac2902be93327c7dd1bf78ee5922d7954f1b26..2ac8c77684c2e4cfc30bc0d39bcaf853
return ret;
}
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 8b62f992ec61d0a66a3856b4928ee2d705548291..c0729d3a38e0b9924711c0ca96afd138fa69fa3b 100644
index 3b4fadb37..f276fe09f 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -138,8 +138,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -165,12 +165,12 @@ 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
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet"/*, new Object[0]*/); // Plazma - Reduce allocations
+ 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 // Plazma - Reduce allocations
// Paper start - Validate usernames
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
&& io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation
&& !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) {
- Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username", new Object[0]);
+ Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username"/*, new Object[0]*/); // Plazma - Reduce allocations
}
// Paper end - Validate usernames
this.requestedUsername = packet.name();
GameProfile gameprofile = this.server.getSingleplayerProfile();
@@ -223,7 +223,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -268,7 +268,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleKey(ServerboundKeyPacket packet) {
@@ -551,20 +555,20 @@ index 8b62f992ec61d0a66a3856b4928ee2d705548291..c0729d3a38e0b9924711c0ca96afd138
final String s;
@@ -403,7 +403,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -448,7 +448,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"/*, new Object[0]*/); // Plazma - Reduce 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 ac1e0c66f167218306504db6037cc1d6509072a0..60aa2984e490374ab2659f9d0a4821f1ea17c700 100644
index b863f6fe6..068c7619b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -133,6 +133,7 @@ public abstract class PlayerList {
@@ -135,6 +135,7 @@ public abstract class PlayerList {
private static final Logger LOGGER = LogUtils.getLogger();
private static final int SEND_PLAYER_INFO_INTERVAL = 600;
private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
@@ -572,7 +576,7 @@ index ac1e0c66f167218306504db6037cc1d6509072a0..60aa2984e490374ab2659f9d0a4821f1
private final MinecraftServer server;
public final List<ServerPlayer> players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety
private final Map<UUID, ServerPlayer> playersByUUID = Maps.newHashMap();
@@ -816,7 +817,7 @@ public abstract class PlayerList {
@@ -815,7 +816,7 @@ public abstract class PlayerList {
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason) {
// Paper start - Expand PlayerRespawnEvent
@@ -582,7 +586,7 @@ index ac1e0c66f167218306504db6037cc1d6509072a0..60aa2984e490374ab2659f9d0a4821f1
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason, org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag...respawnFlags) {
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index 7e133752ccb1ea7c0b4fa781feb1a88e2cfdcf6d..1289e8e9c54a584f5037ea8e852df37376af093d 100644
index c038da20b..b6cab933d 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -76,7 +76,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
@@ -628,222 +632,19 @@ index 01f5b946fabbe34f31110e75973dab9f39897346..2564c21900df7ca3c58872741ec8f68b
}
@Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index 997ab942be9f742804041b07d607e7dd6473ba96..14a61e58987464d7865caf98e6232fb1334c6d88 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -251,7 +251,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.goalSelector.addGoal(8, new Bee.BeeWanderGoal());
this.goalSelector.addGoal(9, new FloatGoal(this));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
- this.targetSelector.addGoal(1, (new Bee.BeeHurtByOtherGoal(this)).setAlertOthers(new Class[0]));
+ this.targetSelector.addGoal(1, (new Bee.BeeHurtByOtherGoal(this)).setAlertOthers(/*new Class[0]*/)); // Plazma - Reduce allocations
this.targetSelector.addGoal(2, new Bee.BeeBecomeAngryTargetGoal(this));
this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true));
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
index 442eb602f5c82550a87e218e2013171b718abd62..b68f7d1fba18cf08a1844a179f07cb6d873c236b 100644
--- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
+++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
@@ -122,7 +122,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
this.targetSelector.addGoal(1, new DefendVillageTargetGoal(this));
- this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0]));
+ this.targetSelector.addGoal(2, new HurtByTargetGoal(this/*, new Class[0]*/)); // Plazma - Reduce allocations
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Mob.class, 5, false, false, (entityliving) -> {
return entityliving instanceof Enemy && !(entityliving instanceof Creeper);
diff --git a/src/main/java/net/minecraft/world/entity/animal/Panda.java b/src/main/java/net/minecraft/world/entity/animal/Panda.java
index adfa18c941b5070692ed855d1d609993ca49a01d..b44e752b4fa18d25ca7ac989b1eaacc138512848 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Panda.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java
@@ -340,7 +340,7 @@ public class Panda extends Animal {
this.goalSelector.addGoal(13, new FollowParentGoal(this, 1.25D));
this.goalSelector.addGoal(14, new WaterAvoidingRandomStrollGoal(this, 1.0D));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
- this.targetSelector.addGoal(1, (new Panda.PandaHurtByTargetGoal(this, new Class[0])).setAlertOthers(new Class[0]));
+ this.targetSelector.addGoal(1, (new Panda.PandaHurtByTargetGoal(this/*, new Class[0]*/)).setAlertOthers(/*new Class[0]*/)); // Plazma - Reduce allocations
}
public static AttributeSupplier.Builder createAttributes() {
diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
index eae2488f2a46e543b496b7a2919aabbb55dcb825..3383d61551f28b44943c0e935aedfa3cc9ac7e93 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
@@ -461,7 +461,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
if (variant == Rabbit.Variant.EVIL) {
this.getAttribute(Attributes.ARMOR).setBaseValue(8.0D);
this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.4D, true));
- this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers());
+ this.targetSelector.addGoal(1, (new HurtByTargetGoal(this/*,new Class[0]*/)).setAlertOthers()); // Plazma - Reduce allocations
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Wolf.class, true));
if (!this.hasCustomName()) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
index a90055fe8819a32180754b6060a0f88e81d1a3b6..68825a2ad5a6ea1b0784a935206bd150d29e25f9 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -241,7 +241,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
this.targetSelector.addGoal(1, new OwnerHurtByTargetGoal(this));
this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this));
- this.targetSelector.addGoal(3, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers());
+ this.targetSelector.addGoal(3, (new HurtByTargetGoal(this/*, new Class[0]*/)).setAlertOthers()); // Plazma - Reduce allocations
this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
// this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, Wolf.PREY_SELECTOR)); // Purpur - moved to updatePathfinders()
this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR));
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
index c783ce59ea766e6c46a3313628b961f27e01ee8b..518660609566ffe943103b305472590ee9f0a257 100644
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
@@ -84,7 +84,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
private static final EntityDataAccessor<Boolean> DATA_DANCING = SynchedEntityData.defineId(Allay.class, EntityDataSerializers.BOOLEAN);
private static final EntityDataAccessor<Boolean> DATA_CAN_DUPLICATE = SynchedEntityData.defineId(Allay.class, EntityDataSerializers.BOOLEAN);
protected static final ImmutableList<SensorType<? extends Sensor<? super Allay>>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_PLAYERS, SensorType.HURT_BY, SensorType.NEAREST_ITEMS);
- protected static final ImmutableList<MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.PATH, MemoryModuleType.LOOK_TARGET, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.HURT_BY, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.LIKED_PLAYER, MemoryModuleType.LIKED_NOTEBLOCK_POSITION, MemoryModuleType.LIKED_NOTEBLOCK_COOLDOWN_TICKS, MemoryModuleType.ITEM_PICKUP_COOLDOWN_TICKS, MemoryModuleType.IS_PANICKING, new MemoryModuleType[0]);
+ protected static final ImmutableList<MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.PATH, MemoryModuleType.LOOK_TARGET, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.HURT_BY, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.LIKED_PLAYER, MemoryModuleType.LIKED_NOTEBLOCK_POSITION, MemoryModuleType.LIKED_NOTEBLOCK_COOLDOWN_TICKS, MemoryModuleType.ITEM_PICKUP_COOLDOWN_TICKS, MemoryModuleType.IS_PANICKING/*, new MemoryModuleType[0]*/); // Plazma - Reduce allocations
public static final ImmutableList<Float> THROW_SOUND_PITCHES = ImmutableList.of(0.5625F, 0.625F, 0.75F, 0.9375F, 1.0F, 1.0F, 1.125F, 1.25F, 1.5F, 1.875F, 2.0F, 2.25F, new Float[]{2.5F, 3.0F, 3.75F, 4.0F});
private final DynamicGameEventListener<VibrationSystem.Listener> dynamicVibrationListener;
private VibrationSystem.Data vibrationData;
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
index 1d896c6c49705acd87416dc11a1d8ce205f7844e..6d5c60cf9851fc358f29d25bf5d0de98ff7aeb40 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -255,7 +255,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
- this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0]));
+ this.targetSelector.addGoal(1, new HurtByTargetGoal(this/*, new Class[0]*/)); // Plazma - Reduce allocations
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 0, false, false, WitherBoss.LIVING_ENTITY_SELECTOR));
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
index a00646bc8a9caefe56e48b7682e8fb0c464b81fa..a2b5d2f1be493148a0ed102f10fd8b762b8d3981 100644
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -79,7 +79,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(6, new RandomLookAroundGoal(this));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
- this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0]));
+ this.targetSelector.addGoal(1, new HurtByTargetGoal(this/*, new Class[0]*/)); // Plazma - Reduce allocations
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR));
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
index 54315fb84e3289f0ad8305c2c2cec980a5b2c627..5adcb3cb643025de833935ad0b962cf557d354aa 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
@@ -154,7 +154,7 @@ public class Creeper extends Monster implements PowerableMob {
this.goalSelector.addGoal(6, new RandomLookAroundGoal(this));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, true));
- this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0]));
+ this.targetSelector.addGoal(2, new HurtByTargetGoal(this/*, new Class[0]*/)); // Plazma - Reduce allocations
}
public static AttributeSupplier.Builder createAttributes() {
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 13bc6389652f8868d7539676ee6d85f37ba78f67..6e4dca9074132fc0fb8c90878bf5028729b72367 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -138,7 +138,7 @@ public class EnderMan extends Monster implements NeutralMob {
this.goalSelector.addGoal(11, new EnderMan.EndermanTakeBlockGoal(this));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
this.targetSelector.addGoal(1, new EnderMan.EndermanLookForPlayerGoal(this, this::isAngryAt));
- this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0]));
+ this.targetSelector.addGoal(2, new HurtByTargetGoal(this/*, new Class[0]*/)); // Plazma - Reduce allocations
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Endermite.class, 10, true, false, (entityliving) -> entityliving.level().purpurConfig.endermanAggroEndermites && entityliving instanceof Endermite endermite && (!entityliving.level().purpurConfig.endermanAggroEndermitesOnlyIfPlayerSpawned || endermite.isPlayerSpawned()))); // Purpur
this.targetSelector.addGoal(4, new ResetUniversalAngerTargetGoal<>(this, false));
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
index 931412a5ab315d4080a9f5209d3e85d78642f4c2..0678c916eb6c7fe4a96d6716980892f80e77b3d8 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
@@ -90,7 +90,7 @@ public class Silverfish extends Monster {
this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0D, false));
this.goalSelector.addGoal(5, new Silverfish.SilverfishMergeWithStoneGoal(this));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
- this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers());
+ this.targetSelector.addGoal(1, (new HurtByTargetGoal(this/*,new Class[0]*/)).setAlertOthers()); // Plazma - Reduce allocations
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
index b44ffeb4cc0ef63fdd25683f60c5a20fcdeb9135..284aa2340079a4bdf9f1916b28596ea4a06a53ba 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
@@ -95,7 +95,7 @@ public class Spider extends Monster {
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(6, new RandomLookAroundGoal(this));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
- this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0]));
+ this.targetSelector.addGoal(1, new HurtByTargetGoal(this/*, new Class[0]*/)); // Plazma - Reduce allocations
this.targetSelector.addGoal(2, new Spider.SpiderTargetGoal<>(this, Player.class));
this.targetSelector.addGoal(3, new Spider.SpiderTargetGoal<>(this, IronGolem.class));
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index c531d830f4d6b2d2213e160d7e1a5b50b80dbea5..18f33b417573417d5e3eb06768d9b59362c2dcf1 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -166,7 +166,7 @@ public class Zombie extends Monster {
this.goalSelector.addGoal(2, new ZombieAttackGoal(this, 1.0D, false));
this.goalSelector.addGoal(6, new MoveThroughVillageGoal(this, 1.0D, true, 4, this::canBreakDoors));
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D));
- this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers(ZombifiedPiglin.class));
+ this.targetSelector.addGoal(1, (new HurtByTargetGoal(this/*, new Class[0]*/)).setAlertOthers(ZombifiedPiglin.class)); // Plazma - Reduce allocations
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
// Purpur start
if ( this.level().spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false) { // Spigot
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
index feba8a264bae656244f60296d0511a8046297f73..37dbf8ab18710fdd889073468c52cc0c6fc3ced2 100644
--- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
@@ -120,7 +120,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
protected void addBehaviourGoals() {
this.goalSelector.addGoal(2, new ZombieAttackGoal(this, 1.0D, false));
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D));
- this.targetSelector.addGoal(1, pathfinderGoalHurtByTarget = (new HurtByTargetGoal(this, new Class[0])).setAlertOthers()); // Paper - fix PigZombieAngerEvent cancellation
+ this.targetSelector.addGoal(1, pathfinderGoalHurtByTarget = (new HurtByTargetGoal(this/*, new Class[0]*/)).setAlertOthers()); // Paper - fix PigZombieAngerEvent cancellation // Plazma - Reduce allocations
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true));
}
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 a097cfc528f709c80575f35483b6878314ea2717..61840d78c4e99e706de56613d13d5741576ad660 100644
--- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
@@ -27,6 +27,7 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
final ItemStack result;
final NonNullList<Ingredient> ingredients;
private final boolean isBukkit; // Pufferfish
+ private static final Ingredient[] EMPTY_INGREDIENT = new Ingredient[0]; // Plazma - Reduce allocations
// Pufferfish start
public ShapelessRecipe(String group, CraftingBookCategory category, ItemStack result, NonNullList<Ingredient> ingredients) {
@@ -84,7 +85,7 @@ public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBoo
public boolean matches(CraftingContainer inventory, Level world) {
// Pufferfish start
if (!this.isBukkit) {
- java.util.List<Ingredient> ingredients = com.google.common.collect.Lists.newArrayList(this.ingredients.toArray(new Ingredient[0]));
+ java.util.List<Ingredient> ingredients = com.google.common.collect.Lists.newArrayList(this.ingredients.toArray(EMPTY_INGREDIENT)); // Plazma - Reduce allocations
inventory: for (int index = 0; index < inventory.getContainerSize(); index++) {
ItemStack itemStack = inventory.getItem(index);
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 47b7baa41f341087bcd5dfec1d2a13b96f8357ca..72e410ad6bed528b7a1febd30079ab39e10fd5ed 100644
index f34159f8d..4088ec804 100644
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
@@ -62,6 +62,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
avoxelshape[8] = avoxelshape[7];
});
@@ -57,6 +57,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
public static final Object2FloatMap<ItemLike> COMPOSTABLES = new Object2FloatOpenHashMap();
private static final int AABB_SIDE_THICKNESS = 2;
private static final VoxelShape OUTER_SHAPE = Shapes.block();
+ private static final int[] ZERO_INT = new int[]{0}; // Plazma - Reduce allocations // Plazma - Reduce allocations
@Override
public MapCodec<ComposterBlock> codec() {
@@ -450,7 +451,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
private static final VoxelShape[] SHAPES = (VoxelShape[]) Util.make(new VoxelShape[9], (avoxelshape) -> {
for (int i = 0; i < 8; ++i) {
avoxelshape[i] = Shapes.join(ComposterBlock.OUTER_SHAPE, Block.box(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), BooleanOp.ONLY_FIRST);
@@ -458,7 +459,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
@@ -852,7 +653,7 @@ index 47b7baa41f341087bcd5dfec1d2a13b96f8357ca..72e410ad6bed528b7a1febd30079ab39
}
@Override
@@ -499,7 +500,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@@ -507,7 +508,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
@@ -861,7 +662,7 @@ index 47b7baa41f341087bcd5dfec1d2a13b96f8357ca..72e410ad6bed528b7a1febd30079ab39
}
@Override
@@ -541,7 +542,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@@ -549,7 +550,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
@@ -870,33 +671,20 @@ index 47b7baa41f341087bcd5dfec1d2a13b96f8357ca..72e410ad6bed528b7a1febd30079ab39
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java
index a907b79fd8291a0e92db138f37239d17424188a1..a402db6baa4b24b4c6750b01b8b2f56e213ecf78 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java
@@ -148,7 +148,7 @@ public class ChunkStatus {
}, (chunkstatus, worldserver, structuretemplatemanager, lightenginethreaded, function, ichunkaccess) -> {
return (CompletableFuture) function.apply(ichunkaccess);
});
- private static final List<ChunkStatus> STATUS_BY_RANGE = ImmutableList.of(ChunkStatus.FULL, ChunkStatus.INITIALIZE_LIGHT, ChunkStatus.CARVERS, ChunkStatus.BIOMES, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, new ChunkStatus[0]);
+ private static final List<ChunkStatus> STATUS_BY_RANGE = ImmutableList.of(ChunkStatus.FULL, ChunkStatus.INITIALIZE_LIGHT, ChunkStatus.CARVERS, ChunkStatus.BIOMES, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS/*, new ChunkStatus[0]*/); // Plazma - Reduce allocations
private static final IntList RANGE_BY_STATUS = (IntList) Util.make(new IntArrayList(ChunkStatus.getStatusList().size()), (intarraylist) -> {
int i = 0;
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
index 6cf83502a954cce9c562ec036bfeddb477d38b73..d28bffce82d0b40c31f240c016621ac06bbad178 100644
index 1362a4794..2490b63cb 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -444,7 +444,7 @@ public class RegionFile implements AutoCloseable {
@@ -445,7 +445,7 @@ public class RegionFile implements AutoCloseable {
this.path = path;
initOversizedState(); // Paper
this.usedSectors = new RegionBitmap();
this.version = outputChunkStreamVersion;
this.version = compressionFormat;
- if (!Files.isDirectory(directory, new LinkOption[0])) {
+ if (!Files.isDirectory(directory/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
throw new IllegalArgumentException("Expected directory, got " + directory.toAbsolutePath());
throw new IllegalArgumentException("Expected directory, got " + String.valueOf(directory.toAbsolutePath()));
} else {
this.externalFileDir = directory;
@@ -700,7 +700,7 @@ public class RegionFile implements AutoCloseable {
@@ -717,7 +717,7 @@ public class RegionFile implements AutoCloseable {
private DataInputStream createExternalChunkInputStream(ChunkPos pos, byte flags) throws IOException {
Path path = this.getExternalChunkPath(pos);
@@ -905,7 +693,7 @@ index 6cf83502a954cce9c562ec036bfeddb477d38b73..d28bffce82d0b40c31f240c016621ac0
RegionFile.LOGGER.error("External chunk path {} is not file", path);
return null;
} else {
@@ -752,7 +752,7 @@ public class RegionFile implements AutoCloseable {
@@ -769,7 +769,7 @@ public class RegionFile implements AutoCloseable {
return false;
}
@@ -915,7 +703,7 @@ index 6cf83502a954cce9c562ec036bfeddb477d38b73..d28bffce82d0b40c31f240c016621ac0
}
} else {
diff --git a/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java b/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
index bf74c054e800104cd47208a29594d3c1340fd668..0320662df9bb039094ecd2bccc94dd59bcdd9d1d 100644
index b8e333e79..b6012d360 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
@@ -89,7 +89,7 @@ public class DebugLevelSource extends ChunkGenerator {

View File

@@ -1,527 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kevin Raneri <kevin.raneri@gmail.com>
Date: Tue, 9 Nov 2021 14:01:56 -0500
Subject: [PATCH] Pufferfish API Changes
Pufferfish
Copyright (C) 2024 Pufferfish Studios LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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/build.gradle.kts b/build.gradle.kts
index 04853c43b99951bf0d4c96ef73724625bdaf018f..9164120d299d062c62529a7ef74eac0ded367993 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -51,6 +51,7 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
api("org.slf4j:slf4j-api:$slf4jVersion")
+ api("io.sentry:sentry:5.4.0") // Pufferfish
implementation("org.ow2.asm:asm:9.7")
implementation("org.ow2.asm:asm-commons:9.7")
@@ -109,6 +110,13 @@ val generateApiVersioningFile by tasks.registering {
}
}
+// Pufferfish Start
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
+}
+// Pufferfish End
+
tasks.jar {
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
into("META-INF/maven/${project.group}/${project.name}")
diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
new file mode 100644
index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8eb08fb68a
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
@@ -0,0 +1,161 @@
+package gg.pufferfish.pufferfish.sentry;
+
+import com.google.gson.Gson;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.Map;
+import java.util.TreeMap;
+import org.apache.logging.log4j.ThreadContext;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Event;
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.RegisteredListener;
+import org.jetbrains.annotations.Nullable;
+
+public class SentryContext {
+
+ private static final Gson GSON = new Gson();
+
+ public static void setPluginContext(@Nullable Plugin plugin) {
+ if (plugin != null) {
+ ThreadContext.put("pufferfishsentry_pluginname", plugin.getName());
+ ThreadContext.put("pufferfishsentry_pluginversion", plugin.getDescription().getVersion());
+ }
+ }
+
+ public static void removePluginContext() {
+ ThreadContext.remove("pufferfishsentry_pluginname");
+ ThreadContext.remove("pufferfishsentry_pluginversion");
+ }
+
+ public static void setSenderContext(@Nullable CommandSender sender) {
+ if (sender != null) {
+ ThreadContext.put("pufferfishsentry_playername", sender.getName());
+ if (sender instanceof Player player) {
+ ThreadContext.put("pufferfishsentry_playerid", player.getUniqueId().toString());
+ }
+ }
+ }
+
+ public static void removeSenderContext() {
+ ThreadContext.remove("pufferfishsentry_playername");
+ ThreadContext.remove("pufferfishsentry_playerid");
+ }
+
+ public static void setEventContext(Event event, RegisteredListener registration) {
+ setPluginContext(registration.getPlugin());
+
+ try {
+ // Find the player that was involved with this event
+ Player player = null;
+ if (event instanceof PlayerEvent) {
+ player = ((PlayerEvent) event).getPlayer();
+ } else {
+ Class<? extends Event> eventClass = event.getClass();
+
+ Field playerField = null;
+
+ for (Field field : eventClass.getDeclaredFields()) {
+ if (field.getType().equals(Player.class)) {
+ playerField = field;
+ break;
+ }
+ }
+
+ if (playerField != null) {
+ playerField.setAccessible(true);
+ player = (Player) playerField.get(event);
+ }
+ }
+
+ if (player != null) {
+ setSenderContext(player);
+ }
+ } catch (Exception e) {} // We can't really safely log exceptions.
+
+ ThreadContext.put("pufferfishsentry_eventdata", GSON.toJson(serializeFields(event)));
+ }
+
+ public static void removeEventContext() {
+ removePluginContext();
+ removeSenderContext();
+ ThreadContext.remove("pufferfishsentry_eventdata");
+ }
+
+ private static Map<String, String> serializeFields(Object object) {
+ Map<String, String> fields = new TreeMap<>();
+ fields.put("_class", object.getClass().getName());
+ for (Field declaredField : object.getClass().getDeclaredFields()) {
+ try {
+ if (Modifier.isStatic(declaredField.getModifiers())) {
+ continue;
+ }
+
+ String fieldName = declaredField.getName();
+ if (fieldName.equals("handlers")) {
+ continue;
+ }
+ declaredField.setAccessible(true);
+ Object value = declaredField.get(object);
+ if (value != null) {
+ fields.put(fieldName, value.toString());
+ } else {
+ fields.put(fieldName, "<null>");
+ }
+ } catch (Exception e) {} // We can't really safely log exceptions.
+ }
+ return fields;
+ }
+
+ public static class State {
+
+ private Plugin plugin;
+ private Command command;
+ private String commandLine;
+ private Event event;
+ private RegisteredListener registeredListener;
+
+ public Plugin getPlugin() {
+ return plugin;
+ }
+
+ public void setPlugin(Plugin plugin) {
+ this.plugin = plugin;
+ }
+
+ public Command getCommand() {
+ return command;
+ }
+
+ public void setCommand(Command command) {
+ this.command = command;
+ }
+
+ public String getCommandLine() {
+ return commandLine;
+ }
+
+ public void setCommandLine(String commandLine) {
+ this.commandLine = commandLine;
+ }
+
+ public Event getEvent() {
+ return event;
+ }
+
+ public void setEvent(Event event) {
+ this.event = event;
+ }
+
+ public RegisteredListener getRegisteredListener() {
+ return registeredListener;
+ }
+
+ public void setRegisteredListener(RegisteredListener registeredListener) {
+ this.registeredListener = registeredListener;
+ }
+ }
+}
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
new file mode 100644
index 0000000000000000000000000000000000000000..ab5fea0b03224bf249352ce340e94704ff713345
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
@@ -0,0 +1,40 @@
+package gg.pufferfish.pufferfish.simd;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import jdk.incubator.vector.FloatVector;
+import jdk.incubator.vector.IntVector;
+import jdk.incubator.vector.VectorSpecies;
+
+/**
+ * Basically, java is annoying and we have to push this out to its own class.
+ */
+@Deprecated
+public class SIMDChecker {
+
+ @Deprecated
+ public static boolean canEnable(Logger logger) {
+ try {
+ if (SIMDDetection.getJavaVersion() != 17 && SIMDDetection.getJavaVersion() != 18 && SIMDDetection.getJavaVersion() != 19) {
+ return false;
+ } else {
+ SIMDDetection.testRun = true;
+
+ VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
+ VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
+
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + ISPEC.vectorBitSize() + " bits (int)");
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
+
+ if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
+ logger.log(Level.WARNING, "SIMD is not properly supported on this system!");
+ return false;
+ }
+
+ return true;
+ }
+ } catch (NoClassDefFoundError | Exception ignored) {} // Basically, we don't do anything. This lets us detect if it's not functional and disable it.
+ return false;
+ }
+
+}
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
new file mode 100644
index 0000000000000000000000000000000000000000..a84889d3e9cfc4d7ab5f867820a6484c6070711b
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
@@ -0,0 +1,35 @@
+package gg.pufferfish.pufferfish.simd;
+
+import java.util.logging.Logger;
+
+@Deprecated
+public class SIMDDetection {
+
+ public static boolean isEnabled = false;
+ public static boolean versionLimited = false;
+ public static boolean testRun = false;
+
+ @Deprecated
+ public static boolean canEnable(Logger logger) {
+ try {
+ return SIMDChecker.canEnable(logger);
+ } catch (NoClassDefFoundError | Exception ignored) {
+ return false;
+ }
+ }
+
+ @Deprecated
+ public static int getJavaVersion() {
+ // https://stackoverflow.com/a/2591122
+ String version = System.getProperty("java.version");
+ if(version.startsWith("1.")) {
+ version = version.substring(2, 3);
+ } else {
+ int dot = version.indexOf(".");
+ if(dot != -1) { version = version.substring(0, dot); }
+ }
+ version = version.split("-")[0]; // Azul is stupid
+ return Integer.parseInt(version);
+ }
+
+}
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
new file mode 100644
index 0000000000000000000000000000000000000000..ae2464920c9412ac90b819a540ee58be0741465f
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
@@ -0,0 +1,83 @@
+package gg.pufferfish.pufferfish.simd;
+
+import java.awt.Color;
+import jdk.incubator.vector.FloatVector;
+import jdk.incubator.vector.IntVector;
+import jdk.incubator.vector.VectorMask;
+import jdk.incubator.vector.VectorSpecies;
+import org.bukkit.map.MapPalette;
+
+@Deprecated
+public class VectorMapPalette {
+
+ private static final VectorSpecies<Integer> I_SPEC = IntVector.SPECIES_PREFERRED;
+ private static final VectorSpecies<Float> F_SPEC = FloatVector.SPECIES_PREFERRED;
+
+ @Deprecated
+ public static void matchColorVectorized(int[] in, byte[] out) {
+ int speciesLength = I_SPEC.length();
+ int i;
+ for (i = 0; i < in.length - speciesLength; i += speciesLength) {
+ float[] redsArr = new float[speciesLength];
+ float[] bluesArr = new float[speciesLength];
+ float[] greensArr = new float[speciesLength];
+ int[] alphasArr = new int[speciesLength];
+
+ for (int j = 0; j < speciesLength; j++) {
+ alphasArr[j] = (in[i + j] >> 24) & 0xFF;
+ redsArr[j] = (in[i + j] >> 16) & 0xFF;
+ greensArr[j] = (in[i + j] >> 8) & 0xFF;
+ bluesArr[j] = (in[i + j] >> 0) & 0xFF;
+ }
+
+ IntVector alphas = IntVector.fromArray(I_SPEC, alphasArr, 0);
+ FloatVector reds = FloatVector.fromArray(F_SPEC, redsArr, 0);
+ FloatVector greens = FloatVector.fromArray(F_SPEC, greensArr, 0);
+ FloatVector blues = FloatVector.fromArray(F_SPEC, bluesArr, 0);
+ IntVector resultIndex = IntVector.zero(I_SPEC);
+ VectorMask<Integer> modificationMask = VectorMask.fromLong(I_SPEC, 0xffffffff);
+
+ modificationMask = modificationMask.and(alphas.lt(128).not());
+ FloatVector bestDistances = FloatVector.broadcast(F_SPEC, Float.MAX_VALUE);
+
+ for (int c = 4; c < MapPalette.colors.length; c++) {
+ // We're using 32-bit floats here because it's 2x faster and nobody will know the difference.
+ // For correctness, the original algorithm uses 64-bit floats instead. Completely unnecessary.
+ FloatVector compReds = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getRed());
+ FloatVector compGreens = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getGreen());
+ FloatVector compBlues = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getBlue());
+
+ FloatVector rMean = reds.add(compReds).div(2.0f);
+ FloatVector rDiff = reds.sub(compReds);
+ FloatVector gDiff = greens.sub(compGreens);
+ FloatVector bDiff = blues.sub(compBlues);
+
+ FloatVector weightR = rMean.div(256.0f).add(2);
+ FloatVector weightG = FloatVector.broadcast(F_SPEC, 4.0f);
+ FloatVector weightB = FloatVector.broadcast(F_SPEC, 255.0f).sub(rMean).div(256.0f).add(2.0f);
+
+ FloatVector distance = weightR.mul(rDiff).mul(rDiff).add(weightG.mul(gDiff).mul(gDiff)).add(weightB.mul(bDiff).mul(bDiff));
+
+ // Now we compare to the best distance we've found.
+ // This mask contains a "1" if better, and a "0" otherwise.
+ VectorMask<Float> bestDistanceMask = distance.lt(bestDistances);
+ bestDistances = bestDistances.blend(distance, bestDistanceMask); // Update the best distances
+
+ // Update the result array
+ // We also AND with the modification mask because we don't want to interfere if the alpha value isn't large enough.
+ resultIndex = resultIndex.blend(c, bestDistanceMask.cast(I_SPEC).and(modificationMask)); // Update the results
+ }
+
+ for (int j = 0; j < speciesLength; j++) {
+ int index = resultIndex.lane(j);
+ out[i + j] = (byte) (index < 128 ? index : -129 + (index - 127));
+ }
+ }
+
+ // For the final ones, fall back to the regular method
+ for (; i < in.length; i++) {
+ out[i] = MapPalette.matchColor(new Color(in[i], true));
+ }
+ }
+
+}
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
index c80faa079eca1564847070f0338fc98024639829..e632d51d3487eb4807243b6705999ad124466bf5 100644
--- a/src/main/java/org/bukkit/map/MapPalette.java
+++ b/src/main/java/org/bukkit/map/MapPalette.java
@@ -1,6 +1,7 @@
package org.bukkit.map;
import com.google.common.base.Preconditions;
+import gg.pufferfish.pufferfish.simd.SIMDDetection; // Pufferfish
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
@@ -40,7 +41,7 @@ public final class MapPalette {
}
@NotNull
- static final Color[] colors = {
+ public static final Color[] colors = { // Pufferfish - public access
c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0),
c(89, 125, 39), c(109, 153, 48), c(127, 178, 56), c(67, 94, 29),
c(174, 164, 115), c(213, 201, 140), c(247, 233, 163), c(130, 123, 86),
@@ -211,9 +212,15 @@ public final class MapPalette {
temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
byte[] result = new byte[temp.getWidth() * temp.getHeight()];
+ // Pufferfish start
+ if (!SIMDDetection.isEnabled) {
for (int i = 0; i < pixels.length; i++) {
result[i] = matchColor(new Color(pixels[i], true));
}
+ } else {
+ gg.pufferfish.pufferfish.simd.VectorMapPalette.matchColorVectorized(pixels, result);
+ }
+ // Pufferfish end
return result;
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index fc2dae69165776d08274e34a69962cc70445f411..899d67fa782fac639fe7fb096e05c551d75bd647 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -584,7 +584,9 @@ public final class SimplePluginManager implements PluginManager {
// Paper start
private void handlePluginException(String msg, Throwable ex, Plugin plugin) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
server.getLogger().log(Level.SEVERE, msg, ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerPluginEnableDisableException(msg, ex, plugin)));
}
// Paper end
@@ -654,9 +656,11 @@ public final class SimplePluginManager implements PluginManager {
));
}
} catch (Throwable ex) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setEventContext(event, registration); // Pufferfish
// Paper start - error reporting
String msg = "Could not pass event " + event.getEventName() + " to " + registration.getPlugin().getDescription().getFullName();
server.getLogger().log(Level.SEVERE, msg, ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removeEventContext(); // Pufferfish
if (!(event instanceof com.destroystokyo.paper.event.server.ServerExceptionEvent)) { // We don't want to cause an endless event loop
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerEventException(msg, ex, registration.getPlugin(), registration.getListener(), event)));
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..301e82369603f3dd6e6c1bd380da4bacacd7ef6c 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -336,7 +336,13 @@ public final class JavaPluginLoader implements PluginLoader {
try {
jPlugin.setEnabled(true);
} catch (Throwable ex) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
+ // Paper start - Disable plugins that fail to load
+ this.server.getPluginManager().disablePlugin(jPlugin);
+ return;
+ // Paper end
}
// Perhaps abort here, rather than continue going, but as it stands,
@@ -361,7 +367,9 @@ public final class JavaPluginLoader implements PluginLoader {
try {
jPlugin.setEnabled(false);
} catch (Throwable ex) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
server.getLogger().log(Level.SEVERE, "Error occurred while disabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
}
if (cloader instanceof PluginClassLoader) {
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 7e4f7cb2afbc145e532285c793573ad107bc3033..12449e18180d604e9cbbc744da74a8b222a18e1f 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -50,6 +50,8 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
private io.papermc.paper.plugin.provider.classloader.PluginClassLoaderGroup classLoaderGroup; // Paper
public io.papermc.paper.plugin.provider.entrypoint.DependencyContext dependencyContext; // Paper
+ private boolean closed = false; // Pufferfish
+
static {
ClassLoader.registerAsParallelCapable();
}
@@ -197,6 +199,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
throw new ClassNotFoundException(name);
}
+ public boolean _airplane_hasClass(@NotNull String name) { return this.classes.containsKey(name); } // Pufferfish
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
if (name.startsWith("org.bukkit.") || name.startsWith("net.minecraft.")) {
@@ -204,7 +207,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
}
Class<?> result = classes.get(name);
- if (result == null) {
+ if (result == null && !this.closed) { // Pufferfish
String path = name.replace('.', '/').concat(".class");
JarEntry entry = jar.getJarEntry(path);
@@ -251,6 +254,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
this.setClass(name, result); // Paper
}
+ if (result == null) throw new ClassNotFoundException(name); // Pufferfish
return result;
}
@@ -265,6 +269,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
// Paper end
super.close();
} finally {
+ this.closed = true; // Pufferfish
jar.close();
}
}

View File

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: granny <contact@granny.dev>
Date: Fri, 26 Apr 2024 18:07:21 +0900
Date: Sat, 4 May 2024 18:10:29 +0900
Subject: [PATCH] Purpur API Changes
PurpurMC
@@ -25,10 +25,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/build.gradle.kts b/build.gradle.kts
index 9164120d299d062c62529a7ef74eac0ded367993..09e541dcbbb43699b4402036b8a3cc86a0ac9aad 100644
index 65e67b8726f1e19a6bcb1fe2f448e4ab68df11d1..892e78b1d2d29dc54def03fcb6d85a93ad56d84c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -129,6 +129,8 @@ tasks.jar {
@@ -121,6 +121,8 @@ tasks.jar {
}
tasks.withType<Javadoc> {
@@ -185,24 +185,11 @@ index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48c
class DummyVersionFetcher implements VersionFetcher {
@Override
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
index ab5fea0b03224bf249352ce340e94704ff713345..3441cdad70da1bd523c5933b1a914688718c2657 100644
--- a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
@@ -15,7 +15,7 @@ public class SIMDChecker {
@Deprecated
public static boolean canEnable(Logger logger) {
try {
- if (SIMDDetection.getJavaVersion() != 17 && SIMDDetection.getJavaVersion() != 18 && SIMDDetection.getJavaVersion() != 19) {
+ if (SIMDDetection.getJavaVersion() < 17 || SIMDDetection.getJavaVersion() > 21) {
return false;
} else {
SIMDDetection.testRun = true;
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 9a428153f34291bdc026a71f7e60e285b7794b0c..53ce0fb2dac9c22680ab934f535b5a2037139445 100644
index 687bd8f54c9bfb5f5ab1f7ad9d232daf2433cc76..60de2456d00e85ac5ec5c4549198429aea87bc6d 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2884,4 +2884,127 @@ public final class Bukkit {
@@ -2907,4 +2907,127 @@ public final class Bukkit {
public static Server.Spigot spigot() {
return server.spigot();
}
@@ -421,10 +408,10 @@ index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index ec117c47401ea1a04beb0e5ee9d4d394db7c5c4e..5b058d709751a5b720e209931774e09fcc9c960c 100644
index 82d009c0bbe4b3026a535e02d6e0ed20c7bd525d..0366400fe6dea7af40badaa3335b49ff5992a516 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -11559,4 +11559,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -11653,4 +11653,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
public boolean isEnabledByFeature(@NotNull World world) {
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
}
@@ -577,10 +564,10 @@ index 30298a629b39bd43ce14b414fc697b2dfcbea89c..ce00af9121de7a910aaea4e0685a06d4
+ // Purpur end - OfflinePlayer API
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 4ff1b38eb65f97344257204cf018f176f247ed36..c15b0b05870a469ea5d314c9fac6a57a045f463c 100644
index 27084402cf0e46dcd171074629b7c4156e48aa44..a15d0ed710ff261f203d7e355e7d532f2e68abc9 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2235,6 +2235,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2254,6 +2254,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Paper end
@@ -599,7 +586,7 @@ index 4ff1b38eb65f97344257204cf018f176f247ed36..c15b0b05870a469ea5d314c9fac6a57a
/**
* Sends the component to the player
*
@@ -2518,4 +2530,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2537,4 +2549,105 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
// Paper end - Folia region threading API
@@ -706,10 +693,10 @@ index 4ff1b38eb65f97344257204cf018f176f247ed36..c15b0b05870a469ea5d314c9fac6a57a
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index e6f66d70d024cf4f0536a5bf8e51bf7b306335df..07e75978b4fc0e446e8aa46a40be5e371dc1c11b 100644
index 97f97ea5c6aa513c439f86a9c82821e0f7d9cd1e..83a5b68c785a88594e6e3824ed282844086f7f1a 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4233,6 +4233,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -4249,6 +4249,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable
public DragonBattle getEnderDragonBattle();
@@ -959,10 +946,10 @@ index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c
// Paper start
/**
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 23def071492ccd715693d534cc506936e18f0f46..706096924ffd3b578866693e2937de4182fad554 100644
index 62e3793903905b94eb1a120345015149abb33713..07b8c0dd049ff783fd2e408be634642479bf8b1e 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -1144,4 +1144,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -1155,4 +1155,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
@NotNull String getScoreboardEntryName();
// Paper end - entity scoreboard name
@@ -1111,30 +1098,16 @@ index bcc6ba95bd21c7972865838c636a03f50b6c1f1a..c3fcd8dd7dbb1e1a18e17c014c1e6411
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 65112eae8b92344796850b1e4c89e75443eab2fe..5369d802d37863a1efc0c031520147ceedcadc78 100644
index b777e530122549455dcce6fac8d4a151c1c0af42..61a046584acf48693489ff551a0dd4c4b16af9ff 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1445,4 +1445,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1447,4 +1447,27 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setBodyYaw(float bodyYaw);
// Paper end - body yaw API
+
+ // Purpur start
+ /**
+ * Gets the distance (in blocks) this entity can safely fall without taking damage
+ *
+ * @return Safe fall distance
+ */
+ float getSafeFallDistance();
+
+ /**
+ * Set the distance (in blocks) this entity can safely fall without taking damage
+ *
+ * @param safeFallDistance Safe fall distance
+ */
+ void setSafeFallDistance(float safeFallDistance);
+
+ /**
+ * Play item break animation for the item in specified equipment slot
+ *
+ * @param slot Equipment slot to play break animation for
@@ -1182,10 +1155,10 @@ index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d048ae07cc33fd77d128cc1ebf88b0804969fa3c..8bbbdad40bc6a1932d8f79ec95c0a92037b3dac5 100644
index 8a1e39474af88188f2e1765731b57d349f0ee645..b76adf4370555b02b891a49f8019b4e152c002c2 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3752,4 +3752,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3796,4 +3796,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
Spigot spigot();
// Spigot end
@@ -1379,13 +1352,13 @@ index 14543c2238b45c526dd9aebea2aa5c22f5df54dc..5312daf33405704c74e2c9e109754285
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/Wolf.java b/src/main/java/org/bukkit/entity/Wolf.java
index 84db38388bf7a58e66d6cd29620b4fe64b0a897e..82ebd99549ce9f9e6427a50cef424e9007735708 100644
index 4b84c04675775e2a606630b00de8afe51665cebc..ccbaf40a3131f477b4be2264401ad893725c1162 100644
--- a/src/main/java/org/bukkit/entity/Wolf.java
+++ b/src/main/java/org/bukkit/entity/Wolf.java
@@ -69,4 +69,20 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar
* @param interested Whether the wolf is interested
*/
public void setInterested(boolean interested);
@@ -112,4 +112,20 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar
return variant;
}
}
+
+ // Purpur start
+ /**
@@ -1435,10 +1408,10 @@ index c9f395064656dd0126410eb3c6e197baa450c063..13156a12e5df50cdc1e465dc0bd9d941
* When a player gets bad omen after killing a patrol captain.
*/
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
index daa1306a7324d946d66ad5a674bbc84371d8d4d6..f3b2d7b6fda051211add2b3215f120fb6911aeed 100644
index 59b375569a75cb1e1f7c610f96078e102ec0d3ed..a3f74891abbdc51dbbddaeb511f2754e0603c904 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -165,7 +165,7 @@ public enum InventoryType {
@@ -166,7 +166,7 @@ public enum InventoryType {
SMITHING_NEW(4, "Upgrade Gear"),
;
@@ -1464,32 +1437,13 @@ index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c
+ boolean canDoUnsafeEnchants();
+
+ void setDoUnsafeEnchants(boolean canDoUnsafeEnchants);
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index f680545b6b59bf8d2ad154b0472dda4cba42a162..58a62ba0635f9158bf18043da89aba7521e0e2e1 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -353,4 +353,14 @@ public interface ItemFactory {
*/
@NotNull ItemStack enchantWithLevels(@NotNull ItemStack itemStack, @org.jetbrains.annotations.Range(from = 1, to = 30) int levels, boolean allowTreasure, @NotNull java.util.Random random);
// Paper end - enchantWithLevels API
+
+ // Purpur start
+ /**
+ * Returns the lines of text shown when hovering over an item
+ * @param itemStack The ItemStack
+ * @param advanced Whether advanced tooltips are shown
+ * @return the list of Components
+ */
+ @NotNull java.util.List<net.kyori.adventure.text.@NotNull Component> getHoverLines(@NotNull ItemStack itemStack, boolean advanced);
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 7414b4fa690d393a8e9557cc1fd1ce12fa426940..591759aef6c7c3333cbdab596c6619af9185c3c2 100644
index 84a7bf0936d35bf42b5ed038d295d5c31740f472..6e9b4cbc81878616b1c48add5db534286d267b05 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta;
@@ -17,6 +17,17 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.material.MaterialData;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -1503,12 +1457,11 @@ index 7414b4fa690d393a8e9557cc1fd1ce12fa426940..591759aef6c7c3333cbdab596c6619af
+import org.bukkit.inventory.meta.Repairable;
+import org.bukkit.persistence.PersistentDataContainer;
+import org.bukkit.persistence.PersistentDataHolder;
+import com.destroystokyo.paper.Namespaced;
+// Purpur end
/**
* Represents a stack of items.
@@ -1061,4 +1073,635 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -1073,4 +1084,565 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
return Bukkit.getUnsafe().computeTooltipLines(this, tooltipContext, player);
}
// Paper end - expose itemstack tooltip lines
@@ -1993,67 +1946,6 @@ index 7414b4fa690d393a8e9557cc1fd1ce12fa426940..591759aef6c7c3333cbdab596c6619af
+ }
+
+ /**
+ * Gets the collection of namespaced keys that the item can destroy in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @return Set of {@link com.destroystokyo.paper.Namespaced}
+ */
+ @NotNull
+ public java.util.Set<Namespaced> getDestroyableKeys() {
+ return getItemMeta().getDestroyableKeys();
+ }
+
+ /**
+ * Sets the collection of namespaced keys that the item can destroy in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @param canDestroy Collection of {@link com.destroystokyo.paper.Namespaced}
+ */
+ public void setDestroyableKeys(@NotNull Collection<Namespaced> canDestroy) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setDestroyableKeys(canDestroy);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Gets the collection of namespaced keys that the item can be placed on in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @return Set of {@link com.destroystokyo.paper.Namespaced}
+ */
+ @NotNull
+ public java.util.Set<Namespaced> getPlaceableKeys() {
+ return getItemMeta().getPlaceableKeys();
+ }
+
+ /**
+ * Sets the set of namespaced keys that the item can be placed on in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @param canPlaceOn Collection of {@link com.destroystokyo.paper.Namespaced}
+ */
+ @NotNull
+ public void setPlaceableKeys(@NotNull Collection<Namespaced> canPlaceOn) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setPlaceableKeys(canPlaceOn);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks for the existence of any keys that the item can be placed on
+ *
+ * @return true if this item has placeable keys
+ */
+ public boolean hasPlaceableKeys() {
+ return hasItemMeta() && getItemMeta().hasPlaceableKeys();
+ }
+
+ /**
+ * Checks for the existence of any keys that the item can destroy
+ *
+ * @return true if this item has destroyable keys
+ */
+ public boolean hasDestroyableKeys() {
+ return hasItemMeta() && getItemMeta().hasDestroyableKeys();
+ }
+
+ /**
+ * Repairs this item by 1 durability
+ */
+ public void repair() {
@@ -2098,7 +1990,7 @@ index 7414b4fa690d393a8e9557cc1fd1ce12fa426940..591759aef6c7c3333cbdab596c6619af
+ public boolean damage(int amount, boolean ignoreUnbreaking) {
+ Damageable damageable = (Damageable) getItemMeta();
+ if (amount > 0) {
+ int unbreaking = getEnchantLevel(Enchantment.DURABILITY);
+ int unbreaking = getEnchantLevel(Enchantment.UNBREAKING);
+ int reduce = 0;
+ for (int i = 0; unbreaking > 0 && i < amount; ++i) {
+ if (reduceDamage(java.util.concurrent.ThreadLocalRandom.current(), unbreaking)) {
@@ -2133,15 +2025,6 @@ index 7414b4fa690d393a8e9557cc1fd1ce12fa426940..591759aef6c7c3333cbdab596c6619af
+ }
+ return random.nextInt(unbreaking + 1) > 0;
+ }
+
+ /**
+ * Returns the lines of text shown when hovering over the item
+ * @param advanced Whether advanced tooltips are shown
+ * @return the list of Components
+ */
+ public @NotNull List<net.kyori.adventure.text.@NotNull Component> getHoverLines(boolean advanced) {
+ return Bukkit.getItemFactory().getHoverLines(this, advanced);
+ }
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
@@ -2230,7 +2113,7 @@ index cd3296fea01648592d2af89b3d80135acb6d0958..45797a6fbae1d8edc4211cb30def24ad
permissions.put(lname, new PermissionAttachmentInfo(parent, lname, attachment, value));
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 301e82369603f3dd6e6c1bd380da4bacacd7ef6c..0c6ca7588fb3d6b6497ddf032fe75e5c6c9719e5 100644
index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..f1e58639213be0c43cd2ff090b625e7d0a67e8be 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -55,6 +55,7 @@ public final class JavaPluginLoader implements PluginLoader {
@@ -2242,10 +2125,10 @@ index 301e82369603f3dd6e6c1bd380da4bacacd7ef6c..0c6ca7588fb3d6b6497ddf032fe75e5c
/**
* 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..46b0d02aa759b3735e6ac811523d459cf263aa8b 100644
index 8e1b6be2462aaa692efa1f72986921a6dc357196..b6e18b12fd4d61ce92203582906d24b4d14e6cc5 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
@@ -68,6 +68,7 @@ public class LibraryLoader
@Override
public void transferStarted(@NotNull TransferEvent event) throws TransferCancelledException
{
@@ -2253,7 +2136,7 @@ index 653135352c104a6ddeb74a1b6d4916c6952d6271..46b0d02aa759b3735e6ac811523d459c
logger.log( Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
}
} );
@@ -81,6 +82,7 @@ public class LibraryLoader
@@ -88,6 +89,7 @@ public class LibraryLoader
{
return null;
}
@@ -2261,7 +2144,7 @@ index 653135352c104a6ddeb74a1b6d4916c6952d6271..46b0d02aa759b3735e6ac811523d459c
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
@@ -135,6 +137,7 @@ public class LibraryLoader
}
jarFiles.add( url );
@@ -2269,204 +2152,6 @@ index 653135352c104a6ddeb74a1b6d4916c6952d6271..46b0d02aa759b3735e6ac811523d459c
logger.log( Level.INFO, "[{0}] Loaded library {1}", new Object[]
{
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), file // Paper - use configured log prefix
diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java
index c8ab330ef171795d08fa201cf8320703c7f1c66b..93e2ea220dc03c122f82af65d5e9fda5b582290c 100644
--- a/src/main/java/org/bukkit/potion/PotionEffect.java
+++ b/src/main/java/org/bukkit/potion/PotionEffect.java
@@ -33,6 +33,7 @@ public class PotionEffect implements ConfigurationSerializable {
private static final String AMBIENT = "ambient";
private static final String PARTICLES = "has-particles";
private static final String ICON = "has-icon";
+ private static final String KEY = "namespacedKey"; // Purpur
private final int amplifier;
private final int duration;
private final PotionEffectType type;
@@ -40,6 +41,7 @@ public class PotionEffect implements ConfigurationSerializable {
private final boolean particles;
private final boolean icon;
private final PotionEffect hiddenEffect; // Paper
+ @Nullable private final NamespacedKey key; // Purpur
/**
* Creates a potion effect.
@@ -50,11 +52,12 @@ public class PotionEffect implements ConfigurationSerializable {
* @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
* @param particles the particle status, see {@link PotionEffect#hasParticles()}
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
* @param hiddenEffect the hidden PotionEffect
* @hidden Internal-- hidden effects are only shown internally
*/
@org.jetbrains.annotations.ApiStatus.Internal // Paper
- public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable PotionEffect hiddenEffect) { // Paper
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable PotionEffect hiddenEffect, @Nullable NamespacedKey key) { // Paper // Purpur
Preconditions.checkArgument(type != null, "effect type cannot be null");
this.type = type;
this.duration = duration;
@@ -62,6 +65,7 @@ public class PotionEffect implements ConfigurationSerializable {
this.ambient = ambient;
this.particles = particles;
this.icon = icon;
+ this.key = key; // Purpur
// Paper start
this.hiddenEffect = hiddenEffect;
}
@@ -77,10 +81,27 @@ public class PotionEffect implements ConfigurationSerializable {
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
*/
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon) {
- this(type, duration, amplifier, ambient, particles, icon, null);
+ this(type, duration, amplifier, ambient, particles, icon, null, null); // Purpur
// Paper end
}
+ // Purpur start
+ /**
+ * Creates a potion effect.
+ * @param type effect type
+ * @param duration measured in ticks, see {@link
+ * PotionEffect#getDuration()}
+ * @param amplifier the amplifier, see {@link PotionEffect#getAmplifier()}
+ * @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
+ * @param particles the particle status, see {@link PotionEffect#hasParticles()}
+ * @param icon the icon status, see {@link PotionEffect#hasIcon()}
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
+ */
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable NamespacedKey key) {
+ this(type, duration, amplifier, ambient, particles, icon, null, key);
+ }
+ // Purpur end
+
/**
* Creates a potion effect with no defined color.
*
@@ -126,33 +147,33 @@ public class PotionEffect implements ConfigurationSerializable {
* @param map the map to deserialize from
*/
public PotionEffect(@NotNull Map<String, Object> map) {
- this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), (PotionEffect) map.get(HIDDEN_EFFECT)); // Paper
+ this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), (PotionEffect) map.get(HIDDEN_EFFECT), getKey(map)); // Paper // Purpur - getKey
}
// Paper start
@NotNull
public PotionEffect withType(@NotNull PotionEffectType type) {
- return new PotionEffect(type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
@NotNull
public PotionEffect withDuration(int duration) {
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
@NotNull
public PotionEffect withAmplifier(int amplifier) {
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
@NotNull
public PotionEffect withAmbient(boolean ambient) {
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
@NotNull
public PotionEffect withParticles(boolean particles) {
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
@NotNull
public PotionEffect withIcon(boolean icon) {
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
/**
@@ -169,6 +190,13 @@ public class PotionEffect implements ConfigurationSerializable {
}
// Paper end
+ // Purpur start
+ @NotNull
+ public PotionEffect withKey(@Nullable NamespacedKey key) {
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key);
+ }
+ // Purpur end
+
@NotNull
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
PotionEffectType effect;
@@ -201,6 +229,17 @@ public class PotionEffect implements ConfigurationSerializable {
return def;
}
+ // Purpur start
+ @Nullable
+ private static NamespacedKey getKey(@NotNull Map<?, ?> map) {
+ Object key = map.get(KEY);
+ if (key instanceof String stringKey) {
+ return NamespacedKey.fromString(stringKey);
+ }
+ return null;
+ }
+ // Purpur end
+
@Override
@NotNull
public Map<String, Object> serialize() {
@@ -215,6 +254,11 @@ public class PotionEffect implements ConfigurationSerializable {
if (this.hiddenEffect != null) {
builder.put(HIDDEN_EFFECT, this.hiddenEffect);
}
+ // Purpur start
+ if (key != null) {
+ builder.put(KEY, key.toString());
+ }
+ // Purpur end
return builder.build();
// Paper end
}
@@ -243,7 +287,7 @@ public class PotionEffect implements ConfigurationSerializable {
return false;
}
PotionEffect that = (PotionEffect) obj;
- return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && java.util.Objects.equals(this.hiddenEffect, that.hiddenEffect); // Paper
+ return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && java.util.Objects.equals(this.hiddenEffect, that.hiddenEffect) && this.key == that.key; // Paper // Purpur - add key
}
/**
@@ -339,6 +383,24 @@ public class PotionEffect implements ConfigurationSerializable {
return icon;
}
+
+ // Purpur start
+ /**
+ * @return if the key isn't the default namespacedKey
+ */
+ public boolean hasKey() {
+ return key != null;
+ }
+
+ /**
+ * @return the key attached to the potion
+ */
+ @Nullable
+ public NamespacedKey getKey() {
+ return key;
+ }
+ // Purpur end
+
@Override
public int hashCode() {
int hash = 1;
@@ -354,6 +416,6 @@ public class PotionEffect implements ConfigurationSerializable {
@Override
public String toString() {
- return "PotionEffect{" + "amplifier=" + amplifier + ", duration=" + duration + ", type=" + type + ", ambient=" + ambient + ", particles=" + particles + ", icon=" + icon + ", hiddenEffect=" + hiddenEffect + '}'; // Paper
+ return "PotionEffect{" + "amplifier=" + amplifier + ", duration=" + duration + ", type=" + type + ", ambient=" + ambient + ", particles=" + particles + ", icon=" + icon + ", hiddenEffect=" + hiddenEffect + ", key=" + key + '}'; // Paper // Purpur - add key
}
}
diff --git a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
index 7763d6101ac61900db1e2310966b99584539fd0e..d5a42707d365ffd72532bbb1a59a1ca7145f9918 100644
--- a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
@@ -2993,10 +2678,10 @@ index 0000000000000000000000000000000000000000..519809eab5d926dc7b0a7bad5d446d0d
+}
diff --git a/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java b/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..32602b398ede24a35ed8a996faa2b23455615a7b
index 0000000000000000000000000000000000000000..8ea97ddceedb7c719e8a50a0dd8f3f0919ca1647
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java
@@ -0,0 +1,54 @@
@@ -0,0 +1,53 @@
+package org.purpurmc.purpur.event;
+
+import org.bukkit.block.Block;
@@ -3005,7 +2690,6 @@ index 0000000000000000000000000000000000000000..32602b398ede24a35ed8a996faa2b234
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.block.BlockExplodeEvent;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import java.util.Collections;
+
+/**
@@ -3016,8 +2700,8 @@ index 0000000000000000000000000000000000000000..32602b398ede24a35ed8a996faa2b234
+ private boolean cancelled;
+ private final float yield;
+
+ public PreBlockExplodeEvent(@NotNull final Block what, final float yield, @Nullable BlockState explodedBlockState) {
+ super(what, Collections.emptyList(), yield, explodedBlockState);
+ public PreBlockExplodeEvent(@NotNull final Block what, final float yield, @NotNull BlockState explodedBlockState) {
+ super(what, explodedBlockState, Collections.emptyList(), yield);
+ this.yield = yield;
+ this.cancelled = false;
+ }
@@ -3918,60 +3602,6 @@ index 0000000000000000000000000000000000000000..eebb5d124456b8209d1b8e8cc4cb772d
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/purpurmc/purpur/event/packet/NetworkItemSerializeEvent.java b/src/main/java/org/purpurmc/purpur/event/packet/NetworkItemSerializeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..c0da73d2ea83a6055e34894ba1c7506fc8667712
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/event/packet/NetworkItemSerializeEvent.java
@@ -0,0 +1,48 @@
+package org.purpurmc.purpur.event.packet;
+
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Called when an item is about to be written to a packet.
+ */
+public class NetworkItemSerializeEvent extends Event {
+ private ItemStack itemStack;
+
+ public NetworkItemSerializeEvent(@NotNull ItemStack itemStack) {
+ super(!org.bukkit.Bukkit.isPrimaryThread());
+ this.itemStack = itemStack;
+ }
+
+ /**
+ * @return The item that is about to be serialized. Not mutable
+ */
+ @NotNull
+ public ItemStack getItemStack() {
+ return itemStack;
+ }
+
+ /**
+ * Sets the item that will be serialized.
+ *
+ * @param itemStack The item
+ */
+ public void setItemStack(@Nullable ItemStack itemStack) {
+ this.itemStack = itemStack;
+ }
+
+ private static final HandlerList handlers = new HandlerList();
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/purpurmc/purpur/event/player/PlayerBookTooLargeEvent.java b/src/main/java/org/purpurmc/purpur/event/player/PlayerBookTooLargeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..c88394336bc9ab0f66a2af24d393f4a176a234d5
@@ -4123,18 +3753,3 @@ index 12946bd55fcf7c40d39081779a7fa30049ee6165..9c2d605c50cbf9aefa56ec209df9f6ce
+ public void stopTiming() { /*handler.stopTiming();*/ } // Purpur
}
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
index 88f1ca89fa640a686231b8eec87e70419b2d73ef..d6b91c49a267c89d7df2ddee7ccfe64675d117be 100644
--- a/src/test/java/org/bukkit/AnnotationTest.java
+++ b/src/test/java/org/bukkit/AnnotationTest.java
@@ -47,6 +47,10 @@ public class AnnotationTest {
"org/bukkit/plugin/java/PluginClassLoader",
// Generic functional interface
"org/bukkit/util/Consumer",
+ // Purpur start
+ "gg/pufferfish/pufferfish/sentry/SentryContext",
+ "gg/pufferfish/pufferfish/sentry/SentryContext$State",
+ // Purpur end
// Paper start
"io/papermc/paper/util/TransformingRandomAccessList",
"io/papermc/paper/util/TransformingRandomAccessList$TransformedListIterator",

View File

@@ -0,0 +1,140 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 14 Jan 2024 19:50:29 +0900
Subject: [PATCH] Use Gradle Version Catalogs
diff --git a/build.gradle.kts b/build.gradle.kts
index 892e78b1d2d29dc54def03fcb6d85a93ad56d84c..cd64328dd664821a23ba2765e82dd633b696e3ab 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,11 +9,13 @@ java {
withJavadocJar()
}
+/*
val annotationsVersion = "24.1.0"
val bungeeCordChatVersion = "1.20-R0.2"
val adventureVersion = "4.17.0-SNAPSHOT"
val slf4jVersion = "2.0.9"
val log4jVersion = "2.17.1"
+ */
val apiAndDocs: Configuration by configurations.creating {
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@@ -27,54 +29,31 @@ configurations.api {
}
dependencies {
- // api dependencies are listed transitively to API consumers
- api("com.google.guava:guava:32.1.2-jre")
- api("com.google.code.gson:gson:2.10.1")
- // Paper start - adventure
- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.18") {
- exclude("com.google.guava", "guava")
- }
- // Paper - adventure
- api("org.yaml:snakeyaml:2.2")
- api("org.joml:joml:1.10.5")
- // Paper start
- api("com.googlecode.json-simple:json-simple:1.1.1") {
- isTransitive = false // includes junit
- }
- api("it.unimi.dsi:fastutil:8.5.6")
- apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
- apiAndDocs("net.kyori:adventure-api")
- apiAndDocs("net.kyori:adventure-text-minimessage")
- apiAndDocs("net.kyori:adventure-text-serializer-gson")
- apiAndDocs("net.kyori:adventure-text-serializer-legacy")
- apiAndDocs("net.kyori:adventure-text-serializer-plain")
- apiAndDocs("net.kyori:adventure-text-logger-slf4j")
- api("org.apache.logging.log4j:log4j-api:$log4jVersion")
- api("org.slf4j:slf4j-api:$slf4jVersion")
-
- implementation("org.ow2.asm:asm:9.7")
- implementation("org.ow2.asm:asm-commons:9.7")
- // Paper end
-
- api("org.apache.maven:maven-resolver-provider:3.9.6") // Paper - make API dependency for Paper Plugins
- compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
- compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
-
- val annotations = "org.jetbrains:annotations:$annotationsVersion" // Paper - we don't want Java 5 annotations...
- compileOnly(annotations)
- testCompileOnly(annotations)
-
- // Paper start - add checker
- val checkerQual = "org.checkerframework:checker-qual:3.33.0"
- compileOnlyApi(checkerQual)
- testCompileOnly(checkerQual)
- // Paper end
-
- testImplementation("org.apache.commons:commons-lang3:3.12.0")
- testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
- testImplementation("org.hamcrest:hamcrest:2.2")
- testImplementation("org.mockito:mockito-core:5.11.0")
- testImplementation("org.ow2.asm:asm-tree:9.7")
+
+ // Plazma start - Use Gradle Version Catalogs
+ implementation(common.bundles.asm)
+
+ api(api.bundles.api)
+ api(common.snakeyaml)
+ api(common.log4j.api)
+ api(common.maven.provider)
+ api(api.bungeechat) { exclude("com.google.guava", "guava") }
+ api(api.jsonsimple) { isTransitive = false }
+ apiAndDocs(platform(common.adventure.bom))
+ apiAndDocs(common.bundles.adventure)
+
+ compileOnly(common.bundles.maven)
+ compileOnly(api.annotations)
+ compileOnlyApi(api.checkerqual)
+
+ testImplementation(common.asm.tree)
+ testImplementation(common.commons.lang3)
+ testImplementation(common.bundles.test)
+
+ testCompileOnly(api.annotations)
+ testCompileOnly(api.checkerqual)
+ // Plazma end
+
}
// Paper start
@@ -128,25 +107,16 @@ tasks.withType<Javadoc> {
options.use()
options.isDocFilesSubDirs = true
options.links(
- "https://guava.dev/releases/32.1.2-jre/api/docs/",
- "https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
- "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
- // "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat
- // Paper start - add missing javadoc links
- "https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
- // Paper end
- // Paper start
- //"https://jd.advntr.dev/api/$adventureVersion/",
- //"https://jd.advntr.dev/text-minimessage/$adventureVersion/",
- //"https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
- //"https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
- //"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
- //"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
- "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
- "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
- // Paper end
- "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
+ // Plazma start - Use Gradle Version Catalogs
+ "https://guava.dev/releases/${api.guava.orNull?.version}/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/${common.snakeyaml.orNull?.version}/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/${api.annotations.orNull?.version}/",
+ "https://javadoc.io/doc/org.joml/joml/${api.joml.orNull?.version}/index.html",
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/${api.gson.orNull?.version}",
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/${api.slf4j.api.orNull?.version}/",
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/${common.log4j.api.orNull?.version}/",
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.maven.connector.orNull?.version}",
+ // Plazma end
)
options.tags("apiNote:a:API Note:")

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Plazma Configurations
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index c15b0b05870a469ea5d314c9fac6a57a045f463c..b55834f2477d18290b2985685eeeb249114dca67 100644
index a15d0ed710ff261f203d7e355e7d532f2e68abc9..a1d870c6523b0b382d01ca27501a4c091eb795af 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2247,6 +2247,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2266,6 +2266,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Purpur end

View File

@@ -1,115 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 14 Jan 2024 19:50:29 +0900
Subject: [PATCH] Use Gradle Version Catalogs
diff --git a/build.gradle.kts b/build.gradle.kts
index 09e541dcbbb43699b4402036b8a3cc86a0ac9aad..085cdd8ccdc27f94b22baab7ea4ac0d02769378f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,11 +9,13 @@ java {
withJavadocJar()
}
+/* // Plazma - Use Gradle Version Catalogs
val annotationsVersion = "24.0.1"
val bungeeCordChatVersion = "1.20-R0.2"
val adventureVersion = "4.16.0"
val slf4jVersion = "2.0.9"
val log4jVersion = "2.17.1"
+ */ // Plazma - Use Gradle Version Catalogs
val apiAndDocs: Configuration by configurations.creating {
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@@ -27,6 +29,7 @@ configurations.api {
}
dependencies {
+ /* // Plazma - Use Gradle Version Catalogs
// api dependencies are listed transitively to API consumers
api("com.google.guava:guava:32.1.2-jre")
api("com.google.code.gson:gson:2.10.1")
@@ -39,6 +42,34 @@ dependencies {
api("org.joml:joml:1.10.5")
// Paper start
api("com.googlecode.json-simple:json-simple:1.1.1") {
+ // Plazma start - Use Gradle Version Catalogs
+ */
+ implementation(common.bundles.asm)
+
+ api(api.bundles.api)
+ api(common.snakeyaml)
+ api(common.log4j.api)
+ api(common.maven.provider)
+ api(api.jsonsimple) {
+ isTransitive = false // includes junit
+ }
+
+ apiAndDocs(common.bundles.adventure)
+ apiAndDocs(platform(common.adventure.bom))
+
+ compileOnly(api.findbugs)
+ compileOnly(api.annotations)
+ compileOnly(common.bundles.maven)
+
+ compileOnlyApi(api.checkerqual)
+
+ testImplementation(common.asm.tree)
+ testImplementation(common.bundles.test)
+ testImplementation(common.commons.lang3)
+
+ testCompileOnly(api.bundles.annotations)
+ /*
+ // Plazma end - Use Gradle Version Catalogs
isTransitive = false // includes junit
}
api("it.unimi.dsi:fastutil:8.5.6")
@@ -76,6 +107,7 @@ dependencies {
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.mockito:mockito-core:5.11.0")
testImplementation("org.ow2.asm:asm-tree:9.7")
+ */ // Plazma - Use Gradle Version Catalogs
}
// Paper start
@@ -136,25 +168,25 @@ tasks.withType<Javadoc> {
options.use()
options.isDocFilesSubDirs = true
options.links(
- "https://guava.dev/releases/32.1.2-jre/api/docs/",
- "https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
- "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
+ "https://guava.dev/releases/${api.guava.orNull?.version}/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/${common.snakeyaml.orNull?.version}/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/${api.annotations.orNull?.version}/", // Paper - we don't want Java 5 annotations
// "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat
// Paper start - add missing javadoc links
- "https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
+ "https://javadoc.io/doc/org.joml/joml/${api.joml.orNull?.version}/index.html",
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/${api.gson.orNull?.version}",
// Paper end
// Paper start
- "https://jd.advntr.dev/api/$adventureVersion/",
- "https://jd.advntr.dev/text-minimessage/$adventureVersion/",
- "https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
- "https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
- "https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
- "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
- "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
- "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
+ "https://jd.advntr.dev/api/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-minimessage/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-serializer-gson/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-serializer-legacy/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-serializer-plain/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-logger-slf4j/${common.adventure.api.orNull?.version}/",
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/${api.slf4j.api.orNull?.version}/",
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/${common.log4j.api.orNull?.version}/",
// Paper end
- "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.maven.connector.orNull?.version}", // Paper
)
options.tags("apiNote:a:API Note:")

View File

@@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 28 Sep 2023 12:21:36 +0900
Subject: [PATCH] Implement No Chat Reports
diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
index f7f864a2b46129e4d61bc87f3e23c343417aa094..eb3cc41388a210f000bf637bfae135081bee51e9 100644
--- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
@@ -216,6 +216,8 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
* Fallback cause
*/
UNKNOWN,
+
+ NCR_NOT_INSTALLED, // Plazma - Implement No Chat Reports
}
// Paper end
}

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,87 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 14 Jan 2024 19:51:19 +0900
Subject: [PATCH] Use Gradle Version Catalogs
diff --git a/build.gradle.kts b/build.gradle.kts
index 81996f00384674b29368e8bea944bdd14d631da3..feaff0406fa47ffb265ce316b057fb52aa367870 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -18,57 +18,27 @@ dependencies {
exclude("io.papermc.paper", "paper-api")
}
// Purpur end
- // Paper start
- implementation("org.jline:jline-terminal-jansi:3.21.0")
- implementation("net.minecrell:terminalconsoleappender:1.3.0")
- implementation("net.kyori:adventure-text-serializer-ansi:4.16.0") // Keep in sync with adventureVersion from Paper-API build file
- /*
- Required to add the missing Log4j2Plugins.dat file from log4j-core
- which has been removed by Mojang. Without it, log4j has to classload
- all its classes to check if they are plugins.
- Scanning takes about 1-2 seconds so adding this speeds up the server start.
- */
- implementation("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - implementation
- log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins
+
+ // Plazma start - Use Gradle Version Catalogs
+ implementation(server.bundles.implementation)
+ implementation(common.asm.commons)
+ implementation(common.log4j.iostreams)
+ implementation(common.commons.lang2)
+ implementation(server.velocity) { isTransitive = false }
+
+ runtimeOnly(common.maven.provider)
+ runtimeOnly(common.bundles.maven)
+ runtimeOnly(server.bundles.runtime)
+
+ implementation(common.log4j.core) // Paper - implementation
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j.core) // Paper - Needed to generate meta for our Log4j plugins
runtimeOnly(log4jPlugins.output)
alsoShade(log4jPlugins.output)
- implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
- // Paper end
- implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
- implementation("org.ow2.asm:asm-commons:9.7")
- implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
- implementation("commons-lang:commons-lang:2.6")
- runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0")
- runtimeOnly("com.mysql:mysql-connector-j:8.3.0")
- runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
- // Paper start - Use Velocity cipher
- implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
- isTransitive = false
- }
- // Paper end - Use Velocity cipher
-
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
-
- implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
- implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
- implementation("dev.omega24:upnp4j:1.0") // Purpur
-
- testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
- testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
- testImplementation("org.hamcrest:hamcrest:2.2")
- testImplementation("org.mockito:mockito-core:5.11.0")
- testImplementation("org.ow2.asm:asm-tree:9.7")
- testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
- implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
- implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins
- // Paper start - Remap reflection
- val reflectionRewriterVersion = "0.0.1"
- implementation("io.papermc:reflection-rewriter:$reflectionRewriterVersion")
- implementation("io.papermc:reflection-rewriter-runtime:$reflectionRewriterVersion")
- implementation("io.papermc:reflection-rewriter-proxy-generator:$reflectionRewriterVersion")
- // Paper end - Remap reflection
+
+ testImplementation(server.bundles.test)
+ testImplementation(common.bundles.test)
+ // Plazma end - Use Gradle Version Catalogs
+
}
paperweight {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Rebrand
diff --git a/build.gradle.kts b/build.gradle.kts
index b97182b806fddf53ddcdbe57a43500d36e97e2a4..055627fc478a3e64b0e0644cbd9ef4cf5438c696 100644
index feaff0406fa47ffb265ce316b057fb52aa367870..902c2eeedeeced8135ec97f64f08420c0996731b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,12 +13,10 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
@@ -12,12 +12,10 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
val alsoShade: Configuration by configurations.creating
dependencies {
@@ -18,14 +18,14 @@ index b97182b806fddf53ddcdbe57a43500d36e97e2a4..055627fc478a3e64b0e0644cbd9ef4cf
- exclude("io.papermc.paper", "paper-api")
- }
- // Purpur end
+ // Plazma start - Branding
+ // Plazma start - Rebrand
+ implementation(project(":plazma-api"))
+ implementation(project(":plazma-mojangapi"))
+ // Plazma end - Branding
// Plazma start - Use Gradle version catalogs
/*
// Paper start
@@ -118,7 +116,7 @@ tasks.jar {
+ // Plazma end
// Plazma start - Use Gradle Version Catalogs
implementation(server.bundles.implementation)
@@ -57,7 +55,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
@@ -35,7 +35,7 @@ index b97182b806fddf53ddcdbe57a43500d36e97e2a4..055627fc478a3e64b0e0644cbd9ef4cf
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..0b3d87d2d43148e6370e7a03e0bb6074891ac800 100644
index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..1de03b16c513d83550077bab46b52ae6e40eb98e 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -593,7 +593,7 @@ public class Metrics {
@@ -43,7 +43,7 @@ index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..0b3d87d2d43148e6370e7a03e0bb6074
// Only start Metrics, if it's enabled in the config
if (config.getBoolean("enabled", true)) {
- Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur
+ Metrics metrics = new Metrics("Plazma", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Plazma - Branding
+ Metrics metrics = new Metrics("Plazma", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Plazma - Rebrand
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
@@ -52,12 +52,12 @@ index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..0b3d87d2d43148e6370e7a03e0bb6074
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
- metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
+ metrics.addCustomChart(new Metrics.SimplePie("plazma_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur // Plazma // Plazma - Branding
+ metrics.addCustomChart(new Metrics.SimplePie("plazma_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur // Plazma // Plazma - Rebrand
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
Map<String, Map<String, Integer>> map = new HashMap<>();
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..b04d3eea789f77b2435cb0192635f1be1bab597d 100644
index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..80159d9c8432f21aa774d3ade9e2ae84b2d5261c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -20,10 +20,11 @@ import java.util.stream.StreamSupport;
@@ -65,11 +65,11 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..b04d3eea789f77b2435cb0192635f1be
private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end
// Purpur start
- private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads";
+ private static final String DOWNLOAD_PAGE = "https://github.com/PlazmaMC/Plazma/releases"; // Plazma // Plazma - Branding
+ private static final String DOWNLOAD_PAGE = "https://github.com/PlazmaMC/Plazma/releases"; // Plazma // Plazma - Rebrand
private static int distance = -2; public int distance() { return distance; }
// Purpur end
private static @Nullable String mcVer;
+ private static final boolean DEVELOPMENT = false; // Plazma
+ public static final boolean DEVELOPMENT = false; // Plazma
@Override
public long getCacheTime() {
@@ -79,8 +79,8 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..b04d3eea789f77b2435cb0192635f1be
public Component getVersionMessage(@Nonnull String serverVersion) {
- String[] parts = serverVersion.substring("git-Purpur-".length()).split("[-\\s]"); // Purpur
- final Component updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", "ver/" + getMinecraftVersion(), parts[0]); // Purpur
+ String[] parts = serverVersion.substring("git-Plazma-".length()).split("[-\\s]"); // Purpur // Plazma // Plazma - Branding
+ final Component updateMessage = getUpdateStatusMessage("PlazmaMC/PlazmaBukkit", (DEVELOPMENT ? "dev/" : "ver/") + getMinecraftVersion(), parts[0]); // Purpur // Plazma // Plazma - Branding
+ String[] parts = serverVersion.substring("git-Plazma-".length()).split("[-\\s]"); // Purpur // Plazma // Plazma - Rebrand
+ final Component updateMessage = getUpdateStatusMessage("PlazmaMC/PlazmaBukkit", (DEVELOPMENT ? "dev/" : "ver/") + getMinecraftVersion(), parts[0]); // Purpur // Plazma // Plazma - Rebrand
final Component history = getHistory();
return history != null ? Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()), history, updateMessage) : updateMessage; // Purpur
@@ -89,7 +89,7 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..b04d3eea789f77b2435cb0192635f1be
mcVer = result.substring(0, result.length() - 2); // strip 'R' anchor and trailing '-'
} else {
- org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Purpur!"); // Purpur
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Plazma!"); // Purpur // Plazma // Plazma - Branding
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Plazma!"); // Purpur // Plazma // Plazma - Rebrand
org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
}
@@ -130,7 +130,7 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..b04d3eea789f77b2435cb0192635f1be
// Contributed by Techcable <Techcable@outlook.com> in GH-65
private static int fetchDistanceFromGitHub(@Nonnull String repo, @Nonnull String branch, @Nonnull String hash) {
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
index 3cb56595822799926a8141e60a42f5d1edfc6de5..3e32c28e1d4c157a2f00dbc6d6e9d71cb3b8f6b7 100644
index 3cb56595822799926a8141e60a42f5d1edfc6de5..aa5f7dbaa62d83168055f2d389ba1ed512d1741b 100644
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
@@ -138,12 +138,12 @@ index 3cb56595822799926a8141e60a42f5d1edfc6de5..3e32c28e1d4c157a2f00dbc6d6e9d71c
protected LineReader buildReader(LineReaderBuilder builder) {
builder
- .appName("Purpur") // Purpur
+ .appName("Plazma") // Purpur // Plazma - Branding
+ .appName("Plazma") // Purpur // Plazma - Rebrand
.variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history"))
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
index f91ea723a1c85f6cf8c4f6dd7f182b948c2f2e81..c5a3f9c2daf3da135cccecb757353534e1688821 100644
index c366d84518979e842a6f10f969a5951539ecac93..570b379596cc3088745d3f42b3d917f94c2d9c29 100644
--- a/src/main/java/net/minecraft/CrashReport.java
+++ b/src/main/java/net/minecraft/CrashReport.java
@@ -37,7 +37,7 @@ public class CrashReport {
@@ -151,7 +151,7 @@ index f91ea723a1c85f6cf8c4f6dd7f182b948c2f2e81..c5a3f9c2daf3da135cccecb757353534
this.title = message;
this.exception = cause;
- this.systemReport.setDetail("CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit
+ this.systemReport.setDetail("Plazma Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit // Plazma - Branding
+ this.systemReport.setDetail("Plazma Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit // Plazma - Rebrand
}
public String getTitle() {
@@ -160,61 +160,69 @@ index f91ea723a1c85f6cf8c4f6dd7f182b948c2f2e81..c5a3f9c2daf3da135cccecb757353534
// Purpur start
stringbuilder.append("// ");
- stringbuilder.append("// DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!");
+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO PLAZMA INSTEAD!"); // Plazma - Branding
+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO PLAZMA INSTEAD!"); // Plazma - Rebrand
// Purpur end
stringbuilder.append("// ");
stringbuilder.append(CrashReport.getErrorComment());
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 4ef8eaad4485a2ee920f80556f9dda04e59d2b2a..b91c3b8ca8f840335ba6470658d82c5d71bb75e1 100644
index 411f1f8c6be072cfc5ba88cbec38dbc4300a41d1..2579b32009a5f5e288edf56ee8f1246cd70343fc 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -105,6 +105,18 @@ public class Main {
@@ -107,6 +107,26 @@ public class Main {
*/ // CraftBukkit end
try {
+ // Plazma start - Branding
+ // System.out.println("""
+ //
+ // \033[38;2;236;61;151m┏\033[38;2;236;61;157m━\033[38;2;237;62;163m━\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m━\033[38;2;239;63;187m┓\033[38;2;239;63;193m \033[38;2;239;64;200m┏\033[38;2;240;64;206m━\033[38;2;240;64;212m┓\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m \033[38;2;232;67;243m┏\033[38;2;227;67;244m━\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m━\033[38;2;205;69;245m┓\033[38;2;200;69;246m \033[38;2;195;69;246m┏\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┏\033[38;2;147;73;249m━\033[38;2;141;73;250m━\033[38;2;136;74;250m┓\033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m┏\033[38;2;109;76;252m━\033[38;2;104;76;252m━\033[38;2;99;77;252m┓\033[38;2;94;77;253m \033[38;2;88;77;253m┏\033[38;2;83;78;253m━\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m━\033[38;2;80;97;255m┓\033[38;2;80;103;255m\s
+ // \033[38;2;236;61;151m┃\033[38;2;236;61;157m┏\033[38;2;237;62;163m━\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m┓\033[38;2;239;63;187m┗\033[38;2;239;63;193m┓\033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┏\033[38;2;232;67;243m┛\033[38;2;227;67;244m┏\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m┓\033[38;2;205;69;245m┗\033[38;2;200;69;246m┓\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m┓\033[38;2;173;71;247m \033[38;2;168;71;248m \033[38;2;163;72;248m┏\033[38;2;157;72;249m┛\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m \033[38;2;136;74;250m┗\033[38;2;131;74;250m┓\033[38;2;125;74;251m \033[38;2;120;75;251m┏\033[38;2;115;75;251m┛\033[38;2;109;76;252m \033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┏\033[38;2;88;77;253m┛\033[38;2;83;78;253m┏\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m┓\033[38;2;80;97;255m┗\033[38;2;80;103;255m┓
+ // \033[38;2;236;61;151m┃\033[38;2;236;61;157m┗\033[38;2;237;62;163m━\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m┛\033[38;2;239;63;187m┏\033[38;2;239;63;193m┛\033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┗\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m┛\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m \033[38;2;189;70;246m \033[38;2;184;70;247m┏\033[38;2;179;70;247m┛\033[38;2;173;71;247m \033[38;2;168;71;248m┏\033[38;2;163;72;248m┛\033[38;2;157;72;249m \033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┏\033[38;2;136;74;250m┓\033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m┏\033[38;2;109;76;252m┓\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┗\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m┛\033[38;2;80;97;255m \033[38;2;80;103;255m┃
+ // \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┏\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m━\033[38;2;239;63;187m┛\033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┏\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m┓\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m \033[38;2;189;70;246m┏\033[38;2;184;70;247m┛\033[38;2;179;70;247m \033[38;2;173;71;247m┏\033[38;2;168;71;248m┛\033[38;2;163;72;248m \033[38;2;157;72;249m \033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m┗\033[38;2;131;74;250m┓\033[38;2;125;74;251m \033[38;2;120;75;251m┏\033[38;2;115;75;251m┛\033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┏\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m┓\033[38;2;80;97;255m \033[38;2;80;103;255m┃
+ // \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┃\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┗\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┓\033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┃\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┃\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m┏\033[38;2;189;70;246m┛\033[38;2;184;70;247m \033[38;2;179;70;247m \033[38;2;173;71;247m┗\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m \033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m \033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┃\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┃\033[38;2;80;97;255m \033[38;2;80;103;255m┃
+ // \033[38;2;236;61;151m┗\033[38;2;236;61;157m━\033[38;2;237;62;163m┛\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┗\033[38;2;240;64;206m━\033[38;2;240;64;212m━\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┛\033[38;2;237;66;243m┗\033[38;2;232;67;243m━\033[38;2;227;67;244m┛\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┗\033[38;2;205;69;245m━\033[38;2;200;69;246m┛\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┛\033[38;2;152;72;249m┗\033[38;2;147;73;249m━\033[38;2;141;73;250m┛\033[38;2;136;74;250m \033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m \033[38;2;109;76;252m┗\033[38;2;104;76;252m━\033[38;2;99;77;252m┛\033[38;2;94;77;253m┗\033[38;2;88;77;253m━\033[38;2;83;78;253m┛\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┗\033[38;2;80;97;255m━\033[38;2;80;103;255m┛\033[0m
+ // """);
+ System.out.println("""
+ \033[38;2;236;61;151m┏\033[38;2;236;61;157m━\033[38;2;237;62;163m━\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m━\033[38;2;239;63;187m┓\033[38;2;239;63;193m \033[38;2;239;64;200m┏\033[38;2;240;64;206m━\033[38;2;240;64;212m┓\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m \033[38;2;232;67;243m┏\033[38;2;227;67;244m━\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m━\033[38;2;205;69;245m┓\033[38;2;200;69;246m \033[38;2;195;69;246m┏\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┏\033[38;2;147;73;249m━\033[38;2;141;73;250m━\033[38;2;136;74;250m┓\033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m┏\033[38;2;109;76;252m━\033[38;2;104;76;252m━\033[38;2;99;77;252m┓\033[38;2;94;77;253m \033[38;2;88;77;253m┏\033[38;2;83;78;253m━\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m━\033[38;2;80;97;255m┓\033[38;2;80;103;255m\s
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m┏\033[38;2;237;62;163m━\033[38;2;237;62;169m━\033[38;2;238;62;175m\033[38;2;238;63;181m┓\033[38;2;239;63;187m┗\033[38;2;239;63;193m┓\033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┏\033[38;2;232;67;243m\033[38;2;227;67;244m┏\033[38;2;221;67;244m\033[38;2;216;68;244m\033[38;2;211;68;245m\033[38;2;205;69;245m┗\033[38;2;200;69;246m\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m┓\033[38;2;173;71;247m \033[38;2;168;71;248m \033[38;2;163;72;248m┏\033[38;2;157;72;249m┛\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m \033[38;2;136;74;250m┗\033[38;2;131;74;250m┓\033[38;2;125;74;251m \033[38;2;120;75;251m┏\033[38;2;115;75;251m┛\033[38;2;109;76;252m \033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┏\033[38;2;88;77;253m┛\033[38;2;83;78;253m┏\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m┓\033[38;2;80;97;255m\033[38;2;80;103;255m┓
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m┗\033[38;2;237;62;163m━\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m┛\033[38;2;239;63;187m\033[38;2;239;63;193m┛\033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┗\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m┛\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m \033[38;2;189;70;246m \033[38;2;184;70;247m┏\033[38;2;179;70;247m┛\033[38;2;173;71;247m \033[38;2;168;71;248m┏\033[38;2;163;72;248m┛\033[38;2;157;72;249m \033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┏\033[38;2;136;74;250m┓\033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m┏\033[38;2;109;76;252m┓\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m\033[38;2;78;79;254m━\033[38;2;79;85;254m\033[38;2;79;91;254m┛\033[38;2;80;97;255m \033[38;2;80;103;255m┃
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┏\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m━\033[38;2;239;63;187m\033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┏\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m┓\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m \033[38;2;189;70;246m┏\033[38;2;184;70;247m┛\033[38;2;179;70;247m \033[38;2;173;71;247m┏\033[38;2;168;71;248m┛\033[38;2;163;72;248m \033[38;2;157;72;249m \033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m┗\033[38;2;131;74;250m┓\033[38;2;125;74;251m \033[38;2;120;75;251m┏\033[38;2;115;75;251m┛\033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m\033[38;2;78;79;254m━\033[38;2;79;85;254m\033[38;2;79;91;254m┓\033[38;2;80;97;255m \033[38;2;80;103;255m┃
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┃\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┗\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┓\033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┃\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m\033[38;2;205;69;245m \033[38;2;200;69;246m\033[38;2;195;69;246m┏\033[38;2;189;70;246m┛\033[38;2;184;70;247m \033[38;2;179;70;247m \033[38;2;173;71;247m┗\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m \033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m \033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┃\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┃\033[38;2;80;97;255m \033[38;2;80;103;255m┃
+ \033[38;2;236;61;151m┗\033[38;2;236;61;157m━\033[38;2;237;62;163m┛\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┗\033[38;2;240;64;206m━\033[38;2;240;64;212m━\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┛\033[38;2;237;66;243m┗\033[38;2;232;67;243m━\033[38;2;227;67;244m┛\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┗\033[38;2;205;69;245m━\033[38;2;200;69;246m┛\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┛\033[38;2;152;72;249m┗\033[38;2;147;73;249m━\033[38;2;141;73;250m┛\033[38;2;136;74;250m \033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m \033[38;2;109;76;252m┗\033[38;2;104;76;252m━\033[38;2;99;77;252m┛\033[38;2;94;77;253m┗\033[38;2;88;77;253m━\033[38;2;83;78;253m\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┗\033[38;2;80;97;255m\033[38;2;80;103;255m┛\033[0m
+ """);
+ if (!org.plazmamc.plazma.Options.iKnowWhatIAmDoing)
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
+
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m╗\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m╗\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m \033[38;2;161;46;144m\033[38;2;158;47;145m\033[38;2;155;49;146m█\033[38;2;151;50;146m\033[38;2;148;52;147m█\033[38;2;145;53;148m╗\033[38;2;142;54;148m \033[38;2;139;56;149m█\033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m█\033[38;2;116;65;153m╗ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m╗\033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m╗ \033[38;2;78;81;161m \033[38;2;75;83;162m█\033[38;2;72;84;163m█\033[38;2;69;86;163m█\033[38;2;66;87;164m█\033[38;2;62;88;165m\033[38;2;59;90;165m╗\033[38;2;56;91;166m\s
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m╔\033[38;2;205;27;135m═\033[38;2;202;28;136m═\033[38;2;199;30;136m█\033[38;2;196;31;137m\033[38;2;193;33;138m╗ \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m╔\033[38;2;155;49;146m═\033[38;2;151;50;146m═\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m╗ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m╔\033[38;2;116;65;153m╝ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m█\033[38;2;101;72;157m╗\033[38;2;97;73;157m \033[38;2;94;75;158m█\033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m\033[38;2;69;86;163m═\033[38;2;66;87;164m\033[38;2;62;88;165m█\033[38;2;59;90;165m\033[38;2;56;91;166m╗
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m█\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m\033[38;2;193;33;138m╝ \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m█\033[38;2;155;49;146m█\033[38;2;151;50;146m█\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m \033[38;2;135;57;149m \033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m╔\033[38;2;120;64;153m╝\033[38;2;116;65;153m \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m╔\033[38;2;104;71;156m█\033[38;2;101;72;157m█\033[38;2;97;73;157m█\033[38;2;94;75;158m█\033[38;2;91;76;159m╔\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m\033[38;2;69;86;163m█\033[38;2;66;87;164m\033[38;2;62;88;165m█\033[38;2;59;90;165m\033[38;2;56;91;166m║
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m╔\033[38;2;205;27;135m\033[38;2;202;28;136m═\033[38;2;199;30;136m═\033[38;2;196;31;137m╝\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m\033[38;2;161;46;144m\033[38;2;158;47;145m\033[38;2;155;49;146m═\033[38;2;151;50;146m\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m \033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m╔\033[38;2;123;62;152m╝\033[38;2;120;64;153m \033[38;2;116;65;153m \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m║\033[38;2;104;71;156m╚\033[38;2;101;72;157m█\033[38;2;97;73;157m█\033[38;2;94;75;158m╔\033[38;2;91;76;159m╝\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m╔\033[38;2;69;86;163m═\033[38;2;66;87;164m═\033[38;2;62;88;165m\033[38;2;59;90;165m█\033[38;2;56;91;166m║
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m║\033[38;2;205;27;135m \033[38;2;202;28;136m \033[38;2;199;30;136m \033[38;2;196;31;137m \033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m█\033[38;2;180;38;140m█\033[38;2;177;39;141m█\033[38;2;174;41;142m█\033[38;2;170;42;142m█\033[38;2;167;43;143m╗ \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m║\033[38;2;155;49;146m \033[38;2;151;50;146m \033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m█\033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m█\033[38;2;116;65;153m╗ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m║\033[38;2;104;71;156m \033[38;2;101;72;157m╚\033[38;2;97;73;157m═\033[38;2;94;75;158m╝\033[38;2;91;76;159m \033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m\033[38;2;69;86;163m \033[38;2;66;87;164m \033[38;2;62;88;165m█\033[38;2;59;90;165m\033[38;2;56;91;166m║
+ \033[38;2;215;23;133m╚\033[38;2;212;24;134m═\033[38;2;209;26;134m╝\033[38;2;205;27;135m \033[38;2;202;28;136m \033[38;2;199;30;136m \033[38;2;196;31;137m \033[38;2;193;33;138m \033[38;2;190;34;138m╚\033[38;2;186;35;139m═\033[38;2;183;37;140m═\033[38;2;180;38;140m═\033[38;2;177;39;141m═\033[38;2;174;41;142m═\033[38;2;170;42;142m═\033[38;2;167;43;143m╝ \033[38;2;164;45;144m╚\033[38;2;161;46;144m═\033[38;2;158;47;145m╝\033[38;2;155;49;146m \033[38;2;151;50;146m \033[38;2;148;52;147m╚\033[38;2;145;53;148m═\033[38;2;142;54;148m╝ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m═\033[38;2;126;61;151m═\033[38;2;123;62;152m═\033[38;2;120;64;153m═\033[38;2;116;65;153m╝ \033[38;2;113;67;154m╚\033[38;2;110;68;155m═\033[38;2;107;69;155m╝\033[38;2;104;71;156m \033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m \033[38;2;88;77;159m╚\033[38;2;85;79;160m═\033[38;2;81;80;161m╝ \033[38;2;78;81;161m╚\033[38;2;75;83;162m═\033[38;2;72;84;163m╝\033[38;2;69;86;163m \033[38;2;66;87;164m \033[38;2;62;88;165m╚\033[38;2;59;90;165m═\033[38;2;56;91;166m╝\033[0m
+ """);
+ // Plazma end
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 60b5e0643d933393b5473681ac9261db29fe2416..ac12ccf60b45b150982e79f32d3cdd21c4017cc8 100644
index dfeae138e830e95ab823b6349a91160b02622208..e121cc57ec5bf6f5b1d81e2fd4f551063ac60d64 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -956,7 +956,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -963,7 +963,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper
if (!isSameThread()) {
- MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PURPUR)"); // Purpur
+ MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PLAZMA)"); // Purpur // Plazma - Branding
+ MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PLAZMA)"); // Purpur // Plazma - Rebrand
while (this.getRunningThread().isAlive()) {
this.getRunningThread().stop();
try {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index ae75edfaa9e4c72f11fbb7ffc66294be47c206cc..a66dcea06424518290576c7647ae0717040586f9 100644
index 842f382de43df5d5c321422372ec30ccdd7859d7..5b7ed096999dbb7e95fb7d615e737f19604f58ff 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -57,7 +57,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -56,7 +56,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
public final boolean onlineMode = this.get("online-mode", true);
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
public final String serverIp = this.get("server-ip", "");
- public final String serverName = this.get("server-name", "Unknown Server"); // Purpur
+ public final String serverName = this.get("server-name", "A Plazma Server"); // Purpur // Plazma - Branding
+ public final String serverName = this.get("server-name", "A Plazma Server"); // Purpur // Plazma - Rebrand
public final boolean spawnAnimals = this.get("spawn-animals", true);
public final boolean spawnNpcs = this.get("spawn-npcs", true);
public final boolean pvp = this.get("pvp", true);
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
index 0dec2f3762aa55cfaa7af5b357f0fe243a3b2cc6..22d32ee08ee9419685a3e17d6e443396cff895e0 100644
index 8f74c2ec5252b6265549589310d742337c91cb2c..e34c3d00887240cc0f78f6b95da4116a22438626 100644
--- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
+++ b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
@@ -56,7 +56,7 @@ public class MinecraftServerGui extends JComponent {
@@ -222,7 +230,7 @@ index 0dec2f3762aa55cfaa7af5b357f0fe243a3b2cc6..22d32ee08ee9419685a3e17d6e443396
}
- final JFrame jframe = new JFrame("Purpur Minecraft server"); // Purpur
+ final JFrame jframe = new JFrame("Plazma Minecraft server"); // Purpur // Plazma - Branding
+ final JFrame jframe = new JFrame("Plazma Minecraft server"); // Purpur // Plazma - Rebrand
final MinecraftServerGui servergui = new MinecraftServerGui(server);
jframe.setDefaultCloseOperation(2);
@@ -231,7 +239,7 @@ index 0dec2f3762aa55cfaa7af5b357f0fe243a3b2cc6..22d32ee08ee9419685a3e17d6e443396
jframe.setLocationRelativeTo((Component) null);
jframe.setVisible(true);
- jframe.setName("Purpur Minecraft server"); // Paper - Improve ServerGUI // Purpur
+ jframe.setName("Plazma Minecraft server"); // Paper - Improve ServerGUI // Purpur // Plazma - Branding
+ jframe.setName("Plazma Minecraft server"); // Paper - Improve ServerGUI // Purpur // Plazma - Rebrand
// Paper start - Improve ServerGUI
try {
@@ -240,73 +248,60 @@ index 0dec2f3762aa55cfaa7af5b357f0fe243a3b2cc6..22d32ee08ee9419685a3e17d6e443396
public void windowClosing(WindowEvent windowevent) {
if (!servergui.isClosing.getAndSet(true)) {
- jframe.setTitle("Purpur Minecraft server - shutting down!"); // Purpur
+ jframe.setTitle("Plazma Minecraft server - shutting down!"); // Purpur // Plazma - Branding
+ jframe.setTitle("Plazma Minecraft server - shutting down!"); // Purpur // Plazma - Rebrand
server.halt(true);
servergui.runFinalizers();
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index fe312b1aef579cb4bf81bdd967cf72ff880d7505..97628761958289612ada0374f56e7d8f6af21512 100644
index f6e3b745fc417354380d4a969f83aee430bad785..ce0686759f0c32e9ffcb26f99503215a49873b91 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -153,7 +153,7 @@ public class RegionFileStorage implements AutoCloseable {
@@ -155,7 +155,7 @@ public class RegionFileStorage implements AutoCloseable {
// Paper start
private static void printOversizedLog(String msg, Path file, int x, int z) {
- org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.");
+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PLAZMA - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Plazma - Branding
+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PLAZMA - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Plazma - Rebrand
}
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index dabaf0cff6dafe8ca411996e67ead9a2cf84dfb8..b2470f03eecb1b81d3f0acbd9bc3c38f321ef3d9 100644
index 8d754bf77cb88d8ddf964f3221183e4097f06d13..dca6cce8768c8c08e4abba249c30731dbdec7763 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 {
- private final String serverName = "Purpur"; // Paper // Pufferfish // Purpur
+ private final String serverName = "Plazma"; // Paper // Pufferfish // Purpur // Plazma - Branding
+ private final String serverName = "Plazma"; // Paper // Pufferfish // Purpur // Plazma - Rebrand
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 409c0e81571e23c9d535b541c61538424259d60a..d36c880012153058803b595429084adb36458741 100644
index 222865a3cee62f244a566092a7d814efe478ee01..333c8a313208652700c21fc2ac629296b5b02078 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -141,7 +141,7 @@ public class Main {
@@ -142,7 +142,7 @@ public class Main {
this.acceptsAll(Main.asList("noconsole"), "Disables the console");
- this.acceptsAll(Main.asList("v", "version"), "Show the CraftBukkit Version");
+ this.acceptsAll(Main.asList("v", "version"), "Show the Plazma Version"); // Plazma - Branding
+ this.acceptsAll(Main.asList("v", "version"), "Show the Plazma Version"); // Plazma - Rebrand
this.acceptsAll(Main.asList("demo"), "Demo mode");
@@ -192,7 +192,7 @@ public class Main {
@@ -187,7 +187,7 @@ public class Main {
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()
.ofType(String.class)
- .defaultsTo("Unknown Server")
+ .defaultsTo("Plazma Server") // Plazma - Branding
+ .defaultsTo("A Plazma Server") // Plazma - Rebrand
.describedAs("Name");
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 64c73cc7370c23c9ce68b68476fd0ddb3ca6beca..cd0e9020e28ff97063bd335dcdbb32ac3225ffb3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -969,7 +969,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return EntityCategory.WATER;
}
- throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Purpur."); // Purpur
+ throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Plazma."); // Purpur // Plazma - Branding
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index ca8ae8e1c51b937dac916e0b0dc94b5e2e61efeb..6bab5f9e40987d1a8ca9c17118d2a14135df5dff 100644
index ca8ae8e1c51b937dac916e0b0dc94b5e2e61efeb..2058af0975e510b3f86d7dbb1811062b9b0dc342 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -503,7 +503,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -314,12 +309,12 @@ index ca8ae8e1c51b937dac916e0b0dc94b5e2e61efeb..6bab5f9e40987d1a8ca9c17118d2a141
} else {
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
- task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Purpur"); // Paper // Purpur
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Plazma"); // Paper // Purpur // Plazma - Branding
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Plazma"); // Paper // Purpur // Plazma - Rebrand
// We don't need to parse pending
// (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/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..73b4818998098b08abcbee4d29915492aa09b5ef 100644
index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0aa8dfa94368fb119644760e3686a7c01f510456 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -8,22 +8,25 @@ import java.util.logging.Logger;
@@ -330,7 +325,7 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..73b4818998098b08abcbee4d29915492
- String result = "Unknown-Version";
-
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur
+ // Plazma start - Branding & Improve Versioning
+ // Plazma start - Rebrand & Improve Versioning
+ public static String version = "Unknown-Version";
+ static {
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.plazmamc.plazma/plazma-api/pom.properties");
@@ -353,23 +348,10 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..73b4818998098b08abcbee4d29915492
+ public static String getBukkitVersion() {
+ return version;
}
+ // Plazma end - Branding & Improve Versioning
+ // Plazma end - Rebrand & Improve Versioning
}
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
new file mode 100644
index 0000000000000000000000000000000000000000..a858b7ddef7f6877c0b92f4150e0dd37bea121aa
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -0,0 +1,7 @@
+package org.plazmamc.plazma;
+
+public interface Options {
+
+ boolean iKnowWhatIAmDoing = Boolean.getBoolean("Plazma.iKnowWhatIAmDoing");
+
+}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index efe25d3894f3ad000257c72d9a5e06ef22446d41..a937993f318ef5703420f57fe65c5d990ce2c4dd 100644
index 046304d9149472eaffb3ff5f4fa22a230969de86..79456fab220fc797f0f28fc9657f3a406d751900 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -231,7 +231,7 @@ public class PurpurConfig {
@@ -377,12 +359,12 @@ index efe25d3894f3ad000257c72d9a5e06ef22446d41..a937993f318ef5703420f57fe65c5d99
}
- public static String serverModName = "Purpur";
+ public static String serverModName = "Plazma"; // Plazma - Branding
+ public static String serverModName = "Plazma"; // Plazma - Rebrand
private static void serverModName() {
serverModName = getString("settings.server-mod-name", serverModName);
}
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index f7296691cb4af7814de1520347b307ff209082e4..090eb94fe8088d0ae98bfbe8bbd32a3cac2015d0 100644
index a353eb9f45af7b7f9bfd92a4a89403335b841840..29a4709c1085d133bd7753ac9744f6c9701ac345 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
@@ -390,16 +372,16 @@ index f7296691cb4af7814de1520347b307ff209082e4..090eb94fe8088d0ae98bfbe8bbd32a3c
// Paper end
log.log( Level.SEVERE, "------------------------------" );
- log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Purpur bug." ); // Paper // Purpur
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Plazma bug." ); // Paper // Purpur // Plazma - Branding
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Plazma bug." ); // Paper // Purpur // Plazma - Rebrand
log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" );
log.log( Level.SEVERE, "\t *Especially* if it looks like HTTP or MySQL operations are occurring" );
log.log( Level.SEVERE, "If you see a world save or edit, then it means you did far more than your server can handle at once" );
log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" );
- log.log( Level.SEVERE, "If you are unsure or still think this is a Purpur bug, please report this to https://github.com/PurpurMC/Purpur/issues" ); // Purpur
+ log.log( Level.SEVERE, "If you are unsure or still think this is a Plazma bug, please report this to https://github.com/PlazmaMC/Plazma/issues" ); // Purpur // Plazma - Branding
+ log.log( Level.SEVERE, "If you are unsure or still think this is a Plazma bug, please report this to https://github.com/PlazmaMC/PlazmaBukkit/issues" ); // Purpur // Plazma - Rebrand
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
- log.log( Level.SEVERE, "Purpur version: " + Bukkit.getServer().getVersion() ); // Purpur
+ log.log( Level.SEVERE, "Plazma version: " + Bukkit.getServer().getVersion() ); // Purpur // Plazma - Branding
+ log.log( Level.SEVERE, "Plazma version: " + Bukkit.getServer().getVersion() ); // Purpur // Plazma - Rebrand
//
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
{
@@ -408,13 +390,13 @@ index f7296691cb4af7814de1520347b307ff209082e4..090eb94fe8088d0ae98bfbe8bbd32a3c
} else
{
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PLAZMA - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // Plazma - Branding
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PLAZMA - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // Plazma - Rebrand
log.log(Level.SEVERE, "The server has not responded for " + (currentTime - lastTick) / 1000 + " seconds! Creating thread dump");
}
// Paper end - Different message for short timeout
log.log( Level.SEVERE, "------------------------------" );
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Purpur!):" ); // Paper // Purpur
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Plazma!):" ); // Paper // Purpur // Plazma - Branding
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Plazma!):" ); // Paper // Purpur // Plazma - Rebrand
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
this.dumpTickingInfo(); // Paper - log detailed tick information
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
@@ -423,7 +405,7 @@ index f7296691cb4af7814de1520347b307ff209082e4..090eb94fe8088d0ae98bfbe8bbd32a3c
}
} else {
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PLAZMA - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // Plazma - Branding
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PLAZMA - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // Plazma - Rebrand
}
log.log( Level.SEVERE, "------------------------------" );

View File

@@ -1,87 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 14 Jan 2024 19:51:19 +0900
Subject: [PATCH] Use Gradle Version Catalogs
diff --git a/build.gradle.kts b/build.gradle.kts
index 1cad0728d..b97182b80 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -19,21 +19,38 @@ dependencies {
exclude("io.papermc.paper", "paper-api")
}
// Purpur end
+ // Plazma start - Use Gradle version catalogs
+ /*
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
implementation("net.kyori:adventure-text-serializer-ansi:4.14.0") // Keep in sync with adventureVersion from Paper-API build file
implementation("net.kyori:ansi:1.0.3") // Manually bump beyond above transitive dep
- /*
- Required to add the missing Log4j2Plugins.dat file from log4j-core
- which has been removed by Mojang. Without it, log4j has to classload
- all its classes to check if they are plugins.
- Scanning takes about 1-2 seconds so adding this speeds up the server start.
- */
implementation("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - implementation
log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins
+ */
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j.core)
+
+ implementation(common.log4j.core)
+ implementation(common.log4j.iostreams)
+ implementation(common.snakeyaml)
+ implementation(common.bundles.asm)
+ implementation(common.commons.lang2)
+ implementation(common.adventure.serializer.ansi)
+ implementation(server.ansi)
+ implementation(server.bundles.implementation)
+
+ runtimeOnly(common.bundles.maven)
+ runtimeOnly(common.maven.provider)
+ runtimeOnly(server.bundles.runtime)
runtimeOnly(log4jPlugins.output)
+
alsoShade(log4jPlugins.output)
+
+ testImplementation(common.bundles.test)
+ testImplementation(server.bundles.test)
+
+ /*
implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
// Paper end
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
@@ -46,8 +63,11 @@ dependencies {
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
// Paper start - Use Velocity cipher
implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
+ */
+ implementation(server.velocity) {
isTransitive = false
}
+ /*
// Paper end - Use Velocity cipher
runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
@@ -57,8 +77,11 @@ dependencies {
// Pufferfish start
implementation("org.yaml:snakeyaml:1.32")
implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") {
+ */
+ implementation(server.simpleyaml) {
exclude(group="org.yaml", module="snakeyaml")
}
+ /*
// Pufferfish end
implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
@@ -71,6 +94,7 @@ dependencies {
testImplementation("org.mockito:mockito-core:5.11.0")
testImplementation("org.ow2.asm:asm-tree:9.7")
testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
+ */
}
val craftbukkitPackageVersion = "1_20_R3" // Paper

View File

@@ -5,151 +5,137 @@ Subject: [PATCH] Rebrand Logo
diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png
index 518591dd83289e041a16e2c2e7d7e7640d4b2e1b..278de5d47a7802ab89d9ae39c1560ef87d6d6fc4 100644
index 518591dd83289e041a16e2c2e7d7e7640d4b2e1b..efa53bcb692650396b2e71b62243a15dd95aa096 100644
GIT binary patch
literal 7999
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
E0k}Z_!T<mO
literal 7439
zcmbVR2{@GP-XHrOqAXd4vQ@*(FwBg7H)RWzq?$1cV;jsEgUC>Xv{*uxlATr*5!qAr
zB|8nGvP&US-{|e_yytx9J>R*$xvpoPd+z6V|Nh(Wf8W=0O|-4Gxd5*uF8}}#Kv|gB
zG4BRD7dI#KyNKvJ&b;yXSezmQ0IK_UE*4s@J{17q0uvn^DUMc_NG!=q6@w$W;8kf}
zK1?(KprcRo!C*b`6rc;<mFTT2zf|=?9!SLL%AbT;fvtRu@oq$mAV0i)khKFg$ODVO
z$?NL@b!bQ?fft^F0n)rYy~#+LuKZ74By+qottJor388rC${X$&1Ug#T0*y(2c%YUl
z1cU{H!9Xp9suo5I169{N41|KA5H&Dd4FUy$!AK|!2?YaxedL+u{BQ)Mor&2mW6WQ=
z@@^E04^mAnARs_BKwXvO=c)!lAP{O`s2UUsVj@7~KyM0$2J$BF|C7N4PsaKYeJDhd
zH*kj$<3jSM=*lx){UZi1pWn3J<X?GWW=xHS@lk`Qf_Gy23B+N4<9z)6JbxO;Vb$=S
zcrUy+h0Mf4eq(*yNE8y;jr2FvzaRgT0cLKktbW`0x4w9J{Wd|Sm{OTx{7T5bMUx!@
zeeh~_crwY~4~sXYGTq$26O9kj*bk4Pko+7-B+ox9W&5YgKx1QOVIT;g@=2mMjub#v
z`O6x-35J5#m1h=C9RyYfLBI}B2oeTG!XSsh2qYN%2h@s$BN76CLp64w>X4sM7!v%?
zP^N5f7z*b91mmzs0?E${!;G2eg>l8J`FOj^1Ak`{X-x7Y`7sSMy;J||Jj&SE){jIW
zdNLo7?aYmUC{tri2trd61XYFnbl1uXiSi~>Fy2@^%0yS5nIBam5r-te@EULzm^uiD
z)o=m15Ht`Vj0P3~f@&hba6AN}1xL92x!#0?_1{s!&iX$(0!P9!IsV}uoZzBKAmCsi
zu#2V!$OWf?1;I7JFc1Q(fxzMjFinU$^iMV$KO(a!F`j>A-SG;?WYogAz;Sq{FX}D?
z9LPnBIYJN!%wpi-aGW|A4@GETc9j29Oh^kNnOWw*U%h0H_x&~UBm#fx2Z_P%^o6cG
zc1I9+ocyn8;=jqqe`WdC`T#dPlk`8R<PYm)5`hwc@xvRsGIRIe2vO~C{U>=-@qT}a
zzz5@pVQxuyKeDbo!H?tx#Q6Al60w+_aMh^ZxL=L_yFfq+3HT3P{jD7`hWekg1i>I&
z)FChk2#--$2N7H}Fdz&ZiUGkPV5}xo6OPfuFje<Q`2RagP-b@^HPrv?rT=G^e$ivy
zFy5|s=AN!5|NoEYzw3g3iRbSc{=bR`3RQ*ub?^CO(Z2+vwzHG}p=Y&!mHN+Tf7$h!
zn)x}!JW6(kzYj6ykKe~2-kX^xKjtC#9(rUF0N8U0Wn$<+OP@{)tT=N#b>_lbr!D?~
z7HL0qL&9#b0Z$e;dynQ_JpDd2(e|>_U4@+VM+OUdl^`LLJD}Kn&mxZEq{Vvo!={FD
z;Xsf&Z%lzL5069`d&_w;nN%@_2(I3KIlPrlj=CPk^P?{)b9=tJ^HJyK_?P=j!7l>t
zW8*j0N8=x>jfM^naElj8)EUl}cmQG9?q=Zqu#&m?^cS~7%H3^Y+>J{P?G|+2r)BQn
zTt$){Fsq77g|!Y`=eWE9GKdsTed^qn`B+uNS1i_PpHFqx%WC+5;WeeJ1}xM-I2SF2
zyZ)V4kv&Ni&??Zcz2VFX@0+TVx=v^CK7!4)onxD$+tdh4YqtOfiM1lTY9?|ERksWU
zJNECscx|1w%u$QwM$-4u-?A(rQ*?D40aBdbic$LHM~x^rP+v>jDxT$r0kzQs1Bj(p
zg)Om}OI^7tV+&x%Gh!n%zf5jtR(4wtxxHT>>UN{;IwDu46b|rFeZ*O@%T4!sh~9O8
zGx||SmKyB_{GwR4S!f?Z`+0%%*AMT3G!x@^O~wo1sfJ5jMZH|CVF^|`=w*-+0a5GT
zY{PFfCF=G$QtIO7XJFc{>|qLn;8LkGEx7PambLb9tn}C12>UbHb;H`+oQ@G(@W}~s
z!#b-`1Epo;bXZgviDmWNL*a*FVV&jy@9Rff+|UGgFjt+qpj!aLJzKRcx)5tv@G@$H
zKaPuq!HNd?D2Uvl)B;*YmpvoiL_YApJ8v|${1|wJHD{MmQ-iwoCOyH-64HgR&>fv=
zJb2BlImpQD=GqJoj&vr8#do|8z@RbCM#v(G-EI*|oLN+XkVtRpq?9q4o*jLU)X0M8
zV9jCa5c?(!9>~%^%DBC|yO-N2UU&6)QSzl)uiEX}9yS&Ou}N8h?dH1Mnw-#9bEijQ
zHndk+N3GhpZeqUy23dXid++6a;8)4uO%y#dj`rZyKQbZ0xhk?!$nMpaZzPu{x#dP;
zli~UvEv|7+3?Rlfm+_e>=5oXj$8wmh&W6DQ;hsIT*L;c-Eq0xS;MlOtVL;G8mB}GR
zKXB7EqvK7&#$%=wmG%Zv7CxjrI=6srEc=>T9fFnz=d<cViK%>%Qb6Hwj5X~Fkls{^
zfs3>Nbj8{_Uee_AArP6yBVdnGI!CQe!~-Gv;2v}~I)pXtxrqeiVzz!Q@PvTRGxN7x
zTf2M?7$~s$%HH3z!Np*!9ja}8$Qu^jnn9F!mR09c(eYp!+6xuB&MkZ~>SDD$n7tco
zcS@#|@N(A&&jxD^A8R8*#XREmBAbpd!<?nY{(9z8qH@~f5vl#l4&meJ=m540w<4~)
zJPxOQdCFeFUy-xY<eT{}N1~rGtcZ~to^T(SN*SxJEew}yb<AK9@8$m<6)g~1Gv9=g
zL8zJaPIBIwpJ3-2Ksw4Ynh#1jnOO?Z3DLq9hWQH1Q{6+D7sD0MU@3s&=6;lf`U~T|
z@7xDqVWICQJ|Ez_h{^-=bZ9;9uT$8y$9=`<l+G&y@m8UIDR+-{DG8iDS*Pb&D;ka3
zowUK{s<7;cr4C-xgs)xlWgtxJg$p{D3@C3t%=V3rTQ=;{hN0N@h~*obop?Z<<oz^w
zJ>T2(;*I-FWs*a!jqjzyhi+KJej;8n&9}ByFF9>DrOY7ZDfe@26GXd4L_D>@JfA);
z4-a;kKmdMIh3!j7?h?4PrO<pQFK@_kSAIoRo30<dC^2(m1I2WHOSP1tcDZTuhLEJ=
z#3o2e9)G0hSNWPDH}_R@MIP7iGq@h3HYk?8q}48)ucF{kte7#_!N4_4*KtnYHbek8
z|Ay^Os0@dZ5PbjT+X_8nfQSyvW6p}hDXJY%R+x~^KyJfC(Rb-LF=>fi&kB;>br}ql
zQIRnUo0Y+|uU`-D>)&-h6t8?Q6ZvF0Dd$6tLDzACOh5^r{ZuadgIRvMbcfuEt;;6M
zVDP?32pi^Y_!2w7pvCUwV62j(P{%y08ss`0oGnf{ANGQcO=Pd3IF;kV+Tz0YdQPEh
ze^q|ZnruwlDV?~wyalOojf}6BZ2k4NhdQ@w>bC>DrsyxX5=G}@6SQNl36-&y_H)`)
zKw+V0ugiGx(a(}oHVU+=PiD_Z#uWzqV7YAa(j92|jtBj=T<B>&!674Ch_zPw$=6t6
z%LCE+#P_k)FG!jF&6AzduX4(f)RUD%t9DPYy$MbDk+J28eIo(tg^o@a=F{ILM`iSl
zk_YcXV=t7%{s<Xq^&Hal`H>Y>mTm#N*Vs1Qe7tEvrOoZ8c+4#Mp;$S3v&HfK!^Qok
zi!e@&a4=ozeA9lj=dCePA@G!TuXmg`H^}SHyH>Y4QoYi*+SiYz_P5*54OqY3;9JkF
z1HD;wI;uXbwfJEwV0#4hT46Cmr!Qc%{>IXa1@0=BS0ks(+w@nwoI~10JVS{Cv&ODZ
zGYny)m)=}S%XGQ@$p;&2A{!YsXLa60^9YLdb5SOkMX;r)B7Nz-%Hz<`R~*}B24H3O
ziAMkIJ{i}56O~+xZtkjn{Q^t)=CTw0y44Gxr4R9XxURK3h0aa}E|9z*_8_{9w_0Rk
z*mONd21lrKHe0ICXP(wQIh`qWK42hi#;3_Yzq`-j4r#s1rh27%m;{hHBXAc*H=5r(
zC^#1nIgZO|Zyv9oq{#@03c^HnQ&)z*Mxk2rF7b<%_2n3^c1kdMmZRO*flBA7yyW**
z6CdN|uFX{ke8|MQ%JxtvPv_eOQbmeo&folAV;HZ|bh4=I)FqW^xy;eQk)Q?LhJZD_
z)t-2jQl-_E>DZ5BurQ7@qb(xN2Vf+duy~`HC!3ghlUz!NNOJ^uoDDsH`5MOrDqoxc
zJ^udrvD;C>2emoR-3qPO$g6hc?Oc0UJ|;-2np=LLNst+P)f{}HWM<-t!(l!3`#BEg
zMOUsk_$DPjuwxWvY=2u_@83=wtNPXxAp6SqD50b{7#)?cC~lg`kP=Kx+H-oc+*|GL
z5jp#ewFMSC4NVi0xM28+>CTnz4^45sja*}rXA2)O&a9?droJxKm0cJtG$y3$#AYU`
zm458@zi1R*%y}M`d!3V)SbI>Vh|?(|Wq2~s$E&mN&5O~J^qiIw5duUfev+Y$bzAkt
zHJb`2U1&`u>@r%o6|J&L6SN>w){jAIO=g?;0v+O<&yw7)NJu_-;GXG3sOym^13KN7
z{f;iYkTM}wHS~Rhvj<>mS`KnOeomrkPRPxOa=;e0@~%i)*0NmCXCvJ@kCMofM0q1V
z{JiDB?Y<`$<77CS!@EB4U`Lo$Epc924dzx%*D@GmAMui?f_1B;EJDX4jurBI*w6Lt
zmVQMYEG;dF3;s^S*~_N&d)~bO&wcjH!jwfRibIZLSv6k}*o`v_uInCCr#UZeW>`Il
z-$i|z^kHFNs2s{!p8z`5{86+GOdEPBne+CFG@9&Drris~K@t{30Ii}j;CH4#vu>eR
zoxr?<L&|{r;RhV|5+l}Zt+rzDHa$85m0XqePeBXBw}3Zv3@^yEfb*~b<V>ZIc8VRF
z9L$ZEzNTnHo^+DAfNn_CxF}|2yX@W4;GJ{RNkyRjbxr1wPU1f6h>6`faqey7EG-vb
zw~3@*yBonLl+N4ICiOZKhLiB+Ux~W)yxdQm_u&<t0h`?iL;Ce~S`IZ><=$=JmFWqy
zqvtZD{EktMap#ODq(GX`?j9mu_nT&)Hz2oIC(AtoT!^!0CU2Fp#%T2OCIOzz?zUh*
zRT~S;*?TFSXZ|*j6Ia)nn9=*~tmB<ljwjE`^5&LGXlNEG_k*IIGd^#@5!$u>mP=|W
z!Od&@$0%mP%7NyP%SH;hmz9%u--^kc3D0lZw{Us?j5T5Lu7u^mE!VvnIu8SepR1a2
znklEWe=1Pd>OZ<|J$&n-+JS-(-HGX~8qIVa?Rk+fUkM;?J<M1EeN$wkz%<wTUO?7O
zVGG{S?%IAm>e9+1AH8-y!oB6Hvsrz1IR}`wS(GIc(|9$KcHe5{x!-O&oEB^8p;CfI
zrPnVgl-K)fmVSKZy;-@XqTqcjJClLVh{~#v<d7i*xpjV_n+f@aVBZ4RF}x7AcNdkp
zlV|Glu6~kZ7`L1ZJaP3%f=^xo?R&QXpe#LbK5n`n`ZPo^H$LA%Ad&Z~pGS0F9;+4J
z=BPb=CO-QV{p-t4xr?>6m7wPzL44nDG_LkN)QY#DO`U-$ARnmTvot#UJR&N4uDJ8-
zL5JtoP@y$l4!?s^k_O!VLe30FkpqRFL<3#3?QlID_j{FKUYkSeo}q5K(+!nW|1+PS
zzIX)F_Nn4jRy2F|f#?nD9(B0$EXCGHv{)rdMm=FIHN!I$Ef6KEwWX#c8`9DNyH;I$
z>l`VkxLCor=hLx6Ry|`fa;<L^LEeKAw%CY8m=%4LVJ76jRmbWo-;m#pMqff1BmAlI
zDBkb4au{FVya}+E5YL+XHud5R^1`dP!=>65)cLH!(&#*t>1zd>R}!EFJmGMr@zG$B
z(?8xG$?IHr{;6PHI-qqqQ~1Q_GSF20NOV=bp}lIc#1WB=Okwroa()r(S00GXW?r|6
z3JEqSkcgL%HG6C*_L*S(^1vH|_{aiU^h3?P#yOjwt#S+I^MN&KQ9m}RMZuB8(>3#z
zd7a;1N#r6DZmSCL+mGrR_!bzQq7&E#Mr?lEYCoh+u+iHpP`_3!Sr_nQ?dAM%UwdNV
zeKPk1-_Y~UCrxR*yl)a66BQ=8l|a(QNgkODMd;1y+&ZDuI7I7ZTYy+JUxzKjDB+Bq
zBu~z`kIyCCZ9cnh99+o=7IG(~u8-ri%ov!`x%DG8Tg}OAU?_HJUf+8yBjUx-#@f52
zEc++HXgLm2|B17=gMKi|vI*k@kg5c);_^?ehn6OrlG0KU0VRAyT31sC%<anNKD7dP
z@`75Ic@Jl5^@&@qRwfA2TR;w46&oSJ4Ul6`CtFma1_y+W$zS`Z`Q*;EN_6?;q#y#W
zq5Q4LpZZ=q==Re1%DXT6uH&=!EfE;iX@%8AHEP-Di>>v2zT#(IcHnSZGHae6rwjMk
zl+MzhJnzvm8A$KAs`24$-TCBK9unNLtKbx|XQ%cAl_uY^D?O^jTBrWlL{o0hi3i`<
zjk#SpuU3VBHhq=ZvcUmWc4)G2fp0uTxgv&c4>;u9!G=FB@h7}A-M?+De`<R{Ddlqu
z=kQ+3EdLWqA8k3>2A^TLLe#!I!cM7HYOTjx9_;mX+tMyBtRXhvb54D&(Of098EMRq
zw1MpR-ZO<@FkhOI(bU|84#{G$O%Asu0Kl6Hp1rH26WcqDE`RToFDMUZQ;#pYe#Z`+
z4(|+?3Fx@V355+3oeJ{wRW*_qm)n~j3a$%`t$$L}G@%YT7%4_Z6|uV>NH}77Yn<wC
zAS-CNRQzVyKW;^(ZG1{$GsCqD;r#UKhp-zJ5~~4?_;01@6am78#0VipN5@Pz-ZE{j
zJG%7`)O(ZdV@*a*Ub4K{$U*_g-taY+i_>#N@hjat)ip+-N~%&vB`)3}x54wf92}?9
z_^$Ev=eiX0D}bgY>K=pP+A7LY>OqaAm5ra#wc|vC7Xkcz9`vJZ--@Fa@X;|6`whbO
za2`tke5y^=e75l(_5z>)xComHM|&nn)EsOB!V455(TGVT->vX+5wM=)Ju{y}(Hu(F
z0X--8%-dPEOh4d;UTuaWE4VGagcXa9rkEP~_etHX$-EU3&&@}7<|rZMHJhqXlNhVv
zY4L}>PC6$x(=UKO?j@~(5+a)ezrg`rFT;AL2WN_G#d!~;`a-oiXpI~p4JiBbfaF=W
z+9y!u6DE&~bo9<QcU|zCMDcxbPQNePw=Rl%`2Mupy)}smhKf=K%Xzyeon{L_;bd*f
zF~y)VZQuRNG~NrWH^fAbkJvuugEuG+h9LD|k|BUsmzDXW#3|BIJm1xNj8&KS^2Kl}
z_X^sF$W-XTEsE|s2n04)a+NhQoMp@EQ4Om0>F%OcW~Y+g$QIE)T8k{1I~}e_kfc4~
zU2=-5aTvL3?;3SfcN4LErcU^)6Mk_f{QKjXt70g2y*O!05s##mQ>-W9_AaSg6L<9h
zjCA4bSiR(+G^HtHYyQ2(^dc=g*OrQgMro53msAlFYrBXhg5Aejw_Z~|Q=l2^?${7;
z>bA@F!tSnesWrM&B=gM%f8{Wiu*6rgYB%Ln_cpk&^FWcNp5T>hEJIh>B+OGj?@J!e
zN$H>L4@k~VqzmyJIp3L04lh;kJ1@C`if=w<EuAwCc*+}kT{kPT;+1&u`?Okf&s8g-
ze719B7mN(h_^H|DyY8lJ+<Rq%5Y2d&?}K$kch@3#waUB{RjGxc3q`4+H^OsMw_K<F
zW}be*uR4%H(=TgzC0c=b?FR%77;el5pZ)UH8y0hP`<aAExJa0Gdd15_hdq@qe)>W`
zwv}K8YB>7Bf0+keYDTZQ0Ql_kjqgz(N66^$A>#3Aj&7Pzeaf>8zdY0nfK2?#G4xeo
zf3^hZ_MK1@&69JJhZzl*xA?b*v)23LB##TsMD}0l7@za~&`XdK{3d(Hm1MTKG!yfK
z<NQFbvqFW#P*)@Op>%c8Ne$m!qO%88&gQeviy9c}$W8H}BhXx5?)0%*$}LJex%BYt
zT1_PlY*1A%sVrJuHaV2GO8_!qmimBwZd|tEY{TO2AbKaTW};}b<avffiKI55?iB8_
zNsW*~$-O}Cl&^P0B1%O(`0h(sJd5L`wZ`7mQPjwsOI8GP<$133&M%5?pL~?RUXo3z
zfBIsd!oCsrh|<F!Jd<bNx<Ae`)GcZy4&Bg992AHJ`OD$kJo=JnnrqIgMSHA<#zpIw
zZ@i4jKUWNS$Q3qtWsl<3$B92&468zJy`%@7FW^xr^!b<~eq;KJ6ToxB+Ib@dP>^oY
z1lWj4(7OiTJ+(IA(LBd>XZ(TI<1SXMXNMO8r(efQntea6leIz?@a%35x9x;$rIiV7
zEIlL|cNww(sdx5mB%+j_C2k$oF!|U#4}LA8F)q?fi|T|LdyO5_na}yb{ZwjjjcYxF
zZHgss;bg70GvoZxC;d^JHU;-#U5~!Qheh0f>@T3(9u4l)UXf$mug&HvY2cC!dp;KF
zh%-F7QEQQ*&V4SHC!5mTU5VXg1oZDowv>{q_=2W<MzdVEf97$0Z;<btTS=ls%Iq71
ziuSIFS}~KeLoyrGWk5^Xiu|&i()et+OthI6dsCSlpxN?MMZ!2sx}eU5M^ypKECuCJ
zbbHIqqhe)<bELLeF3Vx><&&IB*wJ+}|JgWpAgLU<7y0p!-lJBIAZJFg;$GIb>5i2;
hwD#}SKSI9$V4I$CYeB{gZteVKi88e|d0>PN{~v>}<#hl6
literal 9260
zcmWk!Wmptl7+qlLS~|W3b}1=IK|*5b5@|#_l<sa=8WvatrA11R22nr|NnMaG>0AUP

View File

@@ -4,11 +4,23 @@ Date: Fri, 3 Nov 2023 00:11:50 +0900
Subject: [PATCH] Plazma Configurations
diff --git a/build.gradle.kts b/build.gradle.kts
index 902c2eeedeeced8135ec97f64f08420c0996731b..41c335bc9d80abb40e58dfbc4842b66db23e0cba 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -22,6 +22,7 @@ dependencies {
implementation(common.asm.commons)
implementation(common.log4j.iostreams)
implementation(common.commons.lang2)
+ implementation(common.adventure.serializer.ansi)
implementation(server.velocity) { isTransitive = false }
runtimeOnly(common.maven.provider)
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e6556d3f094 100644
index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772c9dfecac 100644
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
@@ -36,28 +36,93 @@ public abstract class Configurations<G, W> {
@@ -39,28 +39,95 @@ public abstract class Configurations<G, W> {
public static final String WORLD_DEFAULTS = "__world_defaults__";
public static final ResourceLocation WORLD_DEFAULTS_KEY = new ResourceLocation("configurations", WORLD_DEFAULTS);
protected final Path globalFolder;
@@ -26,6 +38,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
- final String defaultWorldConfigFileName,
- final String worldConfigFileName
- ) {
+
+ // Plazma start - Configurable Plazma
+ @org.jetbrains.annotations.VisibleForTesting
+ public static final java.util.function.Supplier<org.spigotmc.SpigotWorldConfig> SPIGOT_WORLD_DEFAULTS = com.google.common.base.Suppliers.memoize(() -> new org.spigotmc.SpigotWorldConfig(org.apache.commons.lang.RandomStringUtils.randomAlphabetic(255)) {
@@ -61,7 +74,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
+ protected abstract org.spongepowered.configurate.NodePath[] removedWorldPaths();
+ protected abstract W getWorldConfiguration(final ServerLevel level);
+ protected abstract String buildWorldHeader(final ContextMap contextMap);
+ protected abstract Object createWorldConfigInstance(final ContextMap contextMap);
+ protected abstract W createWorldConfigInstance(final ContextMap contextMap);
+
+ protected static ConfigurationOptions defaultOptions(ConfigurationOptions options) {
+ return options.serializers(builder -> builder
@@ -76,16 +89,17 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
+ }
+
+ protected static ContextMap createWorldContextMap(ServerLevel level) {
+ 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());
+ }
+
+ public static ContextMap createWorldContextMap(Path dir, String levelName, ResourceLocation worldKey, org.spigotmc.SpigotWorldConfig spigotConfig, RegistryAccess registryAccess) {
+ public static ContextMap createWorldContextMap(Path dir, String levelName, ResourceLocation worldKey, org.spigotmc.SpigotWorldConfig spigotConfig, RegistryAccess registryAccess, GameRules gameRules) {
+ return ContextMap.builder()
+ .put(WORLD_DIRECTORY, dir)
+ .put(WORLD_NAME, levelName)
+ .put(WORLD_KEY, worldKey)
+ .put(SPIGOT_WORLD_CONFIG_CONTEXT_KEY, com.google.common.base.Suppliers.ofInstance(spigotConfig))
+ .put(REGISTRY_ACCESS, registryAccess)
+ .put(GAME_RULES, gameRules)
+ .build();
+ }
+
@@ -121,7 +135,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
protected ObjectMapper.Factory.Builder createObjectMapper() {
return ObjectMapper.factoryBuilder()
.addConstraint(Constraint.class, new Constraint.Factory())
@@ -65,17 +130,21 @@ public abstract class Configurations<G, W> {
@@ -68,17 +135,21 @@ public abstract class Configurations<G, W> {
}
protected YamlConfigurationLoader.Builder createLoaderBuilder() {
@@ -146,16 +160,16 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
}
@MustBeInvokedByOverriders
@@ -93,7 +162,7 @@ public abstract class Configurations<G, W> {
@@ -96,7 +167,7 @@ public abstract class Configurations<G, W> {
};
}
- static <T> CheckedFunction<ConfigurationNode, T, SerializationException> reloader(Class<T> type, T instance) {
+ protected static <T> CheckedFunction<ConfigurationNode, T, SerializationException> reloader(Class<T> type, T instance) { // Plazma - package -> protected
+ protected static <T> CheckedFunction<ConfigurationNode, T, SerializationException> reloader(Class<T> type, T instance) { // Plazma - AT (package -> public)
return node -> {
ObjectMapper.Factory factory = (ObjectMapper.Factory) Objects.requireNonNull(node.options().serializers().get(type));
ObjectMapper.Mutable<T> mutable = (ObjectMapper.Mutable<T>) factory.get(type);
@@ -103,7 +172,7 @@ public abstract class Configurations<G, W> {
@@ -106,7 +177,7 @@ public abstract class Configurations<G, W> {
}
public G initializeGlobalConfiguration(final RegistryAccess registryAccess) throws ConfigurateException {
@@ -164,7 +178,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
}
private void trySaveFileNode(YamlConfigurationLoader loader, ConfigurationNode node, String filename) throws ConfigurateException {
@@ -117,7 +186,7 @@ public abstract class Configurations<G, W> {
@@ -120,7 +191,7 @@ public abstract class Configurations<G, W> {
}
protected G initializeGlobalConfiguration(final CheckedFunction<ConfigurationNode, G, SerializationException> creator) throws ConfigurateException {
@@ -173,7 +187,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
final YamlConfigurationLoader loader = this.createGlobalLoaderBuilder()
.defaultOptions(this.applyObjectMapperFactory(this.createGlobalObjectMapperFactoryBuilder().build()))
.path(configFile)
@@ -148,6 +217,13 @@ public abstract class Configurations<G, W> {
@@ -151,6 +222,13 @@ public abstract class Configurations<G, W> {
}
protected void applyGlobalConfigTransformations(final ConfigurationNode node) throws ConfigurateException {
@@ -187,7 +201,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
}
@MustBeInvokedByOverriders
@@ -155,6 +231,7 @@ public abstract class Configurations<G, W> {
@@ -158,6 +236,7 @@ public abstract class Configurations<G, W> {
return ContextMap.builder()
.put(WORLD_NAME, WORLD_DEFAULTS)
.put(WORLD_KEY, WORLD_DEFAULTS_KEY)
@@ -195,7 +209,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
.put(REGISTRY_ACCESS, registryAccess);
}
@@ -162,7 +239,7 @@ public abstract class Configurations<G, W> {
@@ -165,7 +244,7 @@ public abstract class Configurations<G, W> {
final ContextMap contextMap = this.createDefaultContextMap(registryAccess)
.put(FIRST_DEFAULT)
.build();
@@ -204,18 +218,18 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
final DefaultWorldLoader result = this.createDefaultWorldLoader(false, contextMap, configFile);
final YamlConfigurationLoader loader = result.loader();
final ConfigurationNode node = loader.load();
@@ -172,8 +249,8 @@ public abstract class Configurations<G, W> {
@@ -175,8 +254,8 @@ public abstract class Configurations<G, W> {
this.verifyWorldConfigVersion(contextMap, node);
}
this.applyWorldConfigTransformations(contextMap, node);
this.applyWorldConfigTransformations(contextMap, node, null);
- final W instance = node.require(this.worldConfigClass);
- node.set(this.worldConfigClass, instance);
+ final W instance = node.require(this.worldConfigClass()); // Plazma - Configurable Plazma
+ node.set(this.worldConfigClass(), instance); // Plazma - Configurable Plazma
trySaveFileNode(loader, node, configFile.toString());
this.trySaveFileNode(loader, node, configFile.toString());
}
@@ -194,30 +271,41 @@ public abstract class Configurations<G, W> {
@@ -197,31 +276,42 @@ public abstract class Configurations<G, W> {
private record DefaultWorldLoader(YamlConfigurationLoader loader, boolean isNewFile) {
}
@@ -249,6 +263,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
+ // Plazma end - Configurable Plazma
protected W createWorldConfig(final ContextMap contextMap, final CheckedFunction<ConfigurationNode, W, SerializationException> creator) throws IOException {
Preconditions.checkArgument(!contextMap.isDefaultWorldContext(), "cannot create world map with default world context");
- final Path defaultsConfigFile = this.globalFolder.resolve(this.defaultWorldConfigFileName);
+ final Path defaultsConfigFile = this.globalFolder.resolve(this.defaultWorldConfigFileName()); // Plazma - Configurable Plazma
final YamlConfigurationLoader defaultsLoader = this.createDefaultWorldLoader(true, this.createDefaultContextMap(contextMap.require(REGISTRY_ACCESS)).build(), defaultsConfigFile).loader();
@@ -264,19 +279,10 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
Files.createFile(worldConfigFile); // create empty file as template
newFile = true;
}
@@ -246,7 +334,7 @@ public abstract class Configurations<G, W> {
if (worldName.equals(WORLD_DEFAULTS)) {
LOGGER.warn("The world defaults config file didn't have a version set, assuming latest");
} else {
- LOGGER.warn("The world config file for " + worldName + " didn't have a version set, assuming latest");
+ LOGGER.warn("The world config file for {} didn't have a version set, assuming latest", worldName); // Plazma
}
version.raw(this.worldConfigVersion());
} else if (version.getInt() > this.worldConfigVersion()) {
@@ -261,6 +349,13 @@ public abstract class Configurations<G, W> {
@@ -265,6 +355,13 @@ public abstract class Configurations<G, W> {
}
protected void applyWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode node) throws ConfigurateException {
protected void applyWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode node, final @Nullable ConfigurationNode defaultsNode) throws ConfigurateException {
+ // Plazma start - Configurable Plazma
+ org.spongepowered.configurate.transformation.ConfigurationTransformation.Builder builder = org.spongepowered.configurate.transformation.ConfigurationTransformation.builder();
+ for (org.spongepowered.configurate.NodePath path : removedWorldPaths()) {
@@ -287,7 +293,7 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
}
protected void applyDefaultsAwareWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode worldNode, final ConfigurationNode defaultsNode) throws ConfigurateException {
@@ -273,7 +368,7 @@ public abstract class Configurations<G, W> {
@@ -277,7 +374,7 @@ public abstract class Configurations<G, W> {
}
public Path getWorldConfigFile(ServerLevel level) {
@@ -297,10 +303,10 @@ index 218bf89fd7583d6db9f64754c4db8fcce5415bdb..bd2234f883faa50015289315fa745e65
public static class ContextMap {
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad958054b8a8665 100644
index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15ea16ea262 100644
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -131,6 +131,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -134,6 +134,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
See https://docs.papermc.io/paper/configuration for more information.
""";
@@ -308,7 +314,7 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
@VisibleForTesting
public static final Supplier<SpigotWorldConfig> SPIGOT_WORLD_DEFAULTS = Suppliers.memoize(() -> new SpigotWorldConfig(RandomStringUtils.randomAlphabetic(255)) {
@Override // override to ensure "verbose" is false
@@ -139,12 +140,69 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -142,12 +143,69 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
}
});
public static final ContextKey<Supplier<SpigotWorldConfig>> SPIGOT_WORLD_CONFIG_CONTEXT_KEY = new ContextKey<>(new TypeToken<Supplier<SpigotWorldConfig>>() {}, "spigot world config");
@@ -334,8 +340,8 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
+ @Override
+ protected NodePath[] removedGlobalPaths() {
+ return RemovedConfigurations.REMOVED_GLOBAL_PATHS;
}
+ }
+
+ @Override
+ protected GlobalConfiguration getGlobalConfiguration() {
+ return GlobalConfiguration.get();
@@ -369,8 +375,8 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
+ @Override
+ protected String buildWorldHeader(final ContextMap contextMap) {
+ return WORLD_HEADER.apply(contextMap);
+ }
+
}
+ @Override
+ protected WorldConfiguration getWorldConfiguration(final ServerLevel level) {
+ return level.paperConfig();
@@ -380,7 +386,7 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
@Override
protected int globalConfigVersion() {
return GlobalConfiguration.CURRENT_VERSION;
@@ -155,6 +213,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -158,6 +216,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
return WorldConfiguration.CURRENT_VERSION;
}
@@ -388,7 +394,7 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
@Override
protected YamlConfigurationLoader.Builder createLoaderBuilder() {
return super.createLoaderBuilder()
@@ -177,6 +236,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -180,6 +239,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
private static ObjectMapper.Factory.Builder defaultGlobalFactoryBuilder(ObjectMapper.Factory.Builder builder) {
return builder.addDiscoverer(InnerClassFieldDiscoverer.globalConfig());
}
@@ -396,7 +402,7 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
@Override
protected YamlConfigurationLoader.Builder createGlobalLoaderBuilder() {
@@ -200,6 +260,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -203,6 +263,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
return configuration;
}
@@ -404,42 +410,40 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
@Override
protected ContextMap.Builder createDefaultContextMap(final RegistryAccess registryAccess) {
return super.createDefaultContextMap(registryAccess)
@@ -213,8 +274,12 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -216,8 +277,9 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
.addNodeResolver(new NestedSetting.Factory())
.addDiscoverer(InnerClassFieldDiscoverer.worldConfig(createWorldConfigInstance(contextMap)));
}
+ // Plazma start - Configurable Plazma
+ */
+ */ // Plazma - Configurable Plazma
- private static WorldConfiguration createWorldConfigInstance(ContextMap contextMap) {
+ @Override
+ protected Object createWorldConfigInstance(ContextMap contextMap) {
+ // Plazma end - Configurable Plazma
+ @Override protected WorldConfiguration createWorldConfigInstance(ContextMap contextMap) { // Plazma - Configurable Plazma
return new WorldConfiguration(
contextMap.require(PaperConfigurations.SPIGOT_WORLD_CONFIG_CONTEXT_KEY).get(),
contextMap.require(Configurations.WORLD_KEY)
@@ -226,7 +291,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -229,7 +291,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
final RegistryAccess access = contextMap.require(REGISTRY_ACCESS);
return super.createWorldConfigLoaderBuilder(contextMap)
.defaultOptions(options -> options
- .header(contextMap.require(WORLD_NAME).equals(WORLD_DEFAULTS) ? WORLD_DEFAULTS_HEADER : WORLD_HEADER.apply(contextMap))
+ // .header(contextMap.require(WORLD_NAME).equals(WORLD_DEFAULTS) ? WORLD_DEFAULTS_HEADER : WORLD_HEADER.apply(contextMap)) // Plazma - Configurable Plazma
.serializers(serializers -> serializers
.register(new TypeToken<Reference2IntMap<?>>() {}, new FastutilMapSerializer.SomethingToPrimitive<Reference2IntMap<?>>(Reference2IntOpenHashMap::new, Integer.TYPE))
.register(new TypeToken<Reference2LongMap<?>>() {}, new FastutilMapSerializer.SomethingToPrimitive<Reference2LongMap<?>>(Reference2LongOpenHashMap::new, Long.TYPE))
@@ -251,11 +315,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -254,11 +316,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@Override
protected void applyWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode node) throws ConfigurateException {
- ConfigurationTransformation.Builder builder = ConfigurationTransformation.builder();
- for (NodePath path : RemovedConfigurations.REMOVED_WORLD_PATHS) {
protected void applyWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode node, final @Nullable ConfigurationNode defaultsNode) throws ConfigurateException {
- final ConfigurationTransformation.Builder builder = ConfigurationTransformation.builder();
- for (final NodePath path : RemovedConfigurations.REMOVED_WORLD_PATHS) {
- builder.addAction(path, TransformAction.remove());
- }
- builder.build().apply(node);
+ super.applyWorldConfigTransformations(contextMap, node); // Plazma - Configurable Plazma
+ super.applyWorldConfigTransformations(contextMap, node, defaultsNode); // Plazma - Configurable Plazma // Plazma - Configurable Plazma
final ConfigurationTransformation.VersionedBuilder versionedBuilder = Transformations.versionedBuilder();
V29_ZeroWorldHeight.apply(versionedBuilder);
@@ -266,11 +326,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -270,11 +328,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@Override
protected void applyGlobalConfigTransformations(ConfigurationNode node) throws ConfigurateException {
@@ -452,23 +456,23 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
final ConfigurationTransformation.VersionedBuilder versionedBuilder = Transformations.versionedBuilder();
V29_LogIPs.apply(versionedBuilder);
@@ -295,6 +351,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
transformation.apply(worldNode);
@@ -294,6 +348,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
builder.build().apply(worldNode);
}
+ /* // Plazma - Configurable Plazma
@Override
public WorldConfiguration createWorldConfig(final ContextMap contextMap) {
final String levelName = contextMap.require(WORLD_NAME);
@@ -335,6 +392,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
.put(REGISTRY_ACCESS, registryAccess)
@@ -335,6 +390,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
.put(GAME_RULES, gameRules)
.build();
}
+ */ // Plazma - Configurable Plazma
public static PaperConfigurations setup(final Path legacyConfig, final Path configDir, final Path worldFolder, final File spigotConfig) throws Exception {
final Path legacy = Files.isSymbolicLink(legacyConfig) ? Files.readSymbolicLink(legacyConfig) : legacyConfig;
@@ -368,12 +426,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -368,12 +424,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
throw new RuntimeException("Could not convert '" + legacyFileName + "' to the new configuration format", ex);
}
}
@@ -482,7 +486,7 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
}
private static void convert(final Path legacyConfig, final Path configDir, final Path worldFolder, final File spigotConfig) throws Exception {
@@ -424,6 +477,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -424,6 +475,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
}
@@ -490,7 +494,7 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
@Deprecated
public YamlConfiguration createLegacyObject(final MinecraftServer server) {
YamlConfiguration global = YamlConfiguration.loadConfiguration(this.globalFolder.resolve(this.globalConfigFileName).toFile());
@@ -434,6 +488,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -434,6 +486,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
}
return global;
}
@@ -498,7 +502,7 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
@Deprecated
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
@@ -456,10 +511,12 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -456,10 +509,13 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
return BasicConfigurationNode.root(options);
}
@@ -510,20 +514,13 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..4a444ac90d357e1b5cc432bccad95805
}
}
+ */ // Plazma - Configurable Plazma
+
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1032916def98f0607fabb1bbb550ba2ff70b3019..1cbb3c1142a480201971fae718e6b15a3e4c9d53 100644
index e121cc57ec5bf6f5b1d81e2fd4f551063ac60d64..2903c9a2480ac505f0931d29ac3c5013037e65f1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -232,6 +232,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Nullable
private ServerStatus.Favicon statusIcon;
private final RandomSource random;
+ public RandomSource random() { return this.random; } // Plazma - Expose random source
public final DataFixer fixerUpper;
private String localIp;
private int port;
@@ -307,6 +308,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -314,6 +314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final double[] recentTps = new double[ 4 ]; // Purpur
// Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
@@ -531,7 +528,7 @@ index 1032916def98f0607fabb1bbb550ba2ff70b3019..1cbb3c1142a480201971fae718e6b15a
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
public boolean lagging = false; // Purpur
@@ -416,6 +418,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -425,6 +426,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
@@ -539,31 +536,6 @@ index 1032916def98f0607fabb1bbb550ba2ff70b3019..1cbb3c1142a480201971fae718e6b15a
}
private void readScoreboard(DimensionDataStorage persistentStateManager) {
@@ -1175,7 +1178,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
LOGGER.info("*************************************************************************************");
LOGGER.info("This is the first time you're starting this server.");
LOGGER.info("It's recommended you read our 'Getting Started' documentation for guidance.");
- LOGGER.info("View this and more helpful information here: https://docs.papermc.io/paper/next-steps");
+ LOGGER.info("View this and more helpful information here: https://docs.plazmamc.org/plazma/administration/getting-started/next-step");
LOGGER.info("*************************************************************************************");
}
// Paper end - Add onboarding message for initial server start
@@ -1471,6 +1474,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Paper end - execute chunk tasks mid tick
+ // Plazma start - Configurable Plazma
+ public static void setServer(MinecraftServer server) {
+ if (SERVER != null)
+ throw new UnsupportedOperationException("Cannot redefine singleton Server");
+
+ SERVER = server;
+ }
+ // Plazma end - Configurable Plazma
+
private boolean pollTaskInternal() {
if (super.pollTask()) {
this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick
diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java
index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..5b3d59cc5e4efd54bea967d2e37dc9339aff1737 100644
--- a/src/main/java/net/minecraft/server/Services.java
@@ -605,10 +577,10 @@ index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..5b3d59cc5e4efd54bea967d2e37dc933
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 5ca6af93362d205438f8321ee2461ae7f8160df1..b7709cbb1a78eb1daac2112cb9fbf5d379aaa662 100644
index 775c5de4f5094260096cef6723dd50dfe2cb0c81..8289334e77999f72214c330a3306cbfeb17afbf1 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -209,6 +209,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -222,6 +222,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
// Paper start - initialize global and world-defaults configuration
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
@@ -617,7 +589,7 @@ index 5ca6af93362d205438f8321ee2461ae7f8160df1..b7709cbb1a78eb1daac2112cb9fbf5d3
// Paper end - initialize global and world-defaults configuration
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) {
@@ -219,6 +221,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -232,6 +234,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
@@ -626,52 +598,38 @@ index 5ca6af93362d205438f8321ee2461ae7f8160df1..b7709cbb1a78eb1daac2112cb9fbf5d3
// Purpur start
try {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 2ac8c77684c2e4cfc30bc0d39bcaf853dcd3bfb9..f5d1c1629a762b0ff5534d546610b1f59f385921 100644
index f72af2feb74626abbdfbfd090c15357457810240..f03b59754f5900fa47985b4118cacccadf04920f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -695,7 +695,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -700,7 +700,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.plazmaConfigurations.createWorldConfig(org.plazmamc.plazma.configurations.PlazmaConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor // Plazma - Configurable Plazma
- 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.plazmaConfigurations.createWorldConfig(org.plazmamc.plazma.configurations.PlazmaConfigurations.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 // Plazma - Configurable Plazma
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/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index f6664447c45b1d6f3371af7bed8b1175b17f25e2..9161f020d2ecc0cb9191666cfbc6a877d067063e 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -271,7 +271,7 @@ public final class ItemStack {
if (0 < version && version < CraftMagicNumbers.INSTANCE.getDataVersion() && MinecraftServer.getServer() != null) { // Paper - skip conversion if the server doesn't exist (for tests)
CompoundTag savedStack = new CompoundTag();
this.save(savedStack);
- savedStack = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ITEM_STACK, new Dynamic(NbtOps.INSTANCE, savedStack), version, CraftMagicNumbers.INSTANCE.getDataVersion()).getValue();
+ savedStack = (CompoundTag) MinecraftServer.getServer().getFixerUpper().update(References.ITEM_STACK, new Dynamic(NbtOps.INSTANCE, savedStack), version, CraftMagicNumbers.INSTANCE.getDataVersion()).getValue(); // Plazma - Configurable Plazma
this.load(savedStack);
}
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 311c853f2150247350ab6ccb2dd92d58dbfc645c..7578b6d4ee52ebafea16b7eaf88dcedbd1f093d8 100644
index eda2f8cc034cf46293be1be117a60cf8b663c303..79ebec0543f730af403240e9c1c011777464a698 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -171,7 +171,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -168,6 +168,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return this.paperConfig;
}
// Paper end - add paper world config
-
+ // Plazma start - Configurable Plazma
+ private final org.plazmamc.plazma.configurations.WorldConfigurations plazmaConfig;
+ public org.plazmamc.plazma.configurations.WorldConfigurations plazmaConfig() {
+ return this.plazmaConfig;
+ }
+ // Plazma end - Configurable Plazma
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
@@ -262,9 +267,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -257,9 +263,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
//protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter // Purpur - dont break ABI
public abstract ResourceKey<LevelStem> getTypeKey();
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.WorldConfigurations> plazmaWorldConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor // Plazma - Configurable Plazma
@@ -682,7 +640,7 @@ index 311c853f2150247350ab6ccb2dd92d58dbfc645c..7578b6d4ee52ebafea16b7eaf88dcedb
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
this.generator = gen;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b2470f03eecb1b81d3f0acbd9bc3c38f321ef3d9..ceea71c3e6886b03d017c44c287dc20928f63f09 100644
index dca6cce8768c8c08e4abba249c30731dbdec7763..d06473349dff50a33b7843ae6dcde28f50fcd708 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1068,6 +1068,7 @@ public final class CraftServer implements Server {
@@ -693,12 +651,12 @@ index b2470f03eecb1b81d3f0acbd9bc3c38f321ef3d9..ceea71c3e6886b03d017c44c287dc209
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
@@ -3111,6 +3112,13 @@ public final class CraftServer implements Server {
@@ -3126,6 +3127,13 @@ public final class CraftServer implements Server {
}
// Purpur end
+ // Plazma start - Configurable Plazma
+ @Override @org.jetbrains.annotations.NotNull
+ @Override
+ public YamlConfiguration getPlazmaConfig() {
+ return CraftServer.this.console.plazmaConfigurations.createLegacyObject(CraftServer.this.console);
+ }
@@ -708,11 +666,11 @@ index b2470f03eecb1b81d3f0acbd9bc3c38f321ef3d9..ceea71c3e6886b03d017c44c287dc209
public void restart() {
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index d36c880012153058803b595429084adb36458741..e8df8e8520cea5d21197c61a172f7211a3a2c34d 100644
index 333c8a313208652700c21fc2ac629296b5b02078..9b3371fee86b5e41d5564424c0b3a3805b2059f9 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -195,6 +195,14 @@ public class Main {
.defaultsTo("Plazma Server") // Plazma - Branding
@@ -190,6 +190,14 @@ public class Main {
.defaultsTo("A Plazma Server") // Plazma - Rebrand
.describedAs("Name");
// Paper end
+
@@ -726,6 +684,21 @@ index d36c880012153058803b595429084adb36458741..e8df8e8520cea5d21197c61a172f7211
}
};
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
new file mode 100644
index 0000000000000000000000000000000000000000..5942d0997f07bd51d934dac32cd349792a10643e
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -0,0 +1,9 @@
+package org.plazmamc.plazma;
+
+import static java.lang.Boolean.getBoolean;
+
+public interface Options {
+
+ boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
+
+}
diff --git a/src/main/java/org/plazmamc/plazma/commands/Commands.java b/src/main/java/org/plazmamc/plazma/commands/Commands.java
new file mode 100644
index 0000000000000000000000000000000000000000..4497d8f8a52db0fc89ce27168b54657d172b1445
@@ -1007,10 +980,10 @@ index 0000000000000000000000000000000000000000..d8006ae086c18a4ef43906d516eba0d5
+}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
new file mode 100644
index 0000000000000000000000000000000000000000..28deb72a851f353abaf50345983467e32ae3f4fd
index 0000000000000000000000000000000000000000..af27a8199c46c2995424a60893439c0dbc162791
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
@@ -0,0 +1,218 @@
@@ -0,0 +1,217 @@
+package org.plazmamc.plazma.configurations;
+
+import com.mojang.logging.LogUtils;
@@ -1021,6 +994,7 @@ index 0000000000000000000000000000000000000000..28deb72a851f353abaf50345983467e3
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.framework.qual.DefaultQualifier;
+import org.jetbrains.annotations.VisibleForTesting;
+import org.plazmamc.plazma.Options;
+import org.slf4j.Logger;
+import org.spongepowered.configurate.BasicConfigurationNode;
+import org.spongepowered.configurate.ConfigurateException;
@@ -1038,12 +1012,12 @@ index 0000000000000000000000000000000000000000..28deb72a851f353abaf50345983467e3
+@DefaultQualifier(NonNull.class)
+public class PlazmaConfigurations extends Configurations<GlobalConfiguration, WorldConfigurations> {
+
+ public static final Logger LOGGER = LogUtils.getLogger();
+ public static final String CONFIG_DIR = "config";
+ static final Logger LOGGER = LogUtils.getLogger();
+ static final String GLOBAL_CONFIG_FILE_NAME = "plazma-global.yml";
+ static final String WORLD_DEFAULTS_CONFIG_FILE_NAME = "plazma-world-defaults.yml";
+ static final String WORLD_CONFIG_FILE_NAME = "plazma-world.yml";
+ static final boolean OPTIMIZE = !Boolean.getBoolean("Plazma.disableConfigOptimization");
+ static final boolean OPTIMIZE = !Options.NO_OPTIMIZE;
+
+ private static final String HEADER_START = """
+ #### ENGLISH ####
@@ -1070,7 +1044,7 @@ index 0000000000000000000000000000000000000000..28deb72a851f353abaf50345983467e3
+ %s
+
+ GitHub: https://github.com/PlazmaMC/Plazma
+ Wiki: https://github.com/PlazmaMC/Plazma/wiki
+ Wiki: https://docs.plazmamc.org/
+ Discord: https://plazmamc.org/discord
+ """;
+
@@ -1103,7 +1077,6 @@ index 0000000000000000000000000000000000000000..28deb72a851f353abaf50345983467e3
+ If you need help with the configuration or have any questions related to Plazma,
+ join us in our Discord for Plazma, or create issues on our GitHub repository.
+
+
+ #### 한국어 ####
+ 본 파일은 %s (%s) 월드 전용 Plazma 구성 파일입니다.
+ 이 파일은 초기에는 비어있지만, 월드 기본 설정을 덮어쓰기 위해 설정을 추가할 수 있습니다.
@@ -1114,10 +1087,9 @@ index 0000000000000000000000000000000000000000..28deb72a851f353abaf50345983467e3
+ 만약 설정에 도움이 필요하거나, Plazma에 대해 질문이 있으시다면,
+ 공식 Discord 서버에 접속하거나, GitHub 레포지토리에 이슈를 생성해주시기 바랍니다.
+
+
+ World Default Config Directory: %s/%s
+ GitHub: https://github.com/PlazmaMC/Plazma
+ Wiki: https://github.com/PlazmaMC/Plazma/wiki
+ Document: https://docs.plazmamc.org/
+ Discord: https://plazmamc.org/discord
+ """.formatted(
+ map.require(WORLD_NAME), map.require(WORLD_KEY),
@@ -1208,7 +1180,7 @@ index 0000000000000000000000000000000000000000..28deb72a851f353abaf50345983467e3
+ }
+
+ @Override
+ protected Object createWorldConfigInstance(final ContextMap contextMap) {
+ protected WorldConfigurations createWorldConfigInstance(final ContextMap contextMap) {
+ return new WorldConfigurations(contextMap.require(WORLD_KEY));
+ }
+
@@ -1277,7 +1249,7 @@ index 0000000000000000000000000000000000000000..f2d3d51cb4b8fc7a5fd6db1a63289fff
+
+}
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
index b786ed8e620feb51baceae41dd2d1538dc298705..6c2db1219714a524b456428523ed4674f79ffe03 100644
index 1b1d51a68c0abe7d8f0aa1172064192c71ae645e..74af3501397bfd89d637ad5ce72bb8f2c2bbdc8a 100644
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
@@ -64,6 +64,7 @@ public abstract class AbstractTestingBase {
@@ -1288,24 +1260,6 @@ index b786ed8e620feb51baceae41dd2d1538dc298705..6c2db1219714a524b456428523ed4674
CraftRegistry.setMinecraftRegistry(REGISTRY_CUSTOM);
diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java
index 3b3e44c5ed24f653f7dc1e5d3d4f0ff76084f277..9391d5447e26a42142c6b44c8e470b35c0f9b0cf 100644
--- a/src/test/java/org/bukkit/support/DummyServer.java
+++ b/src/test/java/org/bukkit/support/DummyServer.java
@@ -57,6 +57,13 @@ public final class DummyServer {
when(instance.getTag(anyString(), any(org.bukkit.NamespacedKey.class), any())).thenAnswer(ignored -> new io.papermc.paper.util.EmptyTag());
// paper end - testing additions
+ // Plazma start - Configurable Plazma
+ net.minecraft.server.MinecraftServer handle = mock(withSettings().stubOnly());
+ when(handle.random()).thenReturn(net.minecraft.util.RandomSource.create());
+ when(handle.getFixerUpper()).thenReturn(net.minecraft.util.datafix.DataFixers.getDataFixer());
+ net.minecraft.server.MinecraftServer.setServer(handle);
+ // Plazma end - Configurable Plazma
+
Bukkit.setServer(instance);
} catch (Throwable t) {
throw new Error(t);
diff --git a/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java b/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java
new file mode 100644
index 0000000000000000000000000000000000000000..c63942e2dc00ed6d6b4119f418bdaa5a64b4c0fe

View File

@@ -0,0 +1,40 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Fri, 3 May 2024 19:50:32 +0900
Subject: [PATCH] Warn on startup
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 2579b32009a5f5e288edf56ee8f1246cd70343fc..c59a1b6a365bf80ac913c1a9c939ad2cc5f3b963 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -127,6 +127,18 @@ public class Main {
\033[38;2;215;23;133m╚\033[38;2;212;24;134m═\033[38;2;209;26;134m╝\033[38;2;205;27;135m \033[38;2;202;28;136m \033[38;2;199;30;136m \033[38;2;196;31;137m \033[38;2;193;33;138m \033[38;2;190;34;138m╚\033[38;2;186;35;139m═\033[38;2;183;37;140m═\033[38;2;180;38;140m═\033[38;2;177;39;141m═\033[38;2;174;41;142m═\033[38;2;170;42;142m═\033[38;2;167;43;143m╝ \033[38;2;164;45;144m╚\033[38;2;161;46;144m═\033[38;2;158;47;145m╝\033[38;2;155;49;146m \033[38;2;151;50;146m \033[38;2;148;52;147m╚\033[38;2;145;53;148m═\033[38;2;142;54;148m╝ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m═\033[38;2;126;61;151m═\033[38;2;123;62;152m═\033[38;2;120;64;153m═\033[38;2;116;65;153m╝ \033[38;2;113;67;154m╚\033[38;2;110;68;155m═\033[38;2;107;69;155m╝\033[38;2;104;71;156m \033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m \033[38;2;88;77;159m╚\033[38;2;85;79;160m═\033[38;2;81;80;161m╝ \033[38;2;78;81;161m╚\033[38;2;75;83;162m═\033[38;2;72;84;163m╝\033[38;2;69;86;163m \033[38;2;66;87;164m \033[38;2;62;88;165m╚\033[38;2;59;90;165m═\033[38;2;56;91;166m╝\033[0m
""");
// Plazma end
+ // Plazma start - Warn on startup
+ if (!org.plazmamc.plazma.Options.NO_WARN) {
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
+ if (com.destroystokyo.paper.PaperVersionFetcher.DEVELOPMENT) {
+ LOGGER.error("*********************** CAUTION ***********************");
+ LOGGER.error("This version is a developed version of Plazma.");
+ LOGGER.error("Nobody knows what kind of problem you're going to have, and there's always the possibility of unexpected problems.");
+ LOGGER.error("Never use this version on a public server, and after you've tested it enough before using it!");
+ LOGGER.error("*******************************************************");
+ }
+ }
+ // Plazma end
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index 5942d0997f07bd51d934dac32cd349792a10643e..b02a0dddd99df1691c125660828a61cc4a5a4d02 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -5,5 +5,6 @@ import static java.lang.Boolean.getBoolean;
public interface Options {
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
+ boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
}

View File

@@ -5,15 +5,15 @@ Subject: [PATCH] Development Build
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index b04d3eea789f77b2435cb0192635f1be1bab597d..a58ce2c893d8c755ab3027207d512542d2d57c36 100644
index 80159d9c8432f21aa774d3ade9e2ae84b2d5261c..f2a034a5062b58f3d6bde25150e13fe1cff3af0e 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -24,7 +24,7 @@ public class PaperVersionFetcher implements VersionFetcher {
private static int distance = -2; public int distance() { return distance; }
// Purpur end
private static @Nullable String mcVer;
- private static final boolean DEVELOPMENT = false; // Plazma
+ private static final boolean DEVELOPMENT = true; // Plazma
- public static final boolean DEVELOPMENT = false; // Plazma
+ public static final boolean DEVELOPMENT = true; // Plazma
@Override
public long getCacheTime() {

View File

@@ -9,10 +9,10 @@ Copyright (C) 2024 SparklyPower
Based on commit: 29212936a832106c4d68e2a2017acbea2fdd3cc4
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 04b98e23eed926d8473cc2464e04a5b9f18f1140..cf098d4a3111771c13766285c5ec5f1fc1f539a4 100644
index 39e7dcf3c92c9203c190782be401c00c010b8aeb..b86ae3929ec5d3c4eb69d92774dc445aa5b3093e 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -74,6 +74,7 @@ public class ServerEntity {
@@ -78,6 +78,7 @@ public class ServerEntity {
private List<SynchedEntityData.DataValue<?>> trackedDataValues;
// CraftBukkit start
public final Set<ServerPlayerConnection> trackedPlayers; // Purpur - private -> public
@@ -20,18 +20,24 @@ index 04b98e23eed926d8473cc2464e04a5b9f18f1140..cf098d4a3111771c13766285c5ec5f1f
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
this.trackedPlayers = trackedPlayers;
@@ -210,12 +211,14 @@ public class ServerEntity {
@@ -208,12 +209,16 @@ public class ServerEntity {
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
Vec3 vec3d1 = this.entity.getDeltaMovement();
+ if (!skipSqrWhenNoDeltaChanges && vec3d1 != this.ap) { // Plazma - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
double d0 = vec3d1.distanceToSqr(this.ap);
- double d0 = vec3d1.distanceToSqr(this.ap);
+ // Plazma start - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
+ if (!skipSqrWhenNoDeltaChanges && vec3d1 != this.ap) {
+ double d0 = vec3d1.distanceToSqr(this.ap);
if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
this.ap = vec3d1;
this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap));
- if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
- this.ap = vec3d1;
- this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap));
+ if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
+ this.ap = vec3d1;
+ this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap));
+ }
}
+ } // Plazma - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
+ // Plazma end - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
}
if (packet1 != null) {
@@ -57,10 +63,10 @@ index f890738d3bb9fb5e70a9d323c6cec97f9948f9cf..52e72277c661b67a54bc5ce584efb041
}
}
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
index 8d3c1897044f9a2bbe1911e1a72dc9a00fb246df..a68112a1d1904edfc84acb6c209e13f0836d97e0 100644
index 608390ed36710a419de1542b80340dd3fcc7299c..043f068345ca3c50209c1c3cc1feb6277a3da61a 100644
--- a/src/main/java/net/minecraft/world/item/MapItem.java
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
@@ -313,12 +313,14 @@ public class MapItem extends ComplexItem {
@@ -268,11 +268,13 @@ public class MapItem extends ComplexItem {
}
}
@@ -68,13 +74,12 @@ index 8d3c1897044f9a2bbe1911e1a72dc9a00fb246df..a68112a1d1904edfc84acb6c209e13f0
@Override
public void inventoryTick(ItemStack stack, Level world, Entity entity, int slot, boolean selected) {
if (!world.isClientSide) {
MapItemSavedData worldmap = MapItem.getSavedData(stack, world);
if (worldmap != null) {
+ if (skipTickWhenCraftNotPresent && worldmap.mapView.getRenderers().stream().noneMatch(mapRenderer -> mapRenderer.getClass() == org.bukkit.craftbukkit.map.CraftMapRenderer.class)) return; // Plazma - SparklyPaper port; Skip map item ticking if the craft map renderer is not present
if (entity instanceof Player) {
Player entityhuman = (Player) entity;
MapItemSavedData mapItemSavedData = getSavedData(stack, world);
if (mapItemSavedData != null) {
+ if (skipTickWhenCraftNotPresent && mapItemSavedData.mapView.getRenderers().stream().noneMatch(mapRenderer -> mapRenderer.getClass() == org.bukkit.craftbukkit.map.CraftMapRenderer.class)) return; // Plazma - SparklyPaper port; Skip map item ticking if the craft map renderer is not present
if (entity instanceof Player player) {
mapItemSavedData.tickCarriedBy(player, stack);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
index 8149b9c51b78eb5c689b7218a2ca3aab60e73bcf..b9a303f6280a2f6ad3616da152922a4f4a504281 100644
--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java

View File

@@ -5,14 +5,14 @@ Subject: [PATCH] Always agree EULA on development mode
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index b91c3b8ca8f840335ba6470658d82c5d71bb75e1..23f0302f2d90b7229828890eb364bc2c9abc11d2 100644
index c59a1b6a365bf80ac913c1a9c939ad2cc5f3b963..20d215e53b4a02d7f52197decf05fd1e6ee44669 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -168,6 +168,7 @@ public class Main {
@@ -193,6 +193,7 @@ public class Main {
// Spigot Start
boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" );
+ eulaAgreed = eulaAgreed || Boolean.getBoolean("Paper.isRunDev"); // Plazma - Always agree EULA on development mode
+ eulaAgreed = eulaAgreed || Boolean.getBoolean("Paper.pushPaperAssetsRoot"); // Plazma - Always agree EULA on development mode
if ( eulaAgreed )
{
System.err.println( "You have used the Spigot command line EULA agreement flag." );

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Add more metrics
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 0b3d87d2d43148e6370e7a03e0bb6074891ac800..8783c81af1d09e6682256dee0dd546de0be418cd 100644
index 1de03b16c513d83550077bab46b52ae6e40eb98e..0935884fa747407d262178c25388073957d4547e 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -636,38 +636,59 @@ public class Metrics {

View File

@@ -8,67 +8,8 @@ Subject: [PATCH] Optimize default configurations
- AkiraDevelopment/SimplyMC
- YouHaveTrouble/minecraft-exploits-and-how-to-fix-them
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index 8afc58f35deb49084a20b803e91ce4692ce6e4d6..1febd6d0743aadb4002b447c07ec43098ca96c18 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -64,7 +64,7 @@ public class PufferfishConfig {
getString("info.version", "1.0");
setComment("info",
"Pufferfish Configuration",
- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host",
+ //"Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - Sponsorblock
"Join our Discord for support: https://discord.gg/reZw4vQV9H",
"Download new builds at https://ci.pufferfish.host/job/Pufferfish");
@@ -219,7 +219,7 @@ public class PufferfishConfig {
public static int maxProjectileLoadsPerTick;
public static int maxProjectileLoadsPerProjectile;
private static void projectileLoading() {
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
setComment("projectile", "Optimizes projectile settings");
@@ -233,7 +233,7 @@ public class PufferfishConfig {
public static int activationDistanceMod;
private static void dynamicActivationOfBrains() throws IOException {
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()); // Purpur // Plazma - Optimize default configurations
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
"This value determines how far away an entity has to be",
"from the player to start being effected by DEAR.");
@@ -241,7 +241,7 @@ public class PufferfishConfig {
maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
"This value defines how often in ticks, the furthest entity",
"will get their pathfinders and behaviors ticked. 20 = 1s");
- activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 8, // Plazma - Optimize default configurations
"This value defines how much distance modifies an entity's",
"tick frequency. freq = (distanceToPlayer^2) / (2^value)",
"If you want further away entities to tick less often, use 7.",
@@ -261,8 +261,18 @@ public class PufferfishConfig {
public static Map<String, Integer> projectileTimeouts;
private static void projectileTimeouts() {
// Set some defaults
+ // Plazma start - Optimize default configurations
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) {
+ getInt("entity_timeouts.ARROW", 200);
+ getInt("entity_timeouts.EGG", 200);
+ getInt("entity_timeouts.ENDER_PEARL", 200);
+ getInt("entity_timeouts.SNOWBALL", 200);
+ getInt("entity_timeouts.LLAMA_SPIT", 200);
+ } else {
+ // Plazma end - Optimize default configurations
getInt("entity_timeouts.SNOWBALL", -1);
getInt("entity_timeouts.LLAMA_SPIT", -1);
+ } // Plazma - Optimize default configurations
setComment("entity_timeouts",
"These values define a entity's maximum lifespan. If an",
"entity is in this list and it has survived for longer than",
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 30fe1c0645a07d663b08c0f988a1ab3a750bf7c4..c71daa5d3665cec2836770e5f04da222bc5f90ed 100644
index 2874bc3001c4e7d9191e47ba512c5a68369c21f1..750dd556123f3f912f8463ca3018256aaca5a2cb 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -156,7 +156,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -80,7 +21,7 @@ index 30fe1c0645a07d663b08c0f988a1ab3a750bf7c4..c71daa5d3665cec2836770e5f04da222
}
public SpamLimiter spamLimiter;
@@ -198,7 +198,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -196,7 +196,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public Commands commands;
public class Commands extends ConfigurationPart {
@@ -89,7 +30,7 @@ index 30fe1c0645a07d663b08c0f988a1ab3a750bf7c4..c71daa5d3665cec2836770e5f04da222
public boolean fixTargetSelectorTagCompletion = true;
public boolean timeCommandAffectsAllWorlds = false;
}
@@ -247,7 +247,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -245,7 +245,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public BookSize bookSize;
public class BookSize extends ConfigurationPart {
@@ -98,7 +39,7 @@ index 30fe1c0645a07d663b08c0f988a1ab3a750bf7c4..c71daa5d3665cec2836770e5f04da222
public double totalMultiplier = 0.98D; // TODO this should probably be merged into the above inner class
}
public boolean resolveSelectorsInBooks = false;
@@ -258,7 +258,15 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -256,7 +256,15 @@ public class GlobalConfiguration extends ConfigurationPart {
public class PacketLimiter extends ConfigurationPart {
public Component kickMessage = Component.translatable("disconnect.exceeded_packet_rate", NamedTextColor.RED);
public PacketLimit allPackets = new PacketLimit(7.0, 500.0, PacketLimit.ViolateAction.KICK);
@@ -115,7 +56,7 @@ index 30fe1c0645a07d663b08c0f988a1ab3a750bf7c4..c71daa5d3665cec2836770e5f04da222
@ConfigSerializable
public record PacketLimit(@Required double interval, @Required double maxPacketRate, ViolateAction action) {
@@ -326,7 +334,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -324,7 +332,7 @@ public class GlobalConfiguration extends ConfigurationPart {
executor.setMaximumPoolSize(_chatExecutorMaxSize);
}
}
@@ -125,7 +66,7 @@ index 30fe1c0645a07d663b08c0f988a1ab3a750bf7c4..c71daa5d3665cec2836770e5f04da222
public boolean loadPermissionsYmlBeforePlugins = true;
@Constraints.Min(4)
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index d3fdf62912d190f8b468b77230a927023c361074..6be96d4a772255ac03addd1775008d897ab34ac8 100644
index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3e27d5ab5 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -96,12 +96,32 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -194,14 +135,14 @@ index d3fdf62912d190f8b468b77230a927023c361074..6be96d4a772255ac03addd1775008d89
}
}
@@ -152,14 +193,14 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -151,14 +192,14 @@ public class WorldConfiguration extends ConfigurationPart {
public ArmorStands armorStands;
public class ArmorStands extends ConfigurationPart {
- public boolean doCollisionEntityLookups = true;
- public boolean tick = true;
+ public boolean doCollisionEntityLookups = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
+ public boolean tick = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
+ public boolean doCollisionEntityLookups = !org.plazmamc.plazma.Options.AGGRESSIVE; // Plazma - Optimize default configurations
+ public boolean tick = !org.plazmamc.plazma.Options.AGGRESSIVE; // Plazma - Optimize default configurations
}
public Markers markers;
@@ -212,7 +153,7 @@ index d3fdf62912d190f8b468b77230a927023c361074..6be96d4a772255ac03addd1775008d89
}
public Sniffer sniffer;
@@ -182,7 +223,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -181,7 +222,7 @@ public class WorldConfiguration extends ConfigurationPart {
@MergeMap
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
@MergeMap
@@ -221,7 +162,7 @@ index d3fdf62912d190f8b468b77230a927023c361074..6be96d4a772255ac03addd1775008d89
@MergeMap
public Reference2IntMap<MobCategory> ticksPerSpawn = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
@@ -383,7 +424,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -382,7 +423,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class Environment extends ConfigurationPart {
public boolean disableThunder = false;
public boolean disableIceAndSnow = false;
@@ -230,7 +171,7 @@ index d3fdf62912d190f8b468b77230a927023c361074..6be96d4a772255ac03addd1775008d89
public boolean disableExplosionKnockback = false;
public boolean generateFlatBedrock = false;
public FrostedIce frostedIce;
@@ -438,7 +479,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -434,7 +475,7 @@ public class WorldConfiguration extends ConfigurationPart {
public Fixes fixes;
public class Fixes extends ConfigurationPart {
@@ -239,7 +180,7 @@ index d3fdf62912d190f8b468b77230a927023c361074..6be96d4a772255ac03addd1775008d89
public boolean disableUnloadedChunkEnderpearlExploit = true;
public boolean preventTntFromMovingInWater = false;
public boolean splitOverstackedLoot = true;
@@ -466,9 +507,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -462,9 +503,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Collisions extends ConfigurationPart {
public boolean onlyPlayersCollide = false;
public boolean allowVehicleCollisions = true;
@@ -251,7 +192,7 @@ index d3fdf62912d190f8b468b77230a927023c361074..6be96d4a772255ac03addd1775008d89
public boolean allowPlayerCrammingDamage = false;
}
@@ -476,18 +517,41 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -472,18 +513,41 @@ public class WorldConfiguration extends ConfigurationPart {
public class Chunks extends ConfigurationPart {
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
@@ -301,7 +242,7 @@ index d3fdf62912d190f8b468b77230a927023c361074..6be96d4a772255ac03addd1775008d89
});
public boolean flushRegionsOnSave = false;
}
@@ -502,9 +566,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -498,9 +562,9 @@ public class WorldConfiguration extends ConfigurationPart {
public TickRates tickRates;
public class TickRates extends ConfigurationPart {
@@ -313,12 +254,12 @@ index d3fdf62912d190f8b468b77230a927023c361074..6be96d4a772255ac03addd1775008d89
public int wetFarmland = 1;
public int dryFarmland = 1;
public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40));
@@ -538,9 +602,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -534,9 +598,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Misc extends ConfigurationPart {
public int lightQueueSize = 20;
- public boolean updatePathfindingOnBlockUpdate = true;
+ public boolean updatePathfindingOnBlockUpdate = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
+ public boolean updatePathfindingOnBlockUpdate = !org.plazmamc.plazma.Options.AGGRESSIVE; // Plazma - Optimize default configurations
public boolean showSignClickCommandFailureMsgsToPlayer = false;
- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
+ public RedstoneImplementation redstoneImplementation = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? RedstoneImplementation.ALTERNATE_CURRENT : RedstoneImplementation.VANILLA; // Plazma - Optimize default configurations
@@ -338,10 +279,10 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357
}
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 23f0302f2d90b7229828890eb364bc2c9abc11d2..a9753f799ef944a46ee3cedd68c8aad7aacc2612 100644
index 20d215e53b4a02d7f52197decf05fd1e6ee44669..f832834e02594eb35e08108054f395be3b2bed51 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -153,7 +153,7 @@ public class Main {
@@ -178,7 +178,7 @@ public class Main {
File configFile = (File) optionset.valueOf("bukkit-settings");
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile);
configuration.options().copyDefaults(true);
@@ -351,10 +292,10 @@ index 23f0302f2d90b7229828890eb364bc2c9abc11d2..a9753f799ef944a46ee3cedd68c8aad7
File commandFile = (File) optionset.valueOf("commands-settings");
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index a66dcea06424518290576c7647ae0717040586f9..41d5d15dfa2affdee68501efb2447a209c38992d 100644
index 5b7ed096999dbb7e95fb7d615e737f19604f58ff..9684e7079c9586e764931e5b6c40961ac9eda853 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -130,14 +130,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -131,14 +131,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.spawnMonsters = this.get("spawn-monsters", true);
this.useNativeTransport = this.get("use-native-transport", true);
this.enableCommandBlock = this.get("enable-command-block", false);
@@ -373,17 +314,17 @@ index a66dcea06424518290576c7647ae0717040586f9..41d5d15dfa2affdee68501efb2447a20
this.maxPlayers = this.get("max-players", 20);
this.networkCompressionThreshold = this.get("network-compression-threshold", 256);
this.broadcastRconToOps = this.get("broadcast-rcon-to-ops", true);
@@ -145,7 +145,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -146,7 +146,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.maxWorldSize = this.get("max-world-size", (integer) -> {
return Mth.clamp(integer, 1, 29999984);
}, 29999984);
- this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - Hide sync chunk writes behind flag
+ this.syncChunkWrites = this.get("sync-chunk-writes", false) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - Hide sync chunk writes behind flag // Plazma - Show disabled by default
+ this.syncChunkWrites = Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - Hide sync chunk writes behind flag // Plazma - Completely remove this setting
this.regionFileComression = this.get("region-file-compression", "deflate");
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
this.enableStatus = this.get("enable-status", true);
this.hideOnlinePlayers = this.get("hide-online-players", false);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ceea71c3e6886b03d017c44c287dc20928f63f09..e250196a4210c5b2fe5eadda6312ebc5e17590b8 100644
index d06473349dff50a33b7843ae6dcde28f50fcd708..c1e5bc9cab10c51712dad1da8ad50e5d821b85b0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -426,7 +426,7 @@ public final class CraftServer implements Server {
@@ -396,18 +337,18 @@ index ceea71c3e6886b03d017c44c287dc20928f63f09..e250196a4210c5b2fe5eadda6312ebc5
if (!this.configuration.isString("aliases")) {
legacyAlias = this.configuration.getConfigurationSection("aliases");
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index a858b7ddef7f6877c0b92f4150e0dd37bea121aa..eab5ea835a524482f8cc043c7be190a835335ed2 100644
index b02a0dddd99df1691c125660828a61cc4a5a4d02..739bcbb7388b948982202b35a708753103fa38e8 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -3,5 +3,6 @@ package org.plazmamc.plazma;
public interface Options {
@@ -6,5 +6,6 @@ public interface Options {
boolean iKnowWhatIAmDoing = Boolean.getBoolean("Plazma.iKnowWhatIAmDoing");
+ boolean aggressiveOptimize = Boolean.getBoolean("Plazma.aggressiveOptimize");
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
+ boolean AGGRESSIVE = Boolean.getBoolean("Plazma.aggressiveOptimize");
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index a937993f318ef5703420f57fe65c5d990ce2c4dd..65b9e4fc073d0e97c6f90587d20e3ecbdaaf2c71 100644
index 9311fcb675d20ee77d225e3cffe1d6ce56601963..f9779f8cf0399e434ebe9e49e7bae5386ce01410 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -49,6 +49,7 @@ public class PurpurConfig {
@@ -437,10 +378,10 @@ index a937993f318ef5703420f57fe65c5d990ce2c4dd..65b9e4fc073d0e97c6f90587d20e3ecb
private static void networkSettings() {
useUPnP = getBoolean("settings.network.upnp-port-forwarding", useUPnP);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 7dc82ffccc157a17335f1bc56ab81be3813294f6..d756c25e6d0af3153e510d0162e65348b1675366 100644
index 7a9a5985b1429c25467db732678d0658aafcfafa..25c9a5b9b22a8680be8140f8c2dfd255dbab1bf7 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -425,7 +425,7 @@ public class PurpurWorldConfig {
@@ -433,7 +433,7 @@ public class PurpurWorldConfig {
public boolean idleTimeoutTargetPlayer = true;
public String playerDeathExpDropEquation = "expLevel * 7";
public int playerDeathExpDropMax = 100;
@@ -449,7 +390,7 @@ index 7dc82ffccc157a17335f1bc56ab81be3813294f6..d756c25e6d0af3153e510d0162e65348
public boolean teleportOnNetherCeilingDamage = false;
public boolean totemOfUndyingWorksInInventory = false;
public boolean playerFixStuckPortal = false;
@@ -3127,7 +3127,7 @@ public class PurpurWorldConfig {
@@ -3128,7 +3128,7 @@ public class PurpurWorldConfig {
public boolean zombieJockeyOnlyBaby = true;
public double zombieJockeyChance = 0.05D;
public boolean zombieJockeyTryExistingChickens = true;

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Tweak console logging
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index b7709cbb1a78eb1daac2112cb9fbf5d379aaa662..2a73508dd8a59c6af8b65ab2db97b6e20b104c57 100644
index 8289334e77999f72214c330a3306cbfeb17afbf1..361dc9c3434d9b4ac4b9966fa09b17f6820b0f22 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -180,16 +180,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -193,16 +193,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
}
@@ -25,7 +25,7 @@ index b7709cbb1a78eb1daac2112cb9fbf5d379aaa662..2a73508dd8a59c6af8b65ab2db97b6e2
DedicatedServer.LOGGER.info("Loading properties");
DedicatedServerProperties dedicatedserverproperties = this.settings.getProperties();
@@ -212,6 +202,17 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -225,6 +215,17 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.plazmaConfigurations.initializeGlobalConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
this.plazmaConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
// Paper end - initialize global and world-defaults configuration
@@ -43,7 +43,7 @@ index b7709cbb1a78eb1daac2112cb9fbf5d379aaa662..2a73508dd8a59c6af8b65ab2db97b6e2
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) {
this.getProfileCache().save(false); // Paper
@@ -320,6 +321,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -330,6 +331,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
@@ -51,7 +51,7 @@ index b7709cbb1a78eb1daac2112cb9fbf5d379aaa662..2a73508dd8a59c6af8b65ab2db97b6e2
if (!this.usesAuthentication()) {
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
@@ -333,7 +335,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -343,7 +345,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
}
// Spigot end
@@ -61,10 +61,10 @@ index b7709cbb1a78eb1daac2112cb9fbf5d379aaa662..2a73508dd8a59c6af8b65ab2db97b6e2
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 60aa2984e490374ab2659f9d0a4821f1ea17c700..14d15dd0d4973957871f5c06042fcaa4ea8b7a8a 100644
index b863f6fe65c796a1d3102cc3eddb5d6c5becd3ac..2707a96f9e22469d008ec7d2fa8a8c497efaf8cf 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1469,6 +1469,7 @@ public abstract class PlayerList {
@@ -1467,6 +1467,7 @@ public abstract class PlayerList {
public void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer sender, ChatType.Bound params, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
// Paper end
boolean flag = this.verifyChatTrusted(message);

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Add missing purpur configuration options
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
index 518660609566ffe943103b305472590ee9f0a257..a6a697868b22224a26d6c39e594533c3b33e724b 100644
index bca7b7192debb3a34a08047010a2438e7b7e2a78..b77aa7518b6ca6c6a387fc0f7270d7ff2dca4ac9 100644
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
@@ -150,6 +150,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
@@ -33,14 +33,14 @@ index 518660609566ffe943103b305472590ee9f0a257..a6a697868b22224a26d6c39e594533c3
@Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index 8616a8c09a21f576a07daaa93ebf64e0f03d0c88..77c1bcde8cc5c2f51418a6f385ce84f202a13787 100644
index 24a1663cf1cd3f888981a13907811b55bdbf6133..fdc3aa9672077787e841d240fe1e690dcd9ca321 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -97,6 +97,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
@@ -93,6 +93,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
public int getPurpurBreedTime() {
return this.level().purpurConfig.camelBreedingTicks;
}
+
+
+ // Plazma start - Add missing purpur configuration options
+ @Override
+ public boolean isSensitiveToWater() {
@@ -51,15 +51,15 @@ index 8616a8c09a21f576a07daaa93ebf64e0f03d0c88..77c1bcde8cc5c2f51418a6f385ce84f2
+ public boolean isAlwaysExperienceDropper() {
+ return level().purpurConfig.camelAlwaysDropExp;
+ }
+ // Plazma end - Add missing purpur configuration options
+ // Plazma end - Add missing purpur configuration optionsurpur end
// Purpur end
@Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
index 37f1d3c656997906cef57d9dbefc226d04fc65fe..b3880426148bb1ffbf36113343c54850fc344d1c 100644
index ee8c232ddaa518377bdfa54e83ffc04f7a2f2c9a..2c45f4d321629979926bb9e677ba4bc8b44eec8d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
@@ -161,6 +161,23 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
@@ -160,6 +160,23 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
public float getJumpPower() {
return (getRider() != null && isControllable()) ? level().purpurConfig.frogRidableJumpHeight * this.getBlockJumpFactor() : super.getJumpPower();
}
@@ -84,10 +84,10 @@ index 37f1d3c656997906cef57d9dbefc226d04fc65fe..b3880426148bb1ffbf36113343c54850
public int getPurpurBreedTime() {
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
index 2a9c2a69a0589e4e7b7c79d3716376b360a2eba1..630eaae555403db79f4e16880ca443904b9254ab 100644
index 09c4cf772df4644413e40055fedcdf42ee8064fd..73b2e74199d54d87aa6d2b7132f10f29eefa11db 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -90,6 +90,23 @@ public class Tadpole extends AbstractFish {
@@ -93,6 +93,23 @@ public class Tadpole extends AbstractFish {
protected void registerGoals() {
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
}
@@ -112,12 +112,12 @@ index 2a9c2a69a0589e4e7b7c79d3716376b360a2eba1..630eaae555403db79f4e16880ca44390
@Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index 5e7d76dcdc170b809ab82f6e2259c9b4d3d741be..24e351b40745d15e065f4c3cd904596c6daf4cfb 100644
index 21bdcbd51d9f440e0734750b40cefa4c08cdaf5f..a2cc1efaa621861828b007759536ac49d7e3646e 100644
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -106,6 +106,18 @@ public class Sniffer extends Animal {
public boolean isControllable() {
return level().purpurConfig.snifferControllable;
@@ -119,6 +119,18 @@ public class Sniffer extends Animal {
public int getPurpurBreedTime() {
return this.level().purpurConfig.snifferBreedingTicks;
}
+
+ // Plazma start - Add missing purpur configuration options
@@ -135,7 +135,7 @@ index 5e7d76dcdc170b809ab82f6e2259c9b4d3d741be..24e351b40745d15e065f4c3cd904596c
@Override
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
index bf7ef72a7d92db8f11789a69583270644de0dac7..1f476a4fd148ac9a4c9ad5d12de46a16e4116239 100644
index 0bb577ec9ba0d23a741ccf067ac35f6be68312ca..358811e71b8b8a8a09fb6c56ed51bcc11b052add 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
@@ -147,6 +147,23 @@ public class Warden extends Monster implements VibrationSystem {
@@ -163,10 +163,10 @@ index bf7ef72a7d92db8f11789a69583270644de0dac7..1f476a4fd148ac9a4c9ad5d12de46a16
@Override
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
index 58af87b8faf4f8d6bdb111c49a429466acface68..22cc678f9bd39acc27ba2d2e7981f9e8026440d4 100644
index b04f7ce0805453f6c737fa9dc11c4129ca64e934..9840678549e25c6da00aea222a585e7f01ec1e0e 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
@@ -43,7 +43,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
@@ -45,12 +45,12 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
public ChestBoat(EntityType<? extends Boat> type, Level world) {
super(type, world);
@@ -175,7 +175,13 @@ index 58af87b8faf4f8d6bdb111c49a429466acface68..22cc678f9bd39acc27ba2d2e7981f9e8
}
public ChestBoat(Level world, double d0, double d1, double d2) {
@@ -170,7 +170,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
super(EntityType.CHEST_BOAT, world);
- this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
+ this.itemStacks = NonNullList.withSize(org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9, ItemStack.EMPTY); // Plazma - Add missing purpur configuration options
this.setPos(d0, d1, d2);
this.xo = d0;
this.yo = d1;
@@ -172,7 +172,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
@Override
public int getContainerSize() {
@@ -185,7 +191,7 @@ index 58af87b8faf4f8d6bdb111c49a429466acface68..22cc678f9bd39acc27ba2d2e7981f9e8
@Override
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 65b9e4fc073d0e97c6f90587d20e3ecbdaaf2c71..fc48ff9270e32c3b3dbf7ffd310cab7c33d459c0 100644
index f9779f8cf0399e434ebe9e49e7bae5386ce01410..c5cfda1a1f0bd434efcf32e253c87738eee92def 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -329,6 +329,7 @@ public class PurpurConfig {
@@ -205,13 +211,13 @@ index 65b9e4fc073d0e97c6f90587d20e3ecbdaaf2c71..fc48ff9270e32c3b3dbf7ffd310cab7c
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index d756c25e6d0af3153e510d0162e65348b1675366..d723b9b6818eae3c40f16f9aeab9604bf6ab03ae 100644
index 25c9a5b9b22a8680be8140f8c2dfd255dbab1bf7..08815190bbeb52cb7a006727aab76f59678dba81 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1170,7 +1170,15 @@ public class PurpurWorldConfig {
@@ -1173,7 +1173,15 @@ public class PurpurWorldConfig {
public boolean allayRidable = false;
public boolean allayRidableInWater = true;
public boolean allayControllable = true;
public List<String> allayRespectNBT = new ArrayList<>();
+ // Plazma start - Add missing purpur config options
+ public double allayMaxHealth = 20.0D;
+ public boolean allayTakeDamageFromWater = false;
@@ -224,23 +230,21 @@ index d756c25e6d0af3153e510d0162e65348b1675366..d723b9b6818eae3c40f16f9aeab9604b
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
@@ -1289,7 +1297,15 @@ public class PurpurWorldConfig {
@@ -1290,7 +1298,13 @@ public class PurpurWorldConfig {
public double camelMovementSpeedMin = 0.09D;
public double camelMovementSpeedMax = 0.09D;
public int camelBreedingTicks = 6000;
+ // Plazma start - Add missing purpur config options
+ //public boolean camelRidableInWater = false;
+ public boolean camelTakeDamageFromWater = false;
+ public boolean camelAlwaysDropExp = false;
private void camelSettings() {
+ //camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
+ camelTakeDamageFromWater = getBoolean("mobs.camel.takes-damage-from-water", camelTakeDamageFromWater);
+ camelAlwaysDropExp = getBoolean("mobs.camel.always-drop-exp", camelAlwaysDropExp);
+ // Plazma end - Add missing purpur configuration options
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
@@ -1717,7 +1733,15 @@ public class PurpurWorldConfig {
@@ -1718,7 +1732,15 @@ public class PurpurWorldConfig {
public boolean frogControllable = true;
public float frogRidableJumpHeight = 0.65F;
public int frogBreedingTicks = 6000;
@@ -256,7 +260,7 @@ index d756c25e6d0af3153e510d0162e65348b1675366..d723b9b6818eae3c40f16f9aeab9604b
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
@@ -2668,7 +2692,13 @@ public class PurpurWorldConfig {
@@ -2669,7 +2691,13 @@ public class PurpurWorldConfig {
public boolean snifferControllable = true;
public double snifferMaxHealth = 14.0D;
public int snifferBreedingTicks = 6000;
@@ -270,7 +274,7 @@ index d756c25e6d0af3153e510d0162e65348b1675366..d723b9b6818eae3c40f16f9aeab9604b
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
@@ -2767,7 +2797,15 @@ public class PurpurWorldConfig {
@@ -2768,7 +2796,15 @@ public class PurpurWorldConfig {
public boolean tadpoleRidable = false;
public boolean tadpoleRidableInWater = true;
public boolean tadpoleControllable = true;
@@ -286,7 +290,7 @@ index d756c25e6d0af3153e510d0162e65348b1675366..d723b9b6818eae3c40f16f9aeab9604b
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
@@ -2983,7 +3021,15 @@ public class PurpurWorldConfig {
@@ -2984,7 +3020,15 @@ public class PurpurWorldConfig {
public boolean wardenRidable = false;
public boolean wardenRidableInWater = true;
public boolean wardenControllable = true;

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Add option to change nether portal size
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
index 46910a3bdacc9df1835e16b300f9e107744d2660..9b372b494b831c374bab478267309544b4b31748 100644
index afe6b2170846273b41b694aa53dca4c31bf78b3f..52043e451ca0641c93205aac62aba5427625b81f 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
@@ -99,7 +99,7 @@ public class PortalShape {

View File

@@ -4,6 +4,18 @@ Date: Wed, 27 Sep 2023 21:18:22 +0900
Subject: [PATCH] Reduce create random instance
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4a265c97ea872b178286394e2b8d2382166e4cf0..f0f33f5aea9a9d7b4c9b761458d425f83e83f227 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -235,6 +235,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Nullable
private ServerStatus.Favicon statusIcon;
private final RandomSource random;
+ public static RandomSource random() { return getServer().random; } // Plazma - Expose random
public final DataFixer fixerUpper;
private String localIp;
private int port;
diff --git a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
index b47a8a082170bcb630c4354be7c77a4cac71d105..7fe6b99e146e7374cd29534f1e89046edd340a82 100644
--- a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
@@ -18,10 +30,10 @@ index b47a8a082170bcb630c4354be7c77a4cac71d105..7fe6b99e146e7374cd29534f1e89046e
double d1 = (double) (center.y - maxRange);
double d2 = (double) (center.x + maxRange);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 305b90d10a499e9731f5178433fb10207e428091..47a4e4082571e43946b510a8447627923ee4086c 100644
index 42a623254bd2886d09eb0cfeb01dd12d0dda19cf..feed838fe1ff9db60f1971cbafc25baf9af69fac 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -456,7 +456,7 @@ public class ServerPlayer extends Player {
@@ -482,7 +482,7 @@ public class ServerPlayer extends Player {
long l = k * k;
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
int j1 = this.getCoprime(i1);
@@ -30,7 +42,7 @@ index 305b90d10a499e9731f5178433fb10207e428091..47a4e4082571e43946b510a844762792
for (int l1 = 0; l1 < i1; ++l1) {
int i2 = (k1 + j1 * l1) % i1;
@@ -493,7 +493,7 @@ public class ServerPlayer extends Player {
@@ -519,7 +519,7 @@ public class ServerPlayer extends Player {
long l = k * k;
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
int j1 = this.getCoprime(i1);
@@ -40,20 +52,20 @@ index 305b90d10a499e9731f5178433fb10207e428091..47a4e4082571e43946b510a844762792
for (int l1 = 0; l1 < i1; ++l1) {
int i2 = (k1 + j1 * l1) % i1;
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index c0729d3a38e0b9924711c0ca96afd138fa69fa3b..d45a435a3aa8fc5b8f028e0455c3789b36cbdf12 100644
index 3b4fadb37eafb2f7b0ce4d6b276d2fdaa8287521..ba041288f9619870ab08c2956262d35eed85b44b 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -71,7 +71,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -91,7 +91,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
this.serverId = "";
this.server = server;
this.connection = connection;
- this.challenge = Ints.toByteArray(RandomSource.create().nextInt());
+ this.challenge = Ints.toByteArray((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? server.random() : RandomSource.create()).nextInt()); // Plazma - Reduce create random instance
+ this.challenge = Ints.toByteArray((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? MinecraftServer.random() : RandomSource.create()).nextInt()); // Plazma - Reduce create random instance
this.transferred = transferred;
}
@Override
diff --git a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
index 0e0867d7add9a024bbe9471f8ff92bbb25996a3d..034b41aa8c8a5571f21530a4e8588b1cc110ecf3 100644
index 0e0867d7add9a024bbe9471f8ff92bbb25996a3d..c0fad810538ede0f248898db2e68625b96e56c16 100644
--- a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
+++ b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
@@ -341,7 +341,7 @@ public class QueryThreadGs4 extends GenericThread {
@@ -61,12 +73,12 @@ index 0e0867d7add9a024bbe9471f8ff92bbb25996a3d..034b41aa8c8a5571f21530a4e8588b1c
this.identBytes[3] = bs[6];
this.ident = new String(this.identBytes, StandardCharsets.UTF_8);
- this.challenge = RandomSource.create().nextInt(16777216);
+ this.challenge = (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create()).nextInt(16777216); // Plazma - Reduce create random instance
+ this.challenge = (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.random() : RandomSource.create()).nextInt(16777216); // Plazma - Reduce create random instance
this.challengeBytes = String.format(Locale.ROOT, "\t%s%d\u0000", this.ident, this.challenge).getBytes(StandardCharsets.UTF_8);
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
index 3fac11bf02652b5f51f30f99bdf516504467d0d2..add054ac26890b627d1eee87d1b0f88a84bf2aac 100644
index 3fac11bf02652b5f51f30f99bdf516504467d0d2..9d939624756e8a7a07a787f9807f095c5033b234 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
@@ -15,7 +15,7 @@ import net.minecraft.util.RandomSource;
@@ -74,12 +86,12 @@ index 3fac11bf02652b5f51f30f99bdf516504467d0d2..add054ac26890b627d1eee87d1b0f88a
public class ShufflingList<U> implements Iterable<U> {
protected final List<ShufflingList.WeightedEntry<U>> entries;
- private final RandomSource random = RandomSource.create();
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - Reduce create random instance
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.random() : RandomSource.create(); // Plazma - Reduce create random instance
private final boolean isUnsafe; // Paper - Fix Concurrency issue in ShufflingList during worldgen
public ShufflingList() {
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
index e553f52de2e0b30511ac1b73cb436374017cd7d7..cbb94ec3111865563e451e758e5b9813f3c6102f 100644
index 09a7b418ddf564c0be13297f7c216db2e7ae1578..703006eb5df8099c4f51cdb4e41f95cacfbe43a6 100644
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
@@ -8,7 +8,7 @@ import net.minecraft.world.entity.ai.memory.MemoryModuleType;
@@ -87,12 +99,12 @@ index e553f52de2e0b30511ac1b73cb436374017cd7d7..cbb94ec3111865563e451e758e5b9813
public abstract class Sensor<E extends LivingEntity> {
- private static final RandomSource RANDOM = RandomSource.createThreadSafe();
+ private static final RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.ignoreThreadSafeRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.createThreadSafe(); // Plazma - Reduce create random instance
+ private static final RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.ignoreThreadSafeRandom ? net.minecraft.server.MinecraftServer.random() : RandomSource.createThreadSafe(); // Plazma - Reduce create random instance
private static final int DEFAULT_SCAN_RATE = 20;
protected static final int TARGETING_RANGE = 16;
private static final TargetingConditions TARGET_CONDITIONS = TargetingConditions.forNonCombat().range(16.0);
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java b/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
index 3d792957f27fd4bdfad8d76262a8e2a2012bf35f..2d96cf85fb9250bbbddb8065307a47929c0c905c 100644
index 3d792957f27fd4bdfad8d76262a8e2a2012bf35f..71539b5910692489cad6f78ac90f3aabc4e58236 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
@@ -33,7 +33,7 @@ public class AngerManagement {
@@ -100,12 +112,12 @@ index 3d792957f27fd4bdfad8d76262a8e2a2012bf35f..2d96cf85fb9250bbbddb8065307a4792
protected static final int MAX_ANGER = 150;
private static final int DEFAULT_ANGER_DECREASE = 1;
- private int conversionDelay = Mth.randomBetweenInclusive(RandomSource.create(), 0, 2);
+ private int conversionDelay = Mth.randomBetweenInclusive((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create()), 0, 2); // Plazma - Reduce create random instance
+ private int conversionDelay = Mth.randomBetweenInclusive((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.random() : RandomSource.create()), 0, 2); // Plazma - Reduce create random instance
int highestAnger;
private static final Codec<Pair<UUID, Integer>> SUSPECT_ANGER_PAIR = RecordCodecBuilder.create(
instance -> instance.group(
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
index 752b38d45d59d8b3cd492246e5aa4f378a78734d..38b534e4613641046ed3cd048f52dff0888acda2 100644
index 96e9fce5f9084737d2fcf4deb83305733b480179..43da8ea227b2b01d6975a3f4f209099d350386f6 100644
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
@@ -32,7 +32,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
@@ -113,12 +125,12 @@ index 752b38d45d59d8b3cd492246e5aa4f378a78734d..38b534e4613641046ed3cd048f52dff0
private static final int SPAWN_ONE_IN_X_CHANCE = 10;
private static final int NUMBER_OF_SPAWN_ATTEMPTS = 10;
- private final RandomSource random = RandomSource.create();
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - reduce create random instace
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.random() : RandomSource.create(); // Plazma - reduce create random instace
private final ServerLevelData serverLevelData;
private int tickDelay;
private int spawnDelay;
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
index 91497f5e6c07fcf1b05eca6846c51e1a15ed3bc0..1317d8289898798a9d86a4c995a4a1a317631bf7 100644
index 35299affb699d745804a3b60cb78b9323f3e068e..75890635b357bc54a03ed00bcfb3e287f1eb2cff 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -87,7 +87,7 @@ public class FishingHook extends Projectile {
@@ -131,10 +143,10 @@ index 91497f5e6c07fcf1b05eca6846c51e1a15ed3bc0..1317d8289898798a9d86a4c995a4a1a3
this.currentState = FishingHook.FishHookState.FLYING;
this.noCulling = true;
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..cb81994735650ec7c54b3f5a97d94e069d254c35 100644
index fdff9788eaf663be79214b2ca491f0f0444f6136..de50b06f13df481fa59e1abe16d5181b8124b427 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -114,7 +114,7 @@ public class Raid {
@@ -118,7 +118,7 @@ public class Raid {
public Raid(int id, ServerLevel world, BlockPos pos) {
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
@@ -143,7 +155,7 @@ index bf2c23fad919820512ce031cf28a000b249b2876..cb81994735650ec7c54b3f5a97d94e06
this.waveSpawnPos = Optional.empty();
this.id = id;
this.level = world;
@@ -128,7 +128,7 @@ public class Raid {
@@ -132,7 +132,7 @@ public class Raid {
public Raid(ServerLevel world, CompoundTag nbt) {
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
@@ -153,10 +165,10 @@ index bf2c23fad919820512ce031cf28a000b249b2876..cb81994735650ec7c54b3f5a97d94e06
this.level = world;
this.id = nbt.getInt("Id");
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
index 1a686780e5aadcbdcfceb770ce8e283b38115209..6c1ba9631e56c336ed3ddee8e6435734597a3aa3 100644
index c3a644b0f8c7c5622acc9e1a496f95d432718806..ce8fb88b31af1d27a7118735154673a9f05499ec 100644
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
@@ -97,7 +97,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
@@ -95,7 +95,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
}
// Purpur end
};
@@ -166,23 +178,23 @@ index 1a686780e5aadcbdcfceb770ce8e283b38115209..6c1ba9631e56c336ed3ddee8e6435734
this.costs = new int[3];
this.enchantClue = new int[]{-1, -1, -1};
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 0be03430d8257d918b7cf646af518473ae027399..824f210af6d8467ed596ece1573740d99b92b7ba 100644
index f5e84bf8817e2d53557e0909d8c9e0e0e8206a16..1792f18397d733d87ef067a7daaf076be4163c63 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -92,7 +92,7 @@ public class Explosion {
@@ -93,7 +93,7 @@ public class Explosion {
}
public Explosion(Level world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.BlockInteraction destructionType, ParticleOptions particle, ParticleOptions emitterParticle, SoundEvent soundEvent) {
public Explosion(Level world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.BlockInteraction destructionType, ParticleOptions particle, ParticleOptions emitterParticle, Holder<SoundEvent> soundEvent) {
- this.random = RandomSource.create();
+ this.random = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
this.toBlow = new ObjectArrayList();
this.hitPlayers = Maps.newHashMap();
this.level = world;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 16e6716f70d5b9090f29f8b2320302d98dd087c2..72420d9e79d4b480fa060f9b910cea7b677a1427 100644
index 648b21e3a83e0c35be739bd4ebfa930b84b1e4dd..9e8faa787fe3f924da898244a00eb3da3354d68b 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -122,16 +122,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -121,16 +121,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final Thread thread;
private final boolean isDebug;
private int skyDarken;
@@ -198,14 +210,14 @@ index 16e6716f70d5b9090f29f8b2320302d98dd087c2..72420d9e79d4b480fa060f9b910cea7b
@Deprecated
- private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
+ private final RandomSource threadSafeRandom = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.ignoreThreadSafeRandom ? random : RandomSource.createThreadSafe(); // Plazma - Reduce create random instace
private final ResourceKey<DimensionType> dimensionTypeId;
private final Holder<DimensionType> dimensionTypeRegistration;
public final WritableLevelData levelData;
// private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove Mojang's Profiler
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 4997f120aa9877c199fbcaa0c2f65226e13b5a23..af393eaf3d21a260f0bfff5eaeb78c389161bffd 100644
index fb9611866671880fc7a1a969da928b8f2ad15269..44962ecedf724e941e59913188afe4cfad252fc8 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
@@ -363,7 +363,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
@@ -357,7 +357,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
}
private static void spawnGatewayPortal(ServerLevel world, BlockPos pos, EndGatewayConfiguration config) {
@@ -215,7 +227,7 @@ index 4997f120aa9877c199fbcaa0c2f65226e13b5a23..af393eaf3d21a260f0bfff5eaeb78c38
@Override
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
index 798e22fb4d685b5845ebf687e8004e94f13a9751..189f425565c9c38b29031ae26de667422eb3b6bb 100644
index a6b6e5ea191c0e2cd7a2e4f01b89d8af40a83c1b..19769ac9fa688969fd2db7c9a5e92eaadac124c4 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
@@ -224,7 +224,7 @@ public class ChunkGeneratorStructureState {
@@ -223,7 +235,7 @@ index 798e22fb4d685b5845ebf687e8004e94f13a9751..189f425565c9c38b29031ae26de66742
int k = placement.spread();
HolderSet<Biome> holderset = placement.preferredBiomes();
- RandomSource randomsource = RandomSource.create();
+ RandomSource randomsource = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - Reduce create random instace
+ RandomSource randomsource = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.random() : RandomSource.create(); // Plazma - Reduce create random instace
// Paper start - Add missing structure set seed configs
if (this.conf.strongholdSeed != null && structureSetEntry.is(net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS)) {
@@ -241,7 +253,7 @@ index 7bbe93966fa00b7001da53bf2f22f4d942b7cc22..6c5eececc83571b0f60e7f672ed185e1
} else if (flag1) {
fight.setRespawnStage(SUMMONING_DRAGON); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index d4f903c402765c6e8e1db99e148613748f530726..c8d76fdee94a0ffb76fcb476ca386acf154dda28 100644
index 18a1b4325cac81b040596071dab99ef9bf6f3142..ab492b184a4ecdefc423823fc72abd800b71f016 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -472,7 +472,7 @@ public class EndDragonFight {

View File

@@ -7,10 +7,10 @@ Subject: [PATCH] Apply various optimizations
Akarin - Swaps the predicate order of collision
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f2c6b52fe7fbb05afa0074684cd195f6ae598f1f..f16a347e0e263a0479a73cb14626e31c9de37e6c 100644
index 3aae4fa4176c0bf170f4532ae187e3122c142a6a..215368ec72d4763479c2cdc668c3e2389ceb4f7a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2154,8 +2154,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -2201,8 +2201,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void playerTouch(Player player) {}
public void push(Entity entity) {
@@ -21,7 +21,7 @@ index f2c6b52fe7fbb05afa0074684cd195f6ae598f1f..f16a347e0e263a0479a73cb14626e31c
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper - Collision option for requiring a player participant
double d0 = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();
@@ -2183,8 +2184,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -2230,8 +2231,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
entity.push(d0, 0.0D, d1);
}
}

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Do not refresh LootTable for non player interaction
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 fa64bf5ad13c278438039b663ea3134e72108411..3ec9cb7c98cd5d3cb26e4a27174a75fe243c81c0 100644
index 17da915ffa638500a83b67db0940a7b9a9b333a1..27a112818c000f4e649f044b7960ca988976876b 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

@@ -1,29 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 27 Sep 2023 22:13:07 +0900
Subject: [PATCH] Avoid double I/O operation on load player file
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 e0f085169fafa5e574caf368efa343514540b348..042617c7de30707f66e60536cebc31e210647b64 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -60,7 +60,8 @@ public class PlayerDataStorage {
File file = new File(this.playerDir, player.getStringUUID() + ".dat");
// Spigot Start
boolean usingWrongFile = false;
- if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
+ boolean isNormalFile = file.exists() && file.isFile(); // Plazma - Avoid double I/O operation
+ if ( org.bukkit.Bukkit.getOnlineMode() && !isNormalFile ) // Paper - Check online mode first // Plazma - Avoid double I/O operation
{
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + player.getScoreboardName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
if ( file.exists() )
@@ -71,7 +72,7 @@ public class PlayerDataStorage {
}
// Spigot End
- if (file.exists() && file.isFile()) {
+ if (isNormalFile) { // Plazma - Avoid double I/O operation
nbttagcompound = NbtIo.readCompressed(file.toPath(), NbtAccounter.unlimitedHeap());
}
// Spigot Start

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Do not load chunks to spawn phantom
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 0847aef56d8608cb1403485f231f30b2527f35ab..fee30f686a5d1ee50a00c2073efd5b0a80e85179 100644
index 04f67f7b43d2f461c776c76614dc3e5f060aea63..b3fe0dd152b3e2e1b83b4ec2270d387e6117ec1c 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -71,6 +71,7 @@ public class PhantomSpawner implements CustomSpawner {
@@ -70,6 +70,7 @@ 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));

View File

@@ -6,16 +6,16 @@ Subject: [PATCH] Add option to disable moved to quickly check for specific
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f7ac60e1aa188ec25a4c5d326cdd4a109a54101c..613f12a7194920690c42ffca2fdf6908700516e5 100644
index 6d9242bc79526ebe4fdfe1f5d0ded429da2a9f95..4578339fc2ae7bff119a10744e2c2b3d4ac6cfd4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1472,6 +1472,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1444,6 +1444,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Paper end - Prevent moving into unloaded chunks
+ if (!this.player.getBukkitEntity().hasPermission("plazma.bypass-moved-to-quickly-check") || !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.checkSpectatorMovedToQuickly && this.player.isSpectator())) // Plazma - Options to bypass moved to quickly check
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !flag)) {
float f2 = flag ? 300.0F : 100.0F;
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index a060257a62da7ed02b342b426e18e5f02ecdbdc9..f7e4d14a7eaa3e35c9b03f3c6a01ae8712ded569 100644

View File

@@ -7,10 +7,10 @@ Subject: [PATCH] Ignore useless entity packets
- PurpurMC/Purpur
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index cf098d4a3111771c13766285c5ec5f1fc1f539a4..433e9a06db191f8a0ff6c23d1ac6122606e67959 100644
index b86ae3929ec5d3c4eb69d92774dc445aa5b3093e..44e4a768a0ccde83cae5547c7ba07744cec4c693 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -207,6 +207,8 @@ public class ServerEntity {
@@ -205,6 +205,8 @@ public class ServerEntity {
flag4 = true;
flag5 = true;
}
@@ -19,7 +19,7 @@ index cf098d4a3111771c13766285c5ec5f1fc1f539a4..433e9a06db191f8a0ff6c23d1ac61226
}
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
@@ -281,6 +283,19 @@ public class ServerEntity {
@@ -288,6 +290,19 @@ public class ServerEntity {
});
}

View File

@@ -5,22 +5,22 @@ Subject: [PATCH] Configurable entity sensor tick
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 41ee792f572b13054084b9ad6c6e4cf67ed10290..0d83baabdfabff925c11d363a78414afebe513d3 100644
index 274ca06fbda0f54805fc82614d43b6e1a4a5d4a8..688f3c01cb939a6c959efbb3b59ac8ee60db3633 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -938,10 +938,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
}
// Paper end - Allow nerfed mobs to jump and float
//this.level().getProfiler().push("sensing"); // Purpur
@@ -995,10 +995,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
//ProfilerFiller gameprofilerfiller = this.level().getProfiler(); // Purpur
//gameprofilerfiller.push("sensing"); // Purpur
- this.sensing.tick();
+ //this.sensing.tick(); // Plazma - Moved down
//this.level().getProfiler().pop(); // Purpur
int i = this.level().getServer().getTickCount() + this.getId();
//gameprofilerfiller.pop(); // Purpur
int i = this.tickCount + this.getId();
+ if (i % this.level().plazmaConfig().entity.sensorTick == 0) this.sensing.tick(); // Plazma - Configurable entity sensor tick
if (i % 2 != 0 && this.tickCount > 1) {
//this.level().getProfiler().push("targetSelector"); // Purpur
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
//gameprofilerfiller.push("targetSelector"); // Purpur
this.targetSelector.tickRunningGoals(false);
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index c8a3e91d0d6510b519e927027f5a534cddf7d0a3..bc283729cab4df2c596febf1df54241571227564 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Configurable cave lava sea level
This patch also fix MC-237017.
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..a85b1ebb4236f131b9be0104c4aa56f22e661441 100644
index 8ce870a5341a61fbbaf42021ef7f7f615a6a3e09..e3990d5f5a49aca501289e92f7462a5f2709db9b 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
@@ -72,6 +72,15 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {

View File

@@ -30,10 +30,10 @@ index bc283729cab4df2c596febf1df54241571227564..1e7c23c8851ba1d0f37d2b17fd334220
public Structure structure;
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 56e52b16b419c882440a15947f037ae1a902bc70..583647f6c9ca0fb092f30c97693bd548f692dfd3 100644
index de2b469f06f6679aed1d20156052bfbef5e7c30b..ebd0764dde2e1d79fb41b5d881990ee07a0590b1 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -68,29 +68,36 @@ public class ActivationRange
@@ -64,29 +64,36 @@ public class ActivationRange
Activity.PANIC
};

View File

@@ -17,10 +17,10 @@ index 57d0cd3ad6f972e986c72a57f1a6e36003f190c2..50d97c5ab33f33b81dbafd7cf42da5af
public ZeroCollidingReferenceStateTable(final StateHolder<?, ?> state, final Map<Property<?>, Comparable<?>> this_map) {
diff --git a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
index 2630f54d499abbe52798f97c8ea14a8d0bd75e99..014ccbafd8beecb7f3bfeea0cdaa6627a81796bd 100644
index 45744d86e9582a93a0cec26009deea091080fbbe..5dd9473c55a08a775aa406901a0e54ef6f63837a 100644
--- a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
+++ b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
@@ -115,6 +115,12 @@ public abstract class StateHolder<O, S> {
@@ -114,6 +114,12 @@ public abstract class StateHolder<O, S> {
}
public <T extends Comparable<T>, V extends T> S trySetValue(Property<T> property, V value) {
@@ -33,7 +33,7 @@ index 2630f54d499abbe52798f97c8ea14a8d0bd75e99..014ccbafd8beecb7f3bfeea0cdaa6627
Comparable<?> comparable = this.values.get(property);
if (comparable != null && !comparable.equals(value)) {
S object = this.neighbours.get(property, value);
@@ -126,10 +132,11 @@ public abstract class StateHolder<O, S> {
@@ -125,10 +131,11 @@ public abstract class StateHolder<O, S> {
} else {
return (S)this;
}
@@ -46,7 +46,7 @@ index 2630f54d499abbe52798f97c8ea14a8d0bd75e99..014ccbafd8beecb7f3bfeea0cdaa6627
throw new IllegalStateException();
} else {
Table<Property<?>, Comparable<?>, S> table = HashBasedTable.create();
@@ -144,7 +151,7 @@ public abstract class StateHolder<O, S> {
@@ -143,7 +150,7 @@ public abstract class StateHolder<O, S> {
}
}

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Suppress errors from dirty attributes
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 433e9a06db191f8a0ff6c23d1ac6122606e67959..149ea6b62c88200ecfc50c825a1dcdffa56d9fcb 100644
index 44e4a768a0ccde83cae5547c7ba07744cec4c693..7954be9d04d88444601144bab560701c04274aa7 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -404,7 +404,8 @@ public class ServerEntity {
@@ -406,7 +406,8 @@ public class ServerEntity {
}
if (this.entity instanceof LivingEntity) {
@@ -18,7 +18,7 @@ index 433e9a06db191f8a0ff6c23d1ac6122606e67959..149ea6b62c88200ecfc50c825a1dcdff
if (!set.isEmpty()) {
// CraftBukkit start - Send scaled max health
@@ -415,7 +416,7 @@ public class ServerEntity {
@@ -417,7 +418,7 @@ public class ServerEntity {
this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set));
}

View File

@@ -7,10 +7,10 @@ Subject: [PATCH] Add entity spawn deadlock timer
- AbsolemJackdaw/FixMySpawnR
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index 40c199812ecf7b16fe5a17c18cb0d6d3ce258910..f01390790cab0425e5d702d93b6755be41e94313 100644
index 967af8771ff8564c715d89f4b4b69b16c25add59..2ac5fb585636523787e05edaa58a4fa34a39ef28 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -48,6 +48,8 @@ public abstract class BaseSpawner {
@@ -50,6 +50,8 @@ public abstract class BaseSpawner {
public int requiredPlayerRange = 16;
public int spawnRange = 4;
private int tickDelay = 0; // Paper - Configurable mob spawner tick rate
@@ -19,7 +19,7 @@ index 40c199812ecf7b16fe5a17c18cb0d6d3ce258910..f01390790cab0425e5d702d93b6755be
public BaseSpawner() {}
@@ -83,6 +85,17 @@ public abstract class BaseSpawner {
@@ -85,6 +87,17 @@ public abstract class BaseSpawner {
}
public void serverTick(ServerLevel world, BlockPos pos) {
@@ -37,26 +37,27 @@ index 40c199812ecf7b16fe5a17c18cb0d6d3ce258910..f01390790cab0425e5d702d93b6755be
if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick
// Paper start - Configurable mob spawner tick rate
if (spawnDelay > 0 && --tickDelay > 0) return;
@@ -280,6 +293,12 @@ public abstract class BaseSpawner {
if (nbt.contains("SpawnRange", 99)) {
@@ -290,6 +303,13 @@ public abstract class BaseSpawner {
this.spawnRange = nbt.getShort("SpawnRange");
}
+ // Plazma start - Add entity spawn deadlock timer
+ if (nbt.contains("Plazma.SpawnerTicks", 99)) {
+ this.blockExistsTick = nbt.getInt("Plazma.SpawnerTicks");
+ this.blockLockedByTime = nbt.getBoolean("Plazma.SpawnerLocked");
+ }
+ // Plazma end - Add entity spawn deadlock timer
+
this.displayEntity = null;
}
@@ -309,6 +328,8 @@ public abstract class BaseSpawner {
@@ -318,6 +338,8 @@ public abstract class BaseSpawner {
}));
}
+ nbt.putInt("Plazma.SpawnerTicks", this.blockExistsTick); // Plazma - Add entity spawn deadlock timer
+ nbt.putBoolean("Plazma.SpawnerLocked", this.blockLockedByTime); // Plazma - Add entity spawn deadlock timer
nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).result().orElseThrow());
nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).getOrThrow());
return nbt;
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java

View File

@@ -288,10 +288,10 @@ index 0000000000000000000000000000000000000000..d11579075e653868a43fe826bdf9b41d
+
+}
diff --git a/src/main/java/net/minecraft/util/random/WeightedRandomList.java b/src/main/java/net/minecraft/util/random/WeightedRandomList.java
index 1bcb5a58b945cdb3dc94efb314d7ba41fbb38e07..3bd989b2af76392a31d2aca23fdab20a79dc3933 100644
index ef44047c3ea850fe52370b8176efbdf0515d20d6..30efa8704c1ae94027272602687cbc4a2bc8a772 100644
--- a/src/main/java/net/minecraft/util/random/WeightedRandomList.java
+++ b/src/main/java/net/minecraft/util/random/WeightedRandomList.java
@@ -8,10 +8,10 @@ import net.minecraft.util.RandomSource;
@@ -10,10 +10,10 @@ import net.minecraft.util.RandomSource;
public class WeightedRandomList<E extends WeightedEntry> {
private final int totalWeight;

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Improve SwingTime ticking
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index d6705dce3bc8c1964184fe425386b3f3c0a8202e..6ca6d44114bb2e18786b9fa3c0e2c78c1b07ea75 100644
index fa698cfefccdddf5e5e9938a2959004c70f743a7..b24754e36e210a635524be099cffe4553220a6a9 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2624,6 +2624,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -2654,6 +2654,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void updateSwingTime() {

View File

@@ -0,0 +1,152 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 11 Jan 2024 13:40:41 +0900
Subject: [PATCH] Save Json list asynchronously
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
index 22c4f8dea99f92a1eb3da2baf0a15bf9d2ca0462..20c531f11b310dab0a867e589c769393ed835df5 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
@@ -58,21 +58,23 @@ public class DedicatedPlayerList extends PlayerList {
this.loadWhiteList();
}
+ // Plazma start - Save JSON list asynchronously
private void saveIpBanList() {
- try {
- this.getIpBans().save();
- } catch (IOException var2) {
- LOGGER.warn("Failed to save ip banlist: ", (Throwable)var2);
- }
+ this.getIpBans().save();
}
private void saveUserBanList() {
- try {
- this.getBans().save();
- } catch (IOException var2) {
- LOGGER.warn("Failed to save user banlist: ", (Throwable)var2);
- }
+ this.getBans().save();
+ }
+
+ private void saveOps() {
+ this.getOps().save();
+ }
+
+ private void saveWhiteList() {
+ this.getWhiteList().save();
}
+ // Plazma end - Save JSON list asynchronously
private void loadIpBanList() {
try {
@@ -98,14 +100,6 @@ public class DedicatedPlayerList extends PlayerList {
}
}
- private void saveOps() {
- try {
- this.getOps().save();
- } catch (Exception var2) {
- LOGGER.warn("Failed to save operators list: ", (Throwable)var2);
- }
- }
-
private void loadWhiteList() {
try {
this.getWhiteList().load();
@@ -114,14 +108,6 @@ public class DedicatedPlayerList extends PlayerList {
}
}
- private void saveWhiteList() {
- try {
- this.getWhiteList().save();
- } catch (Exception var2) {
- LOGGER.warn("Failed to save white-list: ", (Throwable)var2);
- }
- }
-
@Override
public boolean isWhiteListed(GameProfile profile) {
return !this.isUsingWhitelist() || this.isOp(profile) || this.getWhiteList().isWhiteListed(profile);
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index c038da20b76c0b7b1c18471b20be01e849d29f3a..0735a0bd182635e1969d19336b46bc72b14e555f 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -42,13 +42,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
public void add(V entry) {
this.map.put(this.getKeyForUser(entry.getUser()), entry);
-
- try {
- this.save();
- } catch (IOException ioexception) {
- StoredUserList.LOGGER.warn("Could not save the list after adding a user.", ioexception);
- }
-
+ this.save(); // Plazma - Save Json list asynchronously
}
@Nullable
@@ -62,13 +56,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
public void remove(K key) {
this.map.remove(this.getKeyForUser(key));
-
- try {
- this.save();
- } catch (IOException ioexception) {
- StoredUserList.LOGGER.warn("Could not save the list after removing a user.", ioexception);
- }
-
+ this.save(); // Plazma - Save Json list asynchronously
}
public void remove(StoredUserEntry<K> entry) {
@@ -102,7 +90,9 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
return this.map.values();
}
- public void save() throws IOException {
+ // Plazma start - Save Json list asynchronously
+ public void save()/* throws IOException*/ {
+ io.papermc.paper.util.MCUtil.scheduleAsyncTask(() -> {
this.removeExpired(); // Paper - remove expired values before saving
JsonArray jsonarray = new JsonArray();
Stream<JsonObject> stream = this.map.values().stream().map((jsonlistentry) -> { // CraftBukkit - decompile error
@@ -114,27 +104,16 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
Objects.requireNonNull(jsonarray);
stream.forEach(jsonarray::add);
- BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8);
- try {
+ try (BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8)) {
StoredUserList.GSON.toJson(jsonarray, StoredUserList.GSON.newJsonWriter(bufferedwriter));
- } catch (Throwable throwable) {
- if (bufferedwriter != null) {
- try {
- bufferedwriter.close();
- } catch (Throwable throwable1) {
- throwable.addSuppressed(throwable1);
- }
- }
-
- throw throwable;
- }
-
- if (bufferedwriter != null) {
- bufferedwriter.close();
+ } catch (IOException e) {
+ StoredUserList.LOGGER.warn("Failed to asynchronously save file " + this.file, e);
}
+ });
}
+ // Plazma end - Save Json list asynchronously
public void load() throws IOException {
if (this.file.exists()) {

View File

@@ -1,239 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 11 Jan 2024 13:40:41 +0900
Subject: [PATCH] Save Json list asynchronously
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java b/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java
index 554f4d4e63c1431721989e6f502a32ccc53a8807..b85bc5834d90f20d46f640621abec891456b47a0 100644
--- a/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java
@@ -17,7 +17,7 @@ public final class ChunkList implements Iterable<LevelChunk> {
this.chunkToIndex.defaultReturnValue(Integer.MIN_VALUE);
}
- protected static final LevelChunk[] EMPTY_LIST = new LevelChunk[0];
+ protected static final LevelChunk[] EMPTY_LIST = new LevelChunk[0]; // Plazma - Reduce allocations (mark)
protected LevelChunk[] chunks = EMPTY_LIST;
protected int count;
diff --git a/src/main/java/io/papermc/paper/plugin/manager/DummyBukkitPluginLoader.java b/src/main/java/io/papermc/paper/plugin/manager/DummyBukkitPluginLoader.java
index aef19b44075a3b2e8696315baa89117dd8ebb513..6370d3f4451de4ca12a8bcc2661e4b2b4833fc0e 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/DummyBukkitPluginLoader.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/DummyBukkitPluginLoader.java
@@ -30,7 +30,7 @@ import java.util.regex.Pattern;
@ApiStatus.Internal
public class DummyBukkitPluginLoader implements PluginLoader {
- private static final Pattern[] PATTERNS = new Pattern[0];
+ private static final Pattern[] PATTERNS = new Pattern[0]; // Plazma - Reduce allocations (mark)
@Override
public @NotNull Plugin loadPlugin(@NotNull File file) throws InvalidPluginException, UnknownDependencyException {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
index 22c4f8dea99f92a1eb3da2baf0a15bf9d2ca0462..20c531f11b310dab0a867e589c769393ed835df5 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
@@ -58,21 +58,23 @@ public class DedicatedPlayerList extends PlayerList {
this.loadWhiteList();
}
+ // Plazma start - Save JSON list asynchronously
private void saveIpBanList() {
- try {
- this.getIpBans().save();
- } catch (IOException var2) {
- LOGGER.warn("Failed to save ip banlist: ", (Throwable)var2);
- }
+ this.getIpBans().save();
}
private void saveUserBanList() {
- try {
- this.getBans().save();
- } catch (IOException var2) {
- LOGGER.warn("Failed to save user banlist: ", (Throwable)var2);
- }
+ this.getBans().save();
+ }
+
+ private void saveOps() {
+ this.getOps().save();
+ }
+
+ private void saveWhiteList() {
+ this.getWhiteList().save();
}
+ // Plazma end - Save JSON list asynchronously
private void loadIpBanList() {
try {
@@ -98,14 +100,6 @@ public class DedicatedPlayerList extends PlayerList {
}
}
- private void saveOps() {
- try {
- this.getOps().save();
- } catch (Exception var2) {
- LOGGER.warn("Failed to save operators list: ", (Throwable)var2);
- }
- }
-
private void loadWhiteList() {
try {
this.getWhiteList().load();
@@ -114,14 +108,6 @@ public class DedicatedPlayerList extends PlayerList {
}
}
- private void saveWhiteList() {
- try {
- this.getWhiteList().save();
- } catch (Exception var2) {
- LOGGER.warn("Failed to save white-list: ", (Throwable)var2);
- }
- }
-
@Override
public boolean isWhiteListed(GameProfile profile) {
return !this.isUsingWhitelist() || this.isOp(profile) || this.getWhiteList().isWhiteListed(profile);
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index 1289e8e9c54a584f5037ea8e852df37376af093d..2014e0c4f412bead5881de588ec941a9a5ae3565 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -43,11 +43,11 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
public void add(V entry) {
this.map.put(this.getKeyForUser(entry.getUser()), entry);
- try {
+ //try { // Plazma - Save Json list asynchronously
this.save();
- } catch (IOException ioexception) {
+ /*} catch (IOException ioexception) { // Plazma - Save Json list asynchronously
StoredUserList.LOGGER.warn("Could not save the list after adding a user.", ioexception);
- }
+ }*/ // Plazma - Save Json list asynchronously
}
@@ -63,11 +63,11 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
public void remove(K key) {
this.map.remove(this.getKeyForUser(key));
- try {
+ //try { // Plazma - Save Json list asynchronously
this.save();
- } catch (IOException ioexception) {
+ /*} catch (IOException ioexception) { // Plazma - Save Json list asynchronously
StoredUserList.LOGGER.warn("Could not save the list after removing a user.", ioexception);
- }
+ }*/ // Plazma - Save Json list asynchronously
}
@@ -102,7 +102,10 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
return this.map.values();
}
- public void save() throws IOException {
+ // Plazma start - Save Json list asynchronously
+ public void save()/* throws IOException*/ {
+ io.papermc.paper.util.MCUtil.scheduleAsyncTask(() -> {
+
this.removeExpired(); // Paper - remove expired values before saving
JsonArray jsonarray = new JsonArray();
Stream<JsonObject> stream = this.map.values().stream().map((jsonlistentry) -> { // CraftBukkit - decompile error
@@ -114,27 +117,16 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
Objects.requireNonNull(jsonarray);
stream.forEach(jsonarray::add);
- BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8);
- try {
+ try (BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8)) {
StoredUserList.GSON.toJson(jsonarray, bufferedwriter);
- } catch (Throwable throwable) {
- if (bufferedwriter != null) {
- try {
- bufferedwriter.close();
- } catch (Throwable throwable1) {
- throwable.addSuppressed(throwable1);
- }
- }
-
- throw throwable;
- }
-
- if (bufferedwriter != null) {
- bufferedwriter.close();
+ } catch (IOException e) {
+ StoredUserList.LOGGER.warn("Failed to asynchronously save file " + this.file, e);
}
+ });
}
+ // Plazma end - Save Json list asynchronously
public void load() throws IOException {
if (this.file.exists()) {
diff --git a/src/main/java/net/minecraft/world/entity/monster/Endermite.java b/src/main/java/net/minecraft/world/entity/monster/Endermite.java
index 965362c281315c15fb70a83a6949d7825bebf15b..e463df132c9b3cbb2217e7019b1bd9a0e0027c10 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Endermite.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Endermite.java
@@ -94,7 +94,7 @@ public class Endermite extends Monster {
this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
- this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers());
+ this.targetSelector.addGoal(1, (new HurtByTargetGoal(this/*, new Class[0]*/)).setAlertOthers()); // Plazma - Reduce allocations
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
}
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 6b9cd8543a5bfc2b936ba18f66ffd60f2f792e43..d99c56194d1a16c34a62d8f2f01026974a242921 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
@@ -832,7 +832,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
// Paper start - Perf: Optimize Hoppers
static final AABB HOPPER_ITEM_SUCK_OVERALL = Hopper.SUCK.bounds();
- static final AABB[] HOPPER_ITEM_SUCK_INDIVIDUAL = Hopper.SUCK.toAabbs().toArray(new AABB[0]);
+ static final AABB[] HOPPER_ITEM_SUCK_INDIVIDUAL = Hopper.SUCK.toAabbs().toArray(new AABB[0]); // Plazma - Reduce allocations (mark)
// Paper end - Perf: Optimize Hoppers
public static List<ItemEntity> getItemsAtAndAbove(Level world, Hopper hopper) {
diff --git a/src/main/java/org/bukkit/craftbukkit/bootstrap/Main.java b/src/main/java/org/bukkit/craftbukkit/bootstrap/Main.java
index 8a4f95049c63afb28bef6719c77b7a7092e75aae..e117350504e0c37b27f10ff102781ed78210cad2 100644
--- a/src/main/java/org/bukkit/craftbukkit/bootstrap/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/bootstrap/Main.java
@@ -50,7 +50,7 @@ public class Main {
System.exit(0);
}
- URLClassLoader classLoader = new URLClassLoader(extractedUrls.toArray(new URL[0]));
+ URLClassLoader classLoader = new URLClassLoader(extractedUrls.toArray(new URL[0])); // Plazma - Reduce allocations (mark)
System.out.println("Starting server");
Thread runThread = new Thread(() -> {
diff --git a/src/main/java/org/plazmamc/plazma/commands/plazma/subcommand/VersionCommand.java b/src/main/java/org/plazmamc/plazma/commands/plazma/subcommand/VersionCommand.java
index b6664ba0fce55f5cfa0c8d3051dc8c2be0fd0703..ccb5008987dff2365fe58eddc86227e4515cbbfc 100644
--- a/src/main/java/org/plazmamc/plazma/commands/plazma/subcommand/VersionCommand.java
+++ b/src/main/java/org/plazmamc/plazma/commands/plazma/subcommand/VersionCommand.java
@@ -7,6 +7,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.DefaultQualifier;
import org.plazmamc.plazma.commands.PlazmaSubCommand;
+import org.plazmamc.plazma.constants.Empty;
@DefaultQualifier(NonNull.class)
public class VersionCommand implements PlazmaSubCommand {
@@ -14,7 +15,7 @@ public class VersionCommand implements PlazmaSubCommand {
@Override
public boolean execute(final CommandSender sender, final String subCommand, final String[] args) {
final @Nullable Command ver = MinecraftServer.getServer().server.getCommandMap().getCommand("version");
- if (ver != null) return ver.execute(sender, "plazma", new String[0]);
+ if (ver != null) return ver.execute(sender, "plazma", Empty.STRING);
return false;
}

View File

@@ -20,52 +20,25 @@ 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/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 14d15dd0d4973957871f5c06042fcaa4ea8b7a8a..2a45bebb2b83efd4ffcecad6c0a979198ab985c7 100644
index 2707a96f9e22469d008ec7d2fa8a8c497efaf8cf..9eedd395b3eac5e2511c8267781938a3fd994d90 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -134,6 +134,7 @@ public abstract class PlayerList {
@@ -135,6 +135,7 @@ public abstract class PlayerList {
private static final Logger LOGGER = LogUtils.getLogger();
private static final int SEND_PLAYER_INFO_INTERVAL = 600;
private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
private static final org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[] EMPTY_FLAG = new org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[0]; // Plazma - Reduce allocations
+ private static final ru.bk.oharass.freedomchat.FreedomChat FREEDOM_HANDLER = new ru.bk.oharass.freedomchat.FreedomChat(); // Plazma - Implement FreedomChat
private final MinecraftServer server;
public final List<ServerPlayer> players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety
private final Map<UUID, ServerPlayer> playersByUUID = Maps.newHashMap();
@@ -287,6 +288,8 @@ public abstract class PlayerList {
@@ -285,6 +286,7 @@ public abstract class PlayerList {
// CraftBukkit - Moved message to after join
// PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ({}, {}, {})", new Object[]{entityplayer.getName().getString(), s1, entityplayer.getId(), entityplayer.getX(), entityplayer.getY(), entityplayer.getZ()});
LevelData worlddata = worldserver1.getLevelData();
+ connection.channel.pipeline().addAfter("packet_handler", "freedom_handler", FREEDOM_HANDLER); // Plazma - Implement FreedomChat
+
player.loadGameTypes(nbttagcompound);
player.loadGameTypes((CompoundTag) optional.orElse(null)); // CraftBukkit - decompile error
ServerGamePacketListenerImpl playerconnection = new ServerGamePacketListenerImpl(this.server, connection, player, clientData);
GameRules gamerules = worldserver1.getGameRules();
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhase.java
index 48826eb0a960f7af6dd2ef184a8aed744a1d8f83..c6df4262d660a1043705c3a4041f959490fae79e 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhase.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhase.java
@@ -5,7 +5,7 @@ import java.util.Arrays;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
public class EnderDragonPhase<T extends DragonPhaseInstance> {
- private static EnderDragonPhase<?>[] phases = new EnderDragonPhase[0];
+ private static EnderDragonPhase<?>[] phases = new EnderDragonPhase[0]; // Plazma - Reduce allocations (mark)
public static final EnderDragonPhase<DragonHoldingPatternPhase> HOLDING_PATTERN = create(DragonHoldingPatternPhase.class, "HoldingPattern");
public static final EnderDragonPhase<DragonStrafePlayerPhase> STRAFE_PLAYER = create(DragonStrafePlayerPhase.class, "StrafePlayer");
public static final EnderDragonPhase<DragonLandingApproachPhase> LANDING_APPROACH = create(DragonLandingApproachPhase.class, "LandingApproach");
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..6e910d74bac39735020d553cf31eb65b750163e0 100644
--- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipePattern.java
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipePattern.java
@@ -85,7 +85,7 @@ public record ShapedRecipePattern(int width, int height, NonNullList<Ingredient>
}
if (pattern.size() == l) {
- return new String[0];
+ return org.plazmamc.plazma.constants.Empty.STRING; // Plazma - Reduce allocations
} else {
String[] strings = new String[pattern.size() - l - k];
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 4f3ed01e12ccb8a6f1a5c4f605451bb36370a236..98f26e3de66a881163e84295e9156c7f362bf7cb 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java

View File

@@ -0,0 +1,897 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 10 Jan 2024 12:43:26 +0900
Subject: [PATCH] Reduce allocations
diff --git a/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java b/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java
index ad1eeebe6de219143492b94da309cb54ae9e0a5b..f83bdcf5d2d6f676b2dc83bc1fc0a7453fc2b36a 100644
--- a/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java
+++ b/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java
@@ -38,6 +38,7 @@ public abstract class StarLightEngine {
AxisDirection.POSITIVE_X, AxisDirection.NEGATIVE_X,
AxisDirection.POSITIVE_Z, AxisDirection.NEGATIVE_Z
};
+ private static final AxisDirection[] EMPTY_DIRECTIONS = new AxisDirection[0]; // Plazma - Reduce allocations
protected static enum AxisDirection {
@@ -1094,7 +1095,7 @@ public abstract class StarLightEngine {
for (int bitset = i, len = Integer.bitCount(i), index = 0; index < len; ++index, bitset ^= IntegerUtil.getTrailingBit(bitset)) {
directions.add(AXIS_DIRECTIONS[IntegerUtil.trailingZeros(bitset)]);
}
- OLD_CHECK_DIRECTIONS[i] = directions.toArray(new AxisDirection[0]);
+ OLD_CHECK_DIRECTIONS[i] = directions.toArray(EMPTY_DIRECTIONS); // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
index e7fe98ea30ae6d0baea3ec1f9f98a89502a49a12..7663ccd247b9942ccfb7a320b047ee621fc1bebe 100644
--- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
@@ -97,8 +97,8 @@ public final class ChunkPacketBlockControllerAntiXray extends ChunkPacketBlockCo
Set<BlockState> presetBlockStateSet = new LinkedHashSet<>();
// Therefore addAll(Collection<? extends E>) is used, which guarantees this order in the doc
presetBlockStateSet.addAll(presetBlockStateList);
- presetBlockStates = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateSet.toArray(new BlockState[0]);
- presetBlockStatesFull = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateList.toArray(new BlockState[0]);
+ presetBlockStates = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateSet.toArray(org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
+ presetBlockStatesFull = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateList.toArray(org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
presetBlockStatesStone = null;
presetBlockStatesDeepslate = null;
presetBlockStatesNetherrack = null;
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
index 0133ea6feb1ab88f021f66855669f58367e7420b..a04049bc7738225633ac0b01c470cfbfde86c032 100644
--- a/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
@@ -17,9 +17,9 @@ public final class EntityList implements Iterable<Entity> {
this.entityToIndex.defaultReturnValue(Integer.MIN_VALUE);
}
- protected static final Entity[] EMPTY_LIST = new Entity[0];
+ //protected static final Entity[] EMPTY_LIST = new Entity[0]; // Plazma - Reduce allocations
- protected Entity[] entities = EMPTY_LIST;
+ protected Entity[] entities = org.plazmamc.plazma.constants.Empty.ENTITY; // Plazma - Reduce allocations
protected int count;
public int size() {
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
index 277cfd9d1e8fff5d9b5e534b75c3c5162d58b0b7..30d8d9c2dce5e4eb26cc52a03bc395c16c04c256 100644
--- a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
@@ -20,9 +20,9 @@ public final class IBlockDataList {
this.map.defaultReturnValue(Long.MAX_VALUE);
}
- private static final long[] EMPTY_LIST = new long[0];
+ //private static final long[] EMPTY_LIST = new long[0]; // Plazma - Reduce allocations
- private long[] byIndex = EMPTY_LIST;
+ private long[] byIndex = org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
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..042ea49ec61ee327c0f67ddcf080774042e44c02 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,9 @@ public final class ReferenceList<E> implements Iterable<E> {
this.referenceToIndex.defaultReturnValue(Integer.MIN_VALUE);
}
- protected static final Object[] EMPTY_LIST = new Object[0];
+ //protected static final Object[] EMPTY_LIST = new Object[0]; // Plazma - Reduce allocations
- protected Object[] references = EMPTY_LIST;
+ protected Object[] references = org.plazmamc.plazma.constants.Empty.OBJECT; // Plazma - Reduce allocations
protected int count;
public int size() {
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
index 049e20407..bbd0b944c 100644
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
@@ -42,6 +42,7 @@ import java.util.function.Consumer;
public final class ChunkTaskScheduler {
private static final Logger LOGGER = LogUtils.getClassLogger();
+ private static final ChunkInfo[] EMPTY_INFO = new ChunkInfo[0]; // Plazma - Reduce allocations
static int newChunkSystemIOThreads;
static int newChunkSystemWorkerThreads;
@@ -854,7 +855,7 @@ public final class ChunkTaskScheduler {
public static ChunkInfo[] getChunkInfos() {
synchronized (WAITING_CHUNKS) {
- return WAITING_CHUNKS.toArray(new ChunkInfo[0]);
+ return WAITING_CHUNKS.toArray(EMPTY_INFO); // Plazma - Reduce allocations
}
}
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..359c4b080bd47234e569dce7055da03ddb7b1e90 100644
--- a/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java
+++ b/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java
@@ -14,7 +14,7 @@ public final class VersionCommand implements PaperSubcommand {
public boolean execute(final CommandSender sender, final String subCommand, final String[] args) {
final @Nullable Command ver = MinecraftServer.getServer().server.getCommandMap().getCommand("version");
if (ver != null) {
- ver.execute(sender, "paper", new String[0]);
+ ver.execute(sender, "paper", org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
}
return true;
}
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
index 3e82ea07c..692bef556 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
@@ -47,6 +47,8 @@ import java.util.logging.Level;
class PaperPluginInstanceManager {
private static final FileProviderSource FILE_PROVIDER_SOURCE = new FileProviderSource("File '%s'"::formatted);
+ private static final JavaPlugin[] EMPTY_JPLUGIN = new JavaPlugin[0]; // Plazma - Reduce allocations
+ private static final Plugin[] EMPTY_PLUGIN = new Plugin[0]; // Plazma - Reduce allocations
private final List<Plugin> plugins = new ArrayList<>();
private final Map<String, Plugin> lookupNames = new HashMap<>();
@@ -68,7 +70,7 @@ class PaperPluginInstanceManager {
}
public @NotNull Plugin[] getPlugins() {
- return this.plugins.toArray(new Plugin[0]);
+ return this.plugins.toArray(EMPTY_PLUGIN); // Plazma - Reduce allocations
}
public boolean isPluginEnabled(@NotNull String name) {
@@ -133,7 +135,7 @@ class PaperPluginInstanceManager {
this.server.getLogger().log(Level.SEVERE, "Unknown error occurred while loading plugins through PluginManager.", e);
}
- return runtimePluginEntrypointHandler.getPluginProviderStorage().getLoaded().toArray(new JavaPlugin[0]);
+ return runtimePluginEntrypointHandler.getPluginProviderStorage().getLoaded().toArray(EMPTY_JPLUGIN); // Plazma - Reduce allocations
}
// The behavior of this is that all errors are logged instead of being thrown
diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java
index ee8e9c0e3..f2598e139 100644
--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java
+++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java
@@ -1149,7 +1149,7 @@ public final class CollisionUtil {
}
private static final MergedVoxelCoordinateList EMPTY = new MergedVoxelCoordinateList(
- new double[] { 0.0 }, 0.0, new int[0], new int[0], 0
+ new double[] { 0.0 }, 0.0, org.plazmamc.plazma.constants.Empty.INT, org.plazmamc.plazma.constants.Empty.INT, 0 // Plazma - Reduce allocations
);
private static int[] getIndices(final int length) {
diff --git a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
index c78cbec447032de9fe69748591bef6be300160ed..8ca248e844e73685a8d44a966144657315a799aa 100644
--- a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
+++ b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
@@ -304,7 +304,7 @@ public final class ChunkEntitySlices {
protected static final class BasicEntityList<E extends Entity> {
- protected static final Entity[] EMPTY = new Entity[0];
+ //protected static final Entity[] EMPTY = new Entity[0]; // Plazma - Reduce allocations
protected static final int DEFAULT_CAPACITY = 4;
protected E[] storage;
@@ -315,7 +315,7 @@ public final class ChunkEntitySlices {
}
public BasicEntityList(final int cap) {
- this.storage = (E[])(cap <= 0 ? EMPTY : new Entity[cap]);
+ this.storage = (E[])(cap <= 0 ? org.plazmamc.plazma.constants.Empty.ENTITY : new Entity[cap]);
}
public boolean isEmpty() {
@@ -327,7 +327,7 @@ public final class ChunkEntitySlices {
}
private void resize() {
- if (this.storage == EMPTY) {
+ if (this.storage == org.plazmamc.plazma.constants.Empty.ENTITY) {
this.storage = (E[])new Entity[DEFAULT_CAPACITY];
} else {
this.storage = Arrays.copyOf(this.storage, this.storage.length * 2);
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
index c5a3f9c2daf3da135cccecb757353534e1688821..e5585c6befeef62ecf130e8dabbe6b78f9e90a65 100644
--- a/src/main/java/net/minecraft/CrashReport.java
+++ b/src/main/java/net/minecraft/CrashReport.java
@@ -30,7 +30,7 @@ public class CrashReport {
@Nullable
private File saveFile;
private boolean trackingStackTrace = true;
- private StackTraceElement[] uncategorizedStackTrace = new StackTraceElement[0];
+ private StackTraceElement[] uncategorizedStackTrace = org.plazmamc.plazma.constants.Empty.TRACE; // Plazma - Reduce allocations
private final SystemReport systemReport = new SystemReport();
public CrashReport(String message, Throwable cause) {
diff --git a/src/main/java/net/minecraft/CrashReportCategory.java b/src/main/java/net/minecraft/CrashReportCategory.java
index 2176171954609fd88f97f93408e14e018c1d6eaa..2a5576dc66a9b1f56e06ba47bef4fe882935c382 100644
--- a/src/main/java/net/minecraft/CrashReportCategory.java
+++ b/src/main/java/net/minecraft/CrashReportCategory.java
@@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState;
public class CrashReportCategory {
private final String title;
private final List<CrashReportCategory.Entry> entries = Lists.newArrayList();
- private StackTraceElement[] stackTrace = new StackTraceElement[0];
+ private StackTraceElement[] stackTrace = org.plazmamc.plazma.constants.Empty.TRACE; // Plazma - Reduce allocations
public CrashReportCategory(String title) {
this.title = title;
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 01a12f4d6f3c2f09bffc78692443b9fd391db45a..9a6e4538dd09263544f39c93f5f1480dc589fb4d 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
@@ -409,7 +409,7 @@ public class Util {
} else if (futures.size() == 1) {
return futures.get(0).thenApply(List::of);
} else {
- CompletableFuture<Void> completableFuture = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
+ CompletableFuture<Void> completableFuture = CompletableFuture.allOf(futures.toArray(org.plazmamc.plazma.constants.Empty.FUTURE)); // Plazma - Reduce allocations
return completableFuture.thenApply(void_ -> futures.stream().map(CompletableFuture::join).toList());
}
}
diff --git a/src/main/java/net/minecraft/nbt/ByteArrayTag.java b/src/main/java/net/minecraft/nbt/ByteArrayTag.java
index 06648f9751fd8a322d0809ffebf6a544596ee1a4..b0ea87e2ed8f9bf04b33c2ff8a827d4f6f57a435 100644
--- a/src/main/java/net/minecraft/nbt/ByteArrayTag.java
+++ b/src/main/java/net/minecraft/nbt/ByteArrayTag.java
@@ -175,7 +175,7 @@ public class ByteArrayTag extends CollectionTag<ByteTag> {
}
public void clear() {
- this.data = new byte[0];
+ this.data = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
index 4e005b7b0..059a1e49f 100644
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
@@ -409,7 +409,7 @@ public class CompoundTag implements Tag {
throw new ReportedException(this.createReport(key, ByteArrayTag.TYPE, var3));
}
- return new byte[0];
+ return org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
}
public int[] getIntArray(String key) {
@@ -421,7 +421,7 @@ public class CompoundTag implements Tag {
throw new ReportedException(this.createReport(key, IntArrayTag.TYPE, var3));
}
- return new int[0];
+ return org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
public long[] getLongArray(String key) {
@@ -433,7 +433,7 @@ public class CompoundTag implements Tag {
throw new ReportedException(this.createReport(key, LongArrayTag.TYPE, var3));
}
- return new long[0];
+ return org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
}
public CompoundTag getCompound(String key) {
diff --git a/src/main/java/net/minecraft/nbt/IntArrayTag.java b/src/main/java/net/minecraft/nbt/IntArrayTag.java
index ff13d67151c50ea11a45117e524c7524e2b1a202..5048ec707c147b9a5b2dd8736d518d938ba95df0 100644
--- a/src/main/java/net/minecraft/nbt/IntArrayTag.java
+++ b/src/main/java/net/minecraft/nbt/IntArrayTag.java
@@ -186,7 +186,7 @@ public class IntArrayTag extends CollectionTag<IntTag> {
}
public void clear() {
- this.data = new int[0];
+ this.data = org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
index 154bffd34..83c36d452 100644
--- a/src/main/java/net/minecraft/nbt/ListTag.java
+++ b/src/main/java/net/minecraft/nbt/ListTag.java
@@ -258,7 +258,7 @@ public class ListTag extends CollectionTag<Tag> {
}
}
- return new int[0];
+ return org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
public long[] getLongArray(int index) {
@@ -269,7 +269,7 @@ public class ListTag extends CollectionTag<Tag> {
}
}
- return new long[0];
+ return org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
}
public double getDouble(int index) {
diff --git a/src/main/java/net/minecraft/nbt/LongArrayTag.java b/src/main/java/net/minecraft/nbt/LongArrayTag.java
index 2e5c34ebb94a1536cf09d71bdf052a49ecb9159d..144d3bbe80fc0f459a06017a19929e3e849aabd0 100644
--- a/src/main/java/net/minecraft/nbt/LongArrayTag.java
+++ b/src/main/java/net/minecraft/nbt/LongArrayTag.java
@@ -185,7 +185,7 @@ public class LongArrayTag extends CollectionTag<LongTag> {
@Override
public void clear() {
- this.data = new long[0];
+ this.data = org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/nbt/NbtIo.java b/src/main/java/net/minecraft/nbt/NbtIo.java
index 9f659af04..d2969c1ce 100644
--- a/src/main/java/net/minecraft/nbt/NbtIo.java
+++ b/src/main/java/net/minecraft/nbt/NbtIo.java
@@ -277,7 +277,7 @@ public class NbtIo {
@Nullable
public static CompoundTag read(Path path) throws IOException {
- if (!Files.exists(path, new LinkOption[0])) {
+ if (!Files.exists(path/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
return null;
} else {
InputStream inputstream = Files.newInputStream(path);
diff --git a/src/main/java/net/minecraft/network/CipherBase.java b/src/main/java/net/minecraft/network/CipherBase.java
index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..70d776d5cfdb0612f65d92333d6f872afedc2207 100644
--- a/src/main/java/net/minecraft/network/CipherBase.java
+++ b/src/main/java/net/minecraft/network/CipherBase.java
@@ -7,8 +7,8 @@ import javax.crypto.ShortBufferException;
public class CipherBase {
private final Cipher cipher;
- private byte[] heapIn = new byte[0];
- private byte[] heapOut = new byte[0];
+ private byte[] heapIn = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
+ private byte[] heapOut = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
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 9f274048b..ba54c16f1 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -316,7 +316,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
private void validateListener(ProtocolInfo<?> state, PacketListener listener) {
- Validate.notNull(listener, "packetListener", new Object[0]);
+ Validate.notNull(listener, "packetListener"/*, new Object[0]*/); // Plazma - Reduce allocations
PacketFlow enumprotocoldirection = listener.flow();
String s;
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
index 6dcade427..4a0b4b0fa 100644
--- a/src/main/java/net/minecraft/network/chat/Component.java
+++ b/src/main/java/net/minecraft/network/chat/Component.java
@@ -189,7 +189,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
}
static MutableComponent translatable(String key) {
- return MutableComponent.create(new TranslatableContents(key, (String) null, TranslatableContents.NO_ARGS));
+ return MutableComponent.create(new TranslatableContents(key, (String) null, org.plazmamc.plazma.constants.Empty.OBJECT)); // Plazma - Reduce allocations
}
static MutableComponent translatable(String key, Object... args) {
@@ -209,7 +209,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
}
static MutableComponent translatableWithFallback(String key, @Nullable String fallback) {
- return MutableComponent.create(new TranslatableContents(key, fallback, TranslatableContents.NO_ARGS));
+ return MutableComponent.create(new TranslatableContents(key, fallback, org.plazmamc.plazma.constants.Empty.OBJECT)); // Plazma - Reduce allocations
}
static MutableComponent translatableWithFallback(String key, @Nullable String fallback, Object... args) {
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 4aa6232bf..84e8a29f0 100644
--- a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
+++ b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
@@ -29,7 +29,7 @@ import net.minecraft.util.ExtraCodecs;
import net.minecraft.world.entity.Entity;
public class TranslatableContents implements ComponentContents {
- public static final Object[] NO_ARGS = new Object[0];
+ // public static final Object[] NO_ARGS = new Object[0]; // Plazma - Reduce allocations
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(
@@ -69,7 +69,7 @@ public class TranslatableContents implements ComponentContents {
}
private static Object[] adjustArgs(Optional<List<Object>> args) {
- return args.<Object[]>map(list -> list.isEmpty() ? NO_ARGS : list.toArray()).orElse(NO_ARGS);
+ return args.<Object[]>map(list -> list.isEmpty() ? org.plazmamc.plazma.constants.Empty.OBJECT : list.toArray()).orElse(org.plazmamc.plazma.constants.Empty.OBJECT); // Plazma - Reduce allocations
}
private static TranslatableContents create(String key, Optional<String> fallback, Optional<List<Object>> args) {
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
index 1a37654af..0e61f8cb3 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
@@ -66,7 +66,7 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<BlockState> blockChanges) {
this.sectionPos = sectionPos;
this.positions = blockChanges.keySet().toShortArray();
- this.states = blockChanges.values().toArray(new BlockState[0]);
+ this.states = blockChanges.values().toArray(org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
}
// Paper end - Multi Block Change API
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e121cc57e..7b27af22a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1541,13 +1541,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
private Optional<ServerStatus.Favicon> loadStatusIcon() {
- Optional<Path> optional = Optional.of(this.getFile("server-icon.png").toPath()).filter((path) -> {
- return Files.isRegularFile(path, new LinkOption[0]);
- }).or(() -> {
- return this.storageSource.getIconFile().filter((path) -> {
- return Files.isRegularFile(path, new LinkOption[0]);
- });
- });
+ // Plazma start - Reduce allocations
+ Optional<Path> optional = Optional.of(this.getFile("server-icon.png").toPath()).filter(Files::isRegularFile)
+ .or(() -> this.storageSource.getIconFile().filter(Files::isRegularFile));
+ // Plazma end
return optional.flatMap((path) -> {
try {
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
index ef520d1dd..b3b0c18b4 100644
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
@@ -130,7 +130,7 @@ public class PlayerAdvancements {
}
private void load(ServerAdvancementManager advancementLoader) {
- if (Files.isRegularFile(this.playerSavePath, new LinkOption[0])) {
+ if (Files.isRegularFile(this.playerSavePath/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
try {
JsonReader jsonreader = new JsonReader(Files.newBufferedReader(this.playerSavePath, StandardCharsets.UTF_8));
diff --git a/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java b/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java
index 0f52e8a61ca7e57e9f52473dceb9cc3464c0c86d..f54bde32760541a653460682e5a3ddd0b2ceec51 100644
--- a/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java
+++ b/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java
@@ -4,12 +4,12 @@ public final class RunningOnDifferentThreadException extends RuntimeException {
public static final RunningOnDifferentThreadException RUNNING_ON_DIFFERENT_THREAD = new RunningOnDifferentThreadException();
private RunningOnDifferentThreadException() {
- this.setStackTrace(new StackTraceElement[0]);
+ this.setStackTrace(org.plazmamc.plazma.constants.Empty.TRACE); // Plazma - Reduce allocations
}
@Override
public synchronized Throwable fillInStackTrace() {
- this.setStackTrace(new StackTraceElement[0]);
+ this.setStackTrace(org.plazmamc.plazma.constants.Empty.TRACE); // Plazma - Reduce allocations
return this;
}
}
diff --git a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
index bae0d208b31aa0a6977c30f2f8484ab3c316bc71..981c3023044f3cc6dc22ada20cd4bedcf7a28db3 100644
--- a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
+++ b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
@@ -92,7 +92,7 @@ public class ServerFunctionLibrary implements PreparableReloadListener {
}, prepareExecutor));
}
- CompletableFuture<?>[] completableFutures = map.values().toArray(new CompletableFuture[0]);
+ CompletableFuture<?>[] completableFutures = map.values().toArray(org.plazmamc.plazma.constants.Empty.FUTURE); // Plazma - Reduce allocations
return CompletableFuture.allOf(completableFutures).handle((unused, ex) -> map);
}
);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 4e6fccec4..618dc900d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -112,6 +112,7 @@ import org.bukkit.craftbukkit.generator.CustomChunkGenerator;
public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
+ private static final ServerPlayerConnection[] EMPTY_CONNECTION = new ServerPlayerConnection[0]; // Plazma - Reduce allocations
private static final byte CHUNK_TYPE_REPLACEABLE = -1;
private static final byte CHUNK_TYPE_UNKNOWN = 0;
private static final byte CHUNK_TYPE_FULL = 1;
@@ -1361,7 +1362,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// stuff could have been removed, so we need to check the trackedPlayers set
// for players that were removed
- for (ServerPlayerConnection conn : this.seenBy.toArray(new ServerPlayerConnection[0])) { // avoid CME
+ for (ServerPlayerConnection conn : this.seenBy.toArray(EMPTY_CONNECTION)) { // avoid CME // Plazma - Reduce allocations
if (newTrackerCandidates == null || !newTrackerCandidates.contains(conn.getPlayer())) {
this.updatePlayer(conn.getPlayer());
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index f72af2feb..0aaa0e63f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1439,7 +1439,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public static List<Entity> getCurrentlyTickingEntities() {
Entity ticking = currentlyTickingEntity.get();
- List<Entity> ret = java.util.Arrays.asList(ticking == null ? new Entity[0] : new Entity[] { ticking });
+ List<Entity> ret = java.util.Arrays.asList(ticking == null ? org.plazmamc.plazma.constants.Empty.ENTITY : new Entity[] { ticking }); // Plazma - Reduce allocations
return ret;
}
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 3b4fadb37..f276fe09f 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -165,12 +165,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleHello(ServerboundHelloPacket packet) {
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet"/*, new Object[0]*/); // Plazma - Reduce allocations
// Paper start - Validate usernames
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
&& io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation
&& !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) {
- Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username", new Object[0]);
+ Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username"/*, new Object[0]*/); // Plazma - Reduce allocations
}
// Paper end - Validate usernames
this.requestedUsername = packet.name();
@@ -268,7 +268,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleKey(ServerboundKeyPacket packet) {
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.KEY, "Unexpected key packet", new Object[0]);
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.KEY, "Unexpected key packet"/*, new Object[0]*/); // Plazma - Reduce allocations
final String s;
@@ -448,7 +448,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"/*, new Object[0]*/); // Plazma - Reduce allocations
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 b863f6fe6..068c7619b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -135,6 +135,7 @@ public abstract class PlayerList {
private static final Logger LOGGER = LogUtils.getLogger();
private static final int SEND_PLAYER_INFO_INTERVAL = 600;
private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
+ private static final org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[] EMPTY_FLAG = new org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[0]; // Plazma - Reduce allocations
private final MinecraftServer server;
public final List<ServerPlayer> players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety
private final Map<UUID, ServerPlayer> playersByUUID = Maps.newHashMap();
@@ -815,7 +816,7 @@ public abstract class PlayerList {
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason) {
// Paper start - Expand PlayerRespawnEvent
- return respawn(entityplayer, worldserver, flag, location, avoidSuffocation, reason, new org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[0]);
+ return respawn(entityplayer, worldserver, flag, location, avoidSuffocation, reason, EMPTY_FLAG); // Plazma - Reduce allocations
}
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason, org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag...respawnFlags) {
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index c038da20b..b6cab933d 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -76,7 +76,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
}
public String[] getUserList() {
- return (String[]) this.map.keySet().toArray(new String[0]);
+ return this.map.keySet().toArray(org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
}
public boolean isEmpty() {
diff --git a/src/main/java/net/minecraft/util/MemoryReserve.java b/src/main/java/net/minecraft/util/MemoryReserve.java
index 0ee04fe6ff6a4d09754f326526ae04fe7226bab2..5663ce568a1daa638b7387bee8b9917ce1f64d14 100644
--- a/src/main/java/net/minecraft/util/MemoryReserve.java
+++ b/src/main/java/net/minecraft/util/MemoryReserve.java
@@ -11,6 +11,6 @@ public class MemoryReserve {
}
public static void release() {
- reserve = new byte[0];
+ reserve = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/net/minecraft/util/ZeroBitStorage.java b/src/main/java/net/minecraft/util/ZeroBitStorage.java
index 01f5b946fabbe34f31110e75973dab9f39897346..2564c21900df7ca3c58872741ec8f68bce80a903 100644
--- a/src/main/java/net/minecraft/util/ZeroBitStorage.java
+++ b/src/main/java/net/minecraft/util/ZeroBitStorage.java
@@ -5,7 +5,7 @@ import java.util.function.IntConsumer;
import org.apache.commons.lang3.Validate;
public class ZeroBitStorage implements BitStorage {
- public static final long[] RAW = new long[0];
+ // public static final long[] RAW = new long[0]; // Plazma - Reduce allocations
private final int size;
public ZeroBitStorage(int size) {
@@ -33,7 +33,7 @@ public class ZeroBitStorage implements BitStorage {
@Override
public long[] getRaw() {
- return RAW;
+ return org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
}
@Override
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 f34159f8d..4088ec804 100644
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
@@ -57,6 +57,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
public static final Object2FloatMap<ItemLike> COMPOSTABLES = new Object2FloatOpenHashMap();
private static final int AABB_SIDE_THICKNESS = 2;
private static final VoxelShape OUTER_SHAPE = Shapes.block();
+ private static final int[] ZERO_INT = new int[]{0}; // Plazma - Reduce allocations // Plazma - Reduce allocations
private static final VoxelShape[] SHAPES = (VoxelShape[]) Util.make(new VoxelShape[9], (avoxelshape) -> {
for (int i = 0; i < 8; ++i) {
avoxelshape[i] = Shapes.join(ComposterBlock.OUTER_SHAPE, Block.box(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), BooleanOp.ONLY_FIRST);
@@ -458,7 +459,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
- return side == Direction.DOWN ? new int[]{0} : new int[0];
+ return side == Direction.DOWN ? ZERO_INT : org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
@Override
@@ -507,7 +508,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
- return side == Direction.UP ? new int[]{0} : new int[0];
+ return side == Direction.UP ? ZERO_INT : org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
@Override
@@ -549,7 +550,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
- return new int[0];
+ return org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
index 1362a4794..2490b63cb 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -445,7 +445,7 @@ public class RegionFile implements AutoCloseable {
this.path = path;
initOversizedState(); // Paper
this.version = compressionFormat;
- if (!Files.isDirectory(directory, new LinkOption[0])) {
+ if (!Files.isDirectory(directory/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
throw new IllegalArgumentException("Expected directory, got " + String.valueOf(directory.toAbsolutePath()));
} else {
this.externalFileDir = directory;
@@ -717,7 +717,7 @@ public class RegionFile implements AutoCloseable {
private DataInputStream createExternalChunkInputStream(ChunkPos pos, byte flags) throws IOException {
Path path = this.getExternalChunkPath(pos);
- if (!Files.isRegularFile(path, new LinkOption[0])) {
+ if (!Files.isRegularFile(path/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
RegionFile.LOGGER.error("External chunk path {} is not file", path);
return null;
} else {
@@ -769,7 +769,7 @@ public class RegionFile implements AutoCloseable {
return false;
}
- if (!Files.isRegularFile(this.getExternalChunkPath(pos), new LinkOption[0])) {
+ if (!Files.isRegularFile(this.getExternalChunkPath(pos)/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
return false;
}
} else {
diff --git a/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java b/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
index b8e333e79..b6012d360 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
@@ -89,7 +89,7 @@ public class DebugLevelSource extends ChunkGenerator {
@Override
public NoiseColumn getBaseColumn(int x, int z, LevelHeightAccessor world, RandomState noiseConfig) {
- return new NoiseColumn(0, new BlockState[0]);
+ return new NoiseColumn(0, org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java b/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
index 399da9d43aefbb95897df4697860d5bce5317152..df7816c1c5f069d89a22dbd876a2d663ba68949f 100644
--- a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
+++ b/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
@@ -110,7 +110,7 @@ public class LevelStorageSource {
}
public static DirectoryValidator parseValidator(Path allowedSymlinksFile) {
- if (Files.exists(allowedSymlinksFile, new LinkOption[0])) {
+ if (Files.exists(allowedSymlinksFile/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
try {
BufferedReader bufferedreader = Files.newBufferedReader(allowedSymlinksFile);
@@ -189,7 +189,7 @@ public class LevelStorageSource {
}
public LevelStorageSource.LevelCandidates findLevelCandidates() throws LevelStorageException {
- if (!Files.isDirectory(this.baseDir, new LinkOption[0])) {
+ if (!Files.isDirectory(this.baseDir/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
throw new LevelStorageException(Component.translatable("selectWorld.load_folder_access"));
} else {
try {
@@ -198,11 +198,12 @@ public class LevelStorageSource {
LevelStorageSource.LevelCandidates convertable_a;
try {
- List<LevelStorageSource.LevelDirectory> list = stream.filter((path) -> {
- return Files.isDirectory(path, new LinkOption[0]);
- }).map(LevelStorageSource.LevelDirectory::new).filter((convertable_b) -> {
- return Files.isRegularFile(convertable_b.dataFile(), new LinkOption[0]) || Files.isRegularFile(convertable_b.oldDataFile(), new LinkOption[0]);
- }).toList();
+ // Plazma start - Reduce allocations
+ List<LevelStorageSource.LevelDirectory> list = stream.filter(Files::isDirectory)
+ .map(LevelStorageSource.LevelDirectory::new)
+ .filter(convertable_b -> Files.isRegularFile(convertable_b.dataFile()) || Files.isRegularFile(convertable_b.oldDataFile()))
+ .toList();
+ // Plazma end
convertable_a = new LevelStorageSource.LevelCandidates(list);
} catch (Throwable throwable) {
@@ -312,7 +313,7 @@ public class LevelStorageSource {
private LevelSummary readLevelSummary(LevelStorageSource.LevelDirectory save, boolean locked) {
Path path = save.dataFile();
- if (Files.exists(path, new LinkOption[0])) {
+ if (Files.exists(path/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
try {
if (Files.isSymbolicLink(path)) {
List<ForbiddenSymlinkInfo> list = this.worldDirValidator.validateSymlink(path);
@@ -411,7 +412,7 @@ public class LevelStorageSource {
public boolean levelExists(String name) {
try {
- return Files.isDirectory(this.getLevelPath(name), new LinkOption[0]);
+ return Files.isDirectory(this.getLevelPath(name)/*, new LinkOption[0]*/); // Plazma - Reduce allocations
} catch (InvalidPathException invalidpathexception) {
return false;
}
@@ -752,7 +753,7 @@ public class LevelStorageSource {
}
public boolean hasWorldData() {
- return Files.exists(this.levelDirectory.dataFile(), new LinkOption[0]) || Files.exists(this.levelDirectory.oldDataFile(), new LinkOption[0]);
+ return Files.exists(this.levelDirectory.dataFile()/*, new LinkOption[0]*/) || Files.exists(this.levelDirectory.oldDataFile()/*, new LinkOption[0]*/); // Plazma - Reduce allocations
}
public void close() throws IOException {
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..e0f085169fafa5e574caf368efa343514540b348 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -124,7 +124,7 @@ public class PlayerDataStorage {
String[] astring = this.playerDir.list();
if (astring == null) {
- astring = new String[0];
+ astring = org.plazmamc.plazma.constants.Empty.STRING; // Plazma - Reduce 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..aa16c93a4333b603729e2704b92f6d38aec0fd7b 100644
--- a/src/main/java/net/minecraft/world/scores/Team.java
+++ b/src/main/java/net/minecraft/world/scores/Team.java
@@ -70,7 +70,7 @@ public abstract class Team {
public final int id;
public static String[] getAllNames() {
- return BY_NAME.keySet().toArray(new String[0]);
+ return BY_NAME.keySet().toArray(org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
}
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index fb2d05e43df3bfb72b1f6e325736dd3cbc6c3096..de4e1d713e5ec182ea8d4832b8359556095ac214 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -426,7 +426,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void sendTitle(Title title) {
Preconditions.checkNotNull(title, "Title is null");
setTitleTimes(title.getFadeIn(), title.getStay(), title.getFadeOut());
- setSubtitle(title.getSubtitle() == null ? new BaseComponent[0] : title.getSubtitle());
+ setSubtitle(title.getSubtitle() == null ? org.plazmamc.plazma.constants.Empty.BASE_COMPONENT : title.getSubtitle()); // Plazma - Reduce allocations
showTitle(title.getTitle());
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
index c5d1ba7a1be3f102edcdfdc05fc50b30ef1f775b..66006d9ff581ac96f13389261de0cd647279b98a 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
@@ -610,7 +610,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta {
throw new IllegalArgumentException("Invalid page number " + page + "/" + CraftMetaBook.this.getPageCount());
}
- BaseComponent[] newText = text == null ? new BaseComponent[0] : text;
+ BaseComponent[] newText = text == null ? org.plazmamc.plazma.constants.Empty.BASE_COMPONENT : text; // Plazma - Reduce allocations
CraftMetaBook.this.pages.set(page - 1, this.componentsToPage(newText));
}
@@ -623,7 +623,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta {
public void addPage(final BaseComponent[]... pages) {
for (BaseComponent[] page : pages) {
if (page == null) {
- page = new BaseComponent[0];
+ page = org.plazmamc.plazma.constants.Empty.BASE_COMPONENT; // Plazma - Reduce allocations
}
CraftMetaBook.this.internalAddPage(this.componentsToPage(page));
diff --git a/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java b/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java
index b25dc23b81687dd4d4e70b3615ffb91f8c03c68b..acb98770b9d01e930642a5794f9179660b411c02 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java
@@ -164,7 +164,7 @@ public final class WeakCollection<T> implements Collection<T> {
@Override
public Object[] toArray() {
- return this.toArray(new Object[0]);
+ return this.toArray(org.plazmamc.plazma.constants.Empty.OBJECT); // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/org/plazmamc/plazma/constants/Empty.java b/src/main/java/org/plazmamc/plazma/constants/Empty.java
new file mode 100644
index 0000000000000000000000000000000000000000..2b6eb7997986ab73ccb3b1baca945a3234ae916e
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/constants/Empty.java
@@ -0,0 +1,20 @@
+package org.plazmamc.plazma.constants;
+
+public interface Empty {
+
+ int[] INT = new int[0];
+ long[] LONG = new long[0];
+ byte[] BYTE = new byte[0];
+
+ Object[] OBJECT = new Object[0];
+ String[] STRING = new String[0];
+ StackTraceElement[] TRACE = new StackTraceElement[0];
+ java.util.concurrent.CompletableFuture<?>[] FUTURE = new java.util.concurrent.CompletableFuture[0];
+
+ net.minecraft.world.level.block.state.BlockState[] BLOCK_STATE = new net.minecraft.world.level.block.state.BlockState[0];
+ net.minecraft.world.entity.Entity[] ENTITY = new net.minecraft.world.entity.Entity[0];
+
+ @SuppressWarnings("deprecation")
+ net.md_5.bungee.api.chat.BaseComponent[] BASE_COMPONENT = new net.md_5.bungee.api.chat.BaseComponent[0];
+
+}
diff --git a/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java b/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
index 2621e54879e9ab0029a875f1d09eee67878b90d5..e7e959368c01de69261618d1eb749bebba3527af 100644
--- a/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
+++ b/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
@@ -57,7 +57,7 @@ public class PurpurCommand extends Command {
} else if (args[0].equalsIgnoreCase("version")) {
Command verCmd = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
if (verCmd != null) {
- return verCmd.execute(sender, commandLabel, new String[0]);
+ return verCmd.execute(sender, commandLabel, org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
}
}

View File

@@ -0,0 +1,59 @@
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index 8afc58f35deb49084a20b803e91ce4692ce6e4d6..1febd6d0743aadb4002b447c07ec43098ca96c18 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -64,7 +64,7 @@ public class PufferfishConfig {
getString("info.version", "1.0");
setComment("info",
"Pufferfish Configuration",
- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host",
+ //"Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - Sponsorblock
"Join our Discord for support: https://discord.gg/reZw4vQV9H",
"Download new builds at https://ci.pufferfish.host/job/Pufferfish");
@@ -219,7 +219,7 @@ public class PufferfishConfig {
public static int maxProjectileLoadsPerTick;
public static int maxProjectileLoadsPerProjectile;
private static void projectileLoading() {
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
setComment("projectile", "Optimizes projectile settings");
@@ -233,7 +233,7 @@ public class PufferfishConfig {
public static int activationDistanceMod;
private static void dynamicActivationOfBrains() throws IOException {
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()); // Purpur // Plazma - Optimize default configurations
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
"This value determines how far away an entity has to be",
"from the player to start being effected by DEAR.");
@@ -241,7 +241,7 @@ public class PufferfishConfig {
maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
"This value defines how often in ticks, the furthest entity",
"will get their pathfinders and behaviors ticked. 20 = 1s");
- activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 8, // Plazma - Optimize default configurations
"This value defines how much distance modifies an entity's",
"tick frequency. freq = (distanceToPlayer^2) / (2^value)",
"If you want further away entities to tick less often, use 7.",
@@ -261,8 +261,18 @@ public class PufferfishConfig {
public static Map<String, Integer> projectileTimeouts;
private static void projectileTimeouts() {
// Set some defaults
+ // Plazma start - Optimize default configurations
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) {
+ getInt("entity_timeouts.ARROW", 200);
+ getInt("entity_timeouts.EGG", 200);
+ getInt("entity_timeouts.ENDER_PEARL", 200);
+ getInt("entity_timeouts.SNOWBALL", 200);
+ getInt("entity_timeouts.LLAMA_SPIT", 200);
+ } else {
+ // Plazma end - Optimize default configurations
getInt("entity_timeouts.SNOWBALL", -1);
getInt("entity_timeouts.LLAMA_SPIT", -1);
+ } // Plazma - Optimize default configurations
setComment("entity_timeouts",
"These values define a entity's maximum lifespan. If an",
"entity is in this list and it has survived for longer than",