Compare commits

...

10 Commits

Author SHA1 Message Date
IPECTER 이팩터
2bea73cda8 Fix build.gradle.kts (#72)
* Fix Exploits

* Fix build.gradle.kts

* Fix build.gradle.kts

* Fix build.gradle.kts

* Fix build.gradle.kts

---------

Signed-off-by: IPECTER 이팩터 <80433772+IPECTER@users.noreply.github.com>
2023-12-31 00:23:05 +09:00
IPECTER 이팩터
32dc8ecf43 Fix build.gradle.kts (#70)
* Fix Exploits

* Fix build.gradle.kts

* Fix build.gradle.kts

---------

Signed-off-by: IPECTER 이팩터 <80433772+IPECTER@users.noreply.github.com>
2023-12-31 00:04:27 +09:00
IPECTER 이팩터
2b8e2f03e1 Fix build.gradle.kts (#68)
* Fix Exploits

* Fix build.gradle.kts
2023-12-30 23:52:59 +09:00
IPECTER 이팩터
71835526ee Fix Exploits (#66) 2023-12-30 23:28:47 +09:00
Alpha
8c5f28b971 Update build.yml (#61)
Signed-off-by: Alpha <dev@alpha93.kr>
2023-12-30 19:00:55 +09:00
Alpha
74ac208fa2 Cleanup workflows (#59)
* [CI-Skip] Cleanup workflows

* [CI-Skip] Change Javadocs repo branch

Signed-off-by: Alpha <dev@alpha93.kr>

---------

Signed-off-by: Alpha <dev@alpha93.kr>
2023-12-09 12:25:34 +09:00
Alpha
55fd04ed1a [CI-Skip] Update README.md
Signed-off-by: Alpha <dev@alpha93.kr>
2023-10-26 11:23:05 +09:00
IPECTER
8348420bb7 HotFix - CustomRecipe
Add - Bump Dependencies
2023-10-19 22:22:36 +09:00
IPECTER 이팩터
dbce78374d [CI-SKIP] Improve BiomeTemperatureCache
Signed-off-by: IPECTER 이팩터 <80433772+IPECTER@users.noreply.github.com>
2023-09-28 16:18:18 +09:00
IPECTER 이팩터
23bc7620d2 ImproveBiomeTemperatureCache
Signed-off-by: IPECTER 이팩터 <80433772+IPECTER@users.noreply.github.com>
2023-09-28 16:10:51 +09:00
52 changed files with 386 additions and 323 deletions

View File

@@ -16,21 +16,22 @@ jobs:
strategy: strategy:
matrix: matrix:
base_jdk: [17] base_jdk: [17]
graal: [latest]
os: [ubuntu-22.04] os: [ubuntu-22.04]
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')" if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout action - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Checkout pages - name: Checkout javadocs
uses: actions/checkout@v3 uses: actions/checkout@v4
if: github.ref_name == env.MAIN_BRANCH
with: with:
repository: PlazmaMC/Javadocs
path: javadoc path: javadoc
ref: gh-pages ref: main
token: ${{ secrets.GH_PAT }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate Gradle Wrapper - name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1 uses: gradle/wrapper-validation-action@v1
@@ -38,9 +39,9 @@ jobs:
- name: Set up GraalVM ${{ matrix.base_jdk }} - name: Set up GraalVM ${{ matrix.base_jdk }}
uses: graalvm/setup-graalvm@v1 uses: graalvm/setup-graalvm@v1
with: with:
github-token: ${{ secrets.GH_PAT }} github-token: ${{ secrets.GITHUB_TOKEN }}
java-version: ${{ matrix.base_jdk }} java-version: ${{ matrix.base_jdk }}
version: ${{ matrix.graal }} version: latest
cache: 'gradle' cache: 'gradle'
- name: Configure Git - name: Configure Git
@@ -71,11 +72,11 @@ jobs:
if: github.ref_name == env.MAIN_BRANCH if: github.ref_name == env.MAIN_BRANCH
run: | run: |
export GITHUB_USERNAME=${{ env.ORG_NAME }} export GITHUB_USERNAME=${{ env.ORG_NAME }}
export GITHUB_TOKEN=${{ secrets.GH_PAT }} export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
./gradlew publish --stacktrace ./gradlew publish --stacktrace
- name: Upload Artifacts - name: Upload Artifacts
if: env.DEBUG == 'true' || !startsWith(github.ref_name, 'ver/') if: "!startsWith(github.ref_name, 'ver/')"
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: Artifacts name: Artifacts
@@ -84,24 +85,40 @@ jobs:
Plazma-API/build/docs/javadoc Plazma-API/build/docs/javadoc
- name: Get Release Number - name: Get Release Number
run: echo "RELEASE=$(git ls-remote --tags origin | grep "release" | wc -l)" >> $GITHUB_ENV if: startsWith(github.ref_name, 'ver/')
run: echo "RELEASE=$(git ls-remote --tags origin | grep "build/${{ env.MC_VERSION }}" | wc -l)" >> $GITHUB_ENV
- name: Release Artifacts - name: Release Artifacts
if: startsWith(github.ref_name, 'ver/') if: startsWith(github.ref_name, 'ver/')
uses: marvinpinto/action-automatic-releases@latest uses: softprops/action-gh-release@v0.1.15
with: with:
title: "Release #${{ env.RELEASE }}" name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
automatic_release_tag: release-${{ env.RELEASE }} tag_name: build/${{ env.MC_VERSION }}/${{ env.RELEASE }}
repo_token: "${{ secrets.GH_PAT }}" target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar files: build/libs/*.jar
prerelease: false
- name: Release Artifacts (Latest) - name: Release Artifacts (Latest/Stable)
if: startsWith(github.ref_name, 'ver/') if: startsWith(github.ref_name, 'ver/')
uses: marvinpinto/action-automatic-releases@latest uses: softprops/action-gh-release@v0.1.15
with: with:
title: "Release #${{ env.RELEASE }}" name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
automatic_release_tag: latest-${{ env.MC_VERSION }} tag_name: build/${{ env.MC_VERSION }}/latest
repo_token: "${{ secrets.GH_PAT }}" target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar files: build/libs/*.jar
- name: Release Artifacts (Latest/Development)
if: startsWith(github.ref_name, 'dev/')
uses: softprops/action-gh-release@v0.1.15
with:
name: "Development Build for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/latest
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar
prerelease: false prerelease: false

View File

@@ -1,46 +0,0 @@
name: Deploy Javadocs
on:
push:
branches: ["gh-pages"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

View File

@@ -1,36 +0,0 @@
name: Test build with Normal JDK
on:
push:
branches: [ "ver/*", "feat/*", "dev/*", "expr/*", "ench/*", "impl/*" ]
workflow_dispatch:
jobs:
release:
strategy:
matrix:
jdk: [19.0.2+7]
java: ['temurin']
os: [ubuntu-22.04]
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout action
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK ${{ matrix.java }} ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.java }}
java-version: ${{ matrix.jdk }}
cache: 'gradle'
- name: Test build
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]"
./gradlew applyPatches --stacktrace
./gradlew build --stacktrace

View File

@@ -19,11 +19,13 @@
[main]: https://github.com/PlazmaMC/Plazma [main]: https://github.com/PlazmaMC/Plazma
### This is the branch for Plazma 1.20.1. If you want to know more about Plazma, please check the [main branch][main]. > [!IMPORTANT]
이곳은 플라즈마의 1.20.1용 브랜치 입니다. 플라즈마에 대해 자세히 알고 싶다면 [main 브랜치][main]를 확인해주세요. This is the branch for Plazma 1.20.1. If you want to know more about Plazma, please check the **[main branch][main]**.<br>
이곳은 플라즈마의 1.20.1용 브랜치 입니다. 플라즈마에 대해 자세히 알고 싶다면 **[main 브랜치][main]** 를 확인해주세요.
## ⬇️ Downloads ## ⬇️ Downloads
### If you don't know about Mojmap or Bundler, download **Reobf Paperclip** > [!NOTE]
If you don't know about Mojmap or Bundler, download **Reobf Paperclip**<br>
Mojmap 또는 Bundler에 대해 잘 알지 못한다면, **Reobf Paperclip**을 사용하세요 Mojmap 또는 Bundler에 대해 잘 알지 못한다면, **Reobf Paperclip**을 사용하세요
| **Reobf Paperclip (Default)** | Mojmap Paperclip | Reobf Bundler | Mojmap Bundler | | **Reobf Paperclip (Default)** | Mojmap Paperclip | Reobf Bundler | Mojmap Bundler |

View File

@@ -5,7 +5,7 @@ plugins {
java java
`maven-publish` `maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1" apply false id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.patcher") version "1.5.7-SNAPSHOT" id("io.papermc.paperweight.patcher") version "1.5.10"
} }
repositories { repositories {
@@ -18,30 +18,54 @@ repositories {
} }
dependencies { dependencies {
remapper("net.fabricmc:tiny-remapper:0.8.9:fat") remapper("net.fabricmc:tiny-remapper:0.8.11:fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2") decompiler("net.minecraftforge:forgeflower:2.0.627.2")
paperclip("io.papermc:paperclip:3.0.3") paperclip("io.papermc:paperclip:3.0.3")
} }
allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
publishing {
repositories {
maven {
name = "githubPackage"
url = uri("https://maven.pkg.github.com/PlazmaMC/PlazmaBukkit")
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}
publications.register<MavenPublication>("gpr") {
from(components["java"])
}
}
}
}
subprojects { subprojects {
apply(plugin = "java") apply(plugin = "java")
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
tasks { tasks {
withType<JavaCompile>().configureEach { withType<JavaCompile>().configureEach {
options.encoding = "UTF-8" options.compilerArgs.add("--add-modules=jdk.incubator.vector")
options.encoding = Charsets.UTF_8.name()
options.release.set(17) options.release.set(17)
} }
withType<Javadoc> { withType<Javadoc> {
options.encoding = Charsets.UTF_8.name() options.encoding = Charsets.UTF_8.name()
} }
withType<ProcessResources> { withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name() filteringCharset = Charsets.UTF_8.name()
} }
withType<Test> { withType<Test> {
minHeapSize = "2g" minHeapSize = "2g"
maxHeapSize = "2g" maxHeapSize = "2g"
@@ -79,28 +103,39 @@ paperweight {
} }
} }
val upstreamTask = tasks.register("updateUpstream") { tasks {
val tempDir = layout.cacheDir("updateUpstream"); generateDevelopmentBundle {
val file = "gradle.properties"; apiCoordinates.set("org.plazmamc.plazma:plazma-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
"https://papermc.io/repo/repository/maven-public/"
)
}
doFirst { register("updateUpstream") {
val apiResponse = layout.cache.resolve("apiResponse.json"); val tempDir = layout.cacheDir("updateUpstream");
download.get().download("https://api.github.com/repos/PaperMC/Paper/commits/master", apiResponse); val file = "gradle.properties";
val latestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(apiResponse)["sha"].asString;
copy { doFirst {
from(file) val apiResponse = layout.cache.resolve("apiResponse.json");
into(tempDir) download.get().download("https://api.github.com/repos/PaperMC/Paper/commits/master", apiResponse);
filter { line: String -> val latestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(apiResponse)["sha"].asString;
line.replace("paperCommit = .*".toRegex(), "paperCommit = $latestCommit")
copy {
from(file)
into(tempDir)
filter { line: String ->
line.replace("paperCommit = .*".toRegex(), "paperCommit = $latestCommit")
}
}
}
doLast {
copy {
from(tempDir.file("gradle.properties"))
into(project.file(file).parent)
} }
} }
} }
}
doLast {
copy {
from(tempDir.file("gradle.properties"))
into(project.file(file).parent)
}
}
}

View File

@@ -0,0 +1,73 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com>
Date: Thu, 19 Oct 2023 22:10:35 +0900
Subject: [PATCH] Bump Dependencies
diff --git a/build.gradle.kts b/build.gradle.kts
index dfb989a18ab17fec3b8f0cf90ce2fc1048215265..90a85736247f1d5520a02b66e77405637c033fe9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -11,8 +11,8 @@ java {
val annotationsVersion = "24.0.1"
val bungeeCordChatVersion = "1.20-R0.1"
val adventureVersion = "4.14.0"
-val slf4jVersion = "1.8.0-beta4"
-val log4jVersion = "2.17.1"
+val slf4jVersion = "2.0.9" // Plazma - Bump Dependencies
+val log4jVersion = "2.20.0" // Plazma - Bump Dependencies
val apiAndDocs: Configuration by configurations.creating {
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@@ -27,8 +27,8 @@ configurations.api {
dependencies {
// api dependencies are listed transitively to API consumers
- api("com.google.guava:guava:31.1-jre")
- api("com.google.code.gson:gson:2.10")
+ api("com.google.guava:guava:32.1.2-jre") // Plazma - Bump Dependencies
+ api("com.google.code.gson:gson:2.10.1") // Plazma - Bump Dependencies
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") // Paper
api("org.yaml:snakeyaml:2.0")
api("org.joml:joml:1.10.5")
@@ -46,30 +46,30 @@ 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
+ api("io.sentry:sentry:6.28.0") // Pufferfish // Plazma - Bump Dependencies
- implementation("org.ow2.asm:asm:9.4")
- implementation("org.ow2.asm:asm-commons:9.4")
+ implementation("org.ow2.asm:asm:9.5") // Plazma - Bump Dependencies
+ implementation("org.ow2.asm:asm-commons:9.5") // Plazma - Bump Dependencies
// Paper end
- api("org.apache.maven:maven-resolver-provider:3.8.5")
- compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
- compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
- compileOnly("com.google.code.findbugs:jsr305:1.3.9") // Paper
+ api("org.apache.maven:maven-resolver-provider:3.9.4") // Plazma - Bump Dependencies
+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.15") // Plazma - Bump Dependencies
+ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.15") // Plazma - Bump Dependencies
+ compileOnly("com.google.code.findbugs:jsr305:3.0.2") // Paper // Plazma - Bump Dependencies
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.21.0"
+ val checkerQual = "org.checkerframework:checker-qual:3.38.0" // Plazma - Bump Dependencies
compileOnlyApi(checkerQual)
testCompileOnly(checkerQual)
// Paper end
- testImplementation("org.apache.commons:commons-lang3:3.12.0")
+ testImplementation("org.apache.commons:commons-lang3:3.13.0") // Plazma - Bump Dependencies
testImplementation("junit:junit:4.13.2")
- testImplementation("org.hamcrest:hamcrest-library:1.3")
+ testImplementation("org.hamcrest:hamcrest-library:2.2") // Plazma - Bump Dependencies
testImplementation("org.mockito:mockito-core:5.5.0")
testImplementation("org.ow2.asm:asm-tree:9.5")
}

View File

@@ -1,34 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com>
Date: Mon, 19 Jun 2023 18:19:50 +0900
Subject: [PATCH] Publish-Packages
diff --git a/build.gradle.kts b/build.gradle.kts
index dfb989a18ab17fec3b8f0cf90ce2fc1048215265..bfcb6cf6cf29fec6e22a89cc6045c7030262bb1c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -168,3 +168,22 @@ tasks.check {
dependsOn(scanJar)
}
// Paper end
+// Plazma start
+publishing {
+ repositories {
+ maven {
+ name = "githubPackage"
+ url = uri("https://maven.pkg.github.com/PlazmaMC/Plazma")
+
+ credentials.username = System.getenv("GITHUB_USERNAME")
+ credentials.password = System.getenv("GITHUB_TOKEN")
+ }
+
+ publications {
+ register<MavenPublication>("gpr") {
+ from(components["java"])
+ }
+ }
+ }
+}
+// Plazma end
\ No newline at end of file

View File

@@ -0,0 +1,76 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com>
Date: Thu, 19 Oct 2023 22:20:17 +0900
Subject: [PATCH] Bump Dependencies
diff --git a/build.gradle.kts b/build.gradle.kts
index 3d5397e2e7edf2ea1e1687c58126fd9a5d5d5736..55024a308f7a9125c6739efff4f7742ce530c750 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -20,7 +20,7 @@ dependencies {
}
// Purpur end
// Paper start
- implementation("org.jline:jline-terminal-jansi:3.21.0")
+ implementation("org.jline:jline-terminal-jansi:3.23.0") // Plazma - Bump Dependencies
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
@@ -30,31 +30,31 @@ dependencies {
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
+ implementation("org.apache.logging.log4j:log4j-core:2.20.0") // Paper - implementation // Plazma - Bump Dependencies
+ log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.20.0") // Paper - Needed to generate meta for our Log4j plugins // Plazma - Bump Dependencies
runtimeOnly(log4jPlugins.output)
alsoShade(log4jPlugins.output)
- implementation("io.netty:netty-codec-haproxy:4.1.87.Final") // Paper - Add support for proxy protocol
+ implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol // Plazma - Bump Dependencies
// Paper end
- implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.20.0") // Paper - remove exclusion
implementation("org.ow2.asm:asm:9.5")
implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
- testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
+ testImplementation("org.mockito:mockito-core:5.5.0") // Paper - switch to mockito
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
implementation("commons-lang:commons-lang:2.6")
- implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
+ implementation("net.fabricmc:mapping-io:0.4.2") // Paper - needed to read mappings for stacktrace deobfuscation // Plazma - Bump Dependencies
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0")
runtimeOnly("com.mysql:mysql-connector-j:8.0.33")
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
// Paper start - Use Velocity cipher
- implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
+ implementation("com.velocitypowered:velocity-native:3.2.0-SNAPSHOT") { // Plazma - Bump Dependencies
isTransitive = false
}
// Paper end
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.4") // Plazma - Bump Dependencies
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.15") // Plazma - Bump Dependencies
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.15") // Plazma - Bump Dependencies
implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
@@ -67,11 +67,11 @@ dependencies {
}
// Pufferfish end
- testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
+ testImplementation("io.github.classgraph:classgraph:4.8.162") // Paper - mob goal test // Plazma - Bump Dependencies
testImplementation("junit:junit:4.13.2")
- testImplementation("org.hamcrest:hamcrest-library:1.3")
+ testImplementation("org.hamcrest:hamcrest-library:2.2") // Plazma - Bump Dependencies
- implementation("io.netty:netty-all:4.1.87.Final"); // Paper - Bump netty
+ implementation("io.netty:netty-all:4.1.97.Final"); // Paper - Bump netty // Plazma - Bump Dependencies
}
val craftbukkitPackageVersion = "1_20_R1" // Paper

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 3d5397e2e7edf2ea1e1687c58126fd9a5d5d5736..8a12e0dda9d03f265603b80c9fa108eea736ae84 100644 index 55024a308f7a9125c6739efff4f7742ce530c750..58f10fa32a163ed263c5d1effb6d247bc999bb0b 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating @@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating

View File

@@ -3,11 +3,11 @@ From: IPECTER <ipectert@gmail.com>
Date: Tue, 7 Mar 2023 12:28:34 +0900 Date: Tue, 7 Mar 2023 12:28:34 +0900
Subject: [PATCH] Optimize Default Configurations Subject: [PATCH] Optimize Default Configurations
Original: YouHaveTrouble/minecraft-optimization, AkiraDevelopment/SimplyMC Original: YouHaveTrouble/minecraft-optimization, YouHaveTrouble/minecraft-exploits-and-how-to-fix-them, AkiraDevelopment/SimplyMC
Copyright (C) 2023 YouHaveTrouble, AkiraDevelopment Copyright (C) 2023 YouHaveTrouble, AkiraDevelopment
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index 3e36958365bc136516bafbaad0c168f7956406f1..b5eca4a809d5e7c77de9737941f3f6c35e4fc796 100644 index 3e36958365bc136516bafbaad0c168f7956406f1..47e96912f8cde6e6988b5d609a4fbd8e00b126cb 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java --- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java +++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -211,8 +211,8 @@ public class PufferfishConfig { @@ -211,8 +211,8 @@ public class PufferfishConfig {
@@ -18,12 +18,12 @@ index 3e36958365bc136516bafbaad0c168f7956406f1..b5eca4a809d5e7c77de9737941f3f6c3
- maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed."); - maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 8, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma + maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 8, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma
+ maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed."); + 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"); setComment("projectile", "Optimizes projectile settings");
} }
@@ -225,16 +225,16 @@ public class PufferfishConfig { @@ -225,16 +225,16 @@ public class PufferfishConfig {
public static int activationDistanceMod; public static int activationDistanceMod;
private static void dynamicActivationOfBrains() throws IOException { private static void dynamicActivationOfBrains() throws IOException {
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur - dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
- startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12, - startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
@@ -42,25 +42,81 @@ index 3e36958365bc136516bafbaad0c168f7956406f1..b5eca4a809d5e7c77de9737941f3f6c3
"tick frequency. freq = (distanceToPlayer^2) / (2^value)", "tick frequency. freq = (distanceToPlayer^2) / (2^value)",
"If you want further away entities to tick less often, use 7.", "If you want further away entities to tick less often, use 7.",
"If you want further away entities to tick more often, try 9."); "If you want further away entities to tick more often, try 9.");
@@ -253,8 +253,18 @@ public class PufferfishConfig {
public static Map<String, Integer> projectileTimeouts;
private static void projectileTimeouts() {
// Set some defaults
- getInt("entity_timeouts.SNOWBALL", -1);
- getInt("entity_timeouts.LLAMA_SPIT", -1);
+ // Plazma start - Optimize Default Configurations
+ if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) {
+ 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
+ getInt("entity_timeouts.SNOWBALL", -1);
+ getInt("entity_timeouts.LLAMA_SPIT", -1);
+ } // Plazma
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 diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 3bc7230ca62ebe3426da293e436a962bb0134f85..1a4b5dc4c5340de66553936bbbc074d1654a3ef8 100644 index 3bc7230ca62ebe3426da293e436a962bb0134f85..766e518c6a3b3e684f5fda65a680b5378c9c0479 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -143,7 +143,7 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -143,7 +143,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public class Watchdog extends ConfigurationPart { public class Watchdog extends ConfigurationPart {
public int earlyWarningEvery = 5000; public int earlyWarningEvery = 5000;
- public int earlyWarningDelay = 10000; - public int earlyWarningDelay = 10000;
+ public int earlyWarningDelay = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10000 : 180000; // Plazma - Optimize Default Configurations + public int earlyWarningDelay = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10000 : 180000; // Plazma - Optimize Default Configurations
} }
public SpamLimiter spamLimiter; public SpamLimiter spamLimiter;
@@ -230,7 +230,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public BookSize bookSize;
public class BookSize extends ConfigurationPart {
- public int pageMax = 2560; // TODO this appears to be a duplicate setting with one above
+ public int pageMax = !Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1024 : 2560; // TODO this appears to be a duplicate setting with one above // Plazma - Optimize Default Configurations
public double totalMultiplier = 0.98D; // TODO this should probably be merged into the above inner class
}
public boolean resolveSelectorsInBooks = false;
@@ -241,7 +241,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);
- public Map<Class<? extends Packet<?>>, PacketLimit> overrides = Map.of(ServerboundPlaceRecipePacket.class, new PacketLimit(4.0, 5.0, PacketLimit.ViolateAction.DROP));
+ // Plazma start - Optimize Default Configurations
+ public Map<Class<? extends Packet<?>>, PacketLimit> overrides = new java.util.HashMap<>() {{
+ put(ServerboundPlaceRecipePacket.class, new PacketLimit(4.0, 5.0, PacketLimit.ViolateAction.DROP));
+ if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) {
+ put(net.minecraft.network.protocol.game.ServerboundCommandSuggestionPacket.class, new PacketLimit(1.0, 15.0, PacketLimit.ViolateAction.DROP));
+ put(net.minecraft.network.protocol.game.ServerboundPlaceRecipePacket.class, new PacketLimit(4.0, 5.0, PacketLimit.ViolateAction.DROP));
+ }
+ }};
+ // Plazma end
@ConfigSerializable
public record PacketLimit(@Required double interval, @Required double maxPacketRate, ViolateAction action) {
@@ -308,7 +316,7 @@ public class GlobalConfiguration extends ConfigurationPart {
executor.setMaximumPoolSize(_chatExecutorMaxSize);
}
}
- public int maxJoinsPerTick = 5;
+ public int maxJoinsPerTick = !Boolean.getBoolean("Plazma.disableConfigOptimization") ? 3 : 5; // Plazma - Optimize Default Configurations
public boolean fixEntityPositionDesync = true;
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 diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index f45afb7e2607617d1239abeca13a9002dd9a3a18..844ecc2a6d6677742e87ef22dede28867892a301 100644 index f45afb7e2607617d1239abeca13a9002dd9a3a18..3f7868dbc4b5b7cf665e9d60b146374f79481e42 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java --- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -88,15 +88,15 @@ public class WorldConfiguration extends ConfigurationPart { @@ -88,15 +88,15 @@ public class WorldConfiguration extends ConfigurationPart {
public class AntiXray extends ConfigurationPart { public class AntiXray extends ConfigurationPart {
public boolean enabled = false; public boolean enabled = false;
- public EngineMode engineMode = EngineMode.HIDE; - public EngineMode engineMode = EngineMode.HIDE;
@@ -79,14 +135,25 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..844ecc2a6d6677742e87ef22dede2886
+ // Plazma end + // Plazma end
} }
} }
@@ -120,8 +120,8 @@ public class WorldConfiguration extends ConfigurationPart {
public ArmorStands armorStands;
public class ArmorStands extends ConfigurationPart {
- public boolean doCollisionEntityLookups = true;
- public boolean tick = true;
+ public boolean doCollisionEntityLookups = Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
+ public boolean tick = Boolean.getBoolean("Plazma.disableConfigOptimization");; // Plazma - Optimize Default Configurations
}
public Markers markers;
@@ -150,7 +150,7 @@ public class WorldConfiguration extends ConfigurationPart { @@ -150,7 +150,7 @@ public class WorldConfiguration extends ConfigurationPart {
@MergeMap @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))); 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 @MergeMap
- public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance()))); - public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), Boolean.getBoolean("Plazma.disableConfigOptimization") ? category.getDespawnDistance() : (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8))); // Plazma - Optimize Default Configurations + public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), Boolean.getBoolean("Plazma.disableConfigOptimization") ? category.getDespawnDistance() : (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8))); // Plazma - Optimize Default Configurations
@ConfigSerializable @ConfigSerializable
public record DespawnRange(@Required int soft, @Required int hard) { public record DespawnRange(@Required int soft, @Required int hard) {
@@ -372,7 +372,7 @@ public class WorldConfiguration extends ConfigurationPart { @@ -372,7 +372,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -109,9 +176,9 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..844ecc2a6d6677742e87ef22dede2886
+ public int maxEntityCollisions = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 2; // Plazma - Optimize Default Configurations + public int maxEntityCollisions = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 2; // Plazma - Optimize Default Configurations
public boolean allowPlayerCrammingDamage = false; public boolean allowPlayerCrammingDamage = false;
} }
@@ -462,18 +462,40 @@ public class WorldConfiguration extends ConfigurationPart { @@ -462,18 +462,40 @@ public class WorldConfiguration extends ConfigurationPart {
public class Chunks extends ConfigurationPart { public class Chunks extends ConfigurationPart {
public AutosavePeriod autoSaveInterval = AutosavePeriod.def(); public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
- public int maxAutoSaveChunksPerTick = 24; - public int maxAutoSaveChunksPerTick = 24;
@@ -162,7 +229,7 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..844ecc2a6d6677742e87ef22dede2886
} }
@@ -488,9 +510,9 @@ public class WorldConfiguration extends ConfigurationPart { @@ -488,9 +510,9 @@ public class WorldConfiguration extends ConfigurationPart {
public TickRates tickRates; public TickRates tickRates;
public class TickRates extends ConfigurationPart { public class TickRates extends ConfigurationPart {
- public int grassSpread = 1; - public int grassSpread = 1;
+ public int grassSpread = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 4; // Plazma - Optimize Default Configurations + public int grassSpread = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 1 : 4; // Plazma - Optimize Default Configurations
@@ -173,7 +240,7 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..844ecc2a6d6677742e87ef22dede2886
public Table<EntityType<?>, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1)); public Table<EntityType<?>, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1));
} }
@@ -514,9 +536,9 @@ public class WorldConfiguration extends ConfigurationPart { @@ -514,9 +536,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Misc extends ConfigurationPart { public class Misc extends ConfigurationPart {
public int lightQueueSize = 20; public int lightQueueSize = 20;
- public boolean updatePathfindingOnBlockUpdate = true; - public boolean updatePathfindingOnBlockUpdate = true;
@@ -189,13 +256,13 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..18bc271a34ffba8c83743fef7eaf4a2c
--- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java --- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
+++ b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java +++ b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
@@ -29,6 +29,7 @@ public class ArrowDespawnRate extends FallbackValue.Int { @@ -29,6 +29,7 @@ public class ArrowDespawnRate extends FallbackValue.Int {
@Override @Override
protected int fallback() { protected int fallback() {
+ if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) return 100; // Plazma - Optimize Default Configurations + if (!Boolean.getBoolean("Plazma.disableConfigOptimization")) return 100; // Plazma - Optimize Default Configurations
return this.get(FallbackValue.SPIGOT_WORLD_CONFIG).arrowDespawnRate; return this.get(FallbackValue.SPIGOT_WORLD_CONFIG).arrowDespawnRate;
} }
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index ed7bcd832340a7a46897f0275c99e72b7247a5de..65e0a4c04b91e6fd6d2959927bdb75a4fcf8f86b 100644 index ed7bcd832340a7a46897f0275c99e72b7247a5de..65e0a4c04b91e6fd6d2959927bdb75a4fcf8f86b 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
@@ -207,10 +274,10 @@ index ed7bcd832340a7a46897f0275c99e72b7247a5de..65e0a4c04b91e6fd6d2959927bdb75a4
- configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8))); - configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8)));
+ configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream(Boolean.getBoolean("Plazma.disableConfigOptimization") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations + configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream(Boolean.getBoolean("Plazma.disableConfigOptimization") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations
configuration.save(configFile); configuration.save(configFile);
File commandFile = (File) optionset.valueOf("commands-settings"); 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 diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 1ea3012995c738c67b31e997c138f824f9e69ba1..8ed00a650b712cbf4bc8796165a539d76d390d0f 100644 index 1ea3012995c738c67b31e997c138f824f9e69ba1..aa37c7a7bfe75064db9cf78e967a6644f61b0e09 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -120,7 +120,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie @@ -120,7 +120,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -233,7 +300,8 @@ index 1ea3012995c738c67b31e997c138f824f9e69ba1..8ed00a650b712cbf4bc8796165a539d7
this.opPermissionLevel = this.get("op-permission-level", 4); this.opPermissionLevel = this.get("op-permission-level", 4);
this.functionPermissionLevel = this.get("function-permission-level", 2); this.functionPermissionLevel = this.get("function-permission-level", 2);
this.maxTickTime = this.get("max-tick-time", TimeUnit.MINUTES.toMillis(1L)); this.maxTickTime = this.get("max-tick-time", TimeUnit.MINUTES.toMillis(1L));
this.maxChainedNeighborUpdates = this.get("max-chained-neighbor-updates", 1000000); - this.maxChainedNeighborUpdates = this.get("max-chained-neighbor-updates", 1000000);
+ this.maxChainedNeighborUpdates = this.get("max-chained-neighbor-updates", !Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10000 : 1000000); // Plazma - Optimize Default Configurations
this.rateLimitPacketsPerSecond = this.get("rate-limit", 0); this.rateLimitPacketsPerSecond = this.get("rate-limit", 0);
- this.viewDistance = this.get("view-distance", 10); - this.viewDistance = this.get("view-distance", 10);
- this.simulationDistance = this.get("simulation-distance", 10); - this.simulationDistance = this.get("simulation-distance", 10);
@@ -256,7 +324,7 @@ index c43023fecf0882101248f625a28975586da05071..6b092fec6e8c468f3ecd2fc150f54634
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -429,7 +429,7 @@ public final class CraftServer implements Server { @@ -429,7 +429,7 @@ public final class CraftServer implements Server {
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile()); this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
this.configuration.options().copyDefaults(true); this.configuration.options().copyDefaults(true);
- this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8))); - this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8)));
@@ -279,11 +347,11 @@ index d0d31002562e728fa1a6c9bc81baa4534f11d365..d0968eeb0f9edeee43394da8a32d3ee8
+ // Plazma end + // Plazma end
private static File CONFIG_FILE; private static File CONFIG_FILE;
public static YamlConfiguration config; public static YamlConfiguration config;
@@ -241,7 +244,7 @@ public class PurpurConfig { @@ -241,7 +244,7 @@ public class PurpurConfig {
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold); laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
} }
- public static boolean useAlternateKeepAlive = false; - public static boolean useAlternateKeepAlive = false;
+ public static boolean useAlternateKeepAlive = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations + public static boolean useAlternateKeepAlive = !Boolean.getBoolean("Plazma.disableConfigOptimization"); // Plazma - Optimize Default Configurations
private static void useAlternateKeepAlive() { private static void useAlternateKeepAlive() {
@@ -323,7 +391,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
+ this.itemMerge = this.getDouble("merge-radius.item", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 2.5 : 3.5 ); // Plazma - Optimize Default Configurations + this.itemMerge = this.getDouble("merge-radius.item", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 2.5 : 3.5 ); // Plazma - Optimize Default Configurations
this.log( "Item Merge Radius: " + this.itemMerge ); this.log( "Item Merge Radius: " + this.itemMerge );
} }
public double expMerge; public double expMerge;
private void expMerge() private void expMerge()
{ {
@@ -331,7 +399,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
+ this.expMerge = this.getDouble("merge-radius.exp", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 3.0 : 4.0 ); // Plazma - Optimize Default Configurations + this.expMerge = this.getDouble("merge-radius.exp", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 3.0 : 4.0 ); // Plazma - Optimize Default Configurations
this.log( "Experience Merge Radius: " + this.expMerge ); this.log( "Experience Merge Radius: " + this.expMerge );
} }
@@ -196,7 +196,7 @@ public class SpigotWorldConfig @@ -196,7 +196,7 @@ public class SpigotWorldConfig
public byte mobSpawnRange; public byte mobSpawnRange;
private void mobSpawnRange() private void mobSpawnRange()
@@ -340,11 +408,11 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
+ this.mobSpawnRange = (byte) getInt( "mob-spawn-range", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 3 ); // Paper - Vanilla // Plazma - Optimize Default Configurations + this.mobSpawnRange = (byte) getInt( "mob-spawn-range", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 3 ); // Paper - Vanilla // Plazma - Optimize Default Configurations
this.log( "Mob Spawn Range: " + this.mobSpawnRange ); this.log( "Mob Spawn Range: " + this.mobSpawnRange );
} }
@@ -207,26 +207,26 @@ public class SpigotWorldConfig @@ -207,26 +207,26 @@ public class SpigotWorldConfig
this.log( "Item Despawn Rate: " + this.itemDespawnRate ); this.log( "Item Despawn Rate: " + this.itemDespawnRate );
} }
- public int animalActivationRange = 32; - public int animalActivationRange = 32;
- public int monsterActivationRange = 32; - public int monsterActivationRange = 32;
+ public int animalActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 16; // Plazma - Optimize Default Configurations + public int animalActivationRange = Boolean.getBoolean("Plazma.disableConfigOptimization") ? 32 : 16; // Plazma - Optimize Default Configurations
@@ -409,10 +477,10 @@ index 0000000000000000000000000000000000000000..eb33b0a19d6060f78d7ead7a2ad63b1b
+# As you can see, there's actually not that much to configure without any plugins. +# As you can see, there's actually not that much to configure without any plugins.
+# For a reference for any variable inside this file, check out the Bukkit Wiki at +# For a reference for any variable inside this file, check out the Bukkit Wiki at
+# https://www.spigotmc.org/go/bukkit-yml +# https://www.spigotmc.org/go/bukkit-yml
+# +#
+# If you need help on this file, feel free to join us on Discord or leave a message +# If you need help on this file, feel free to join us on Discord or leave a message
+# on the forums asking for advice. +# on the forums asking for advice.
+# +#
+# Discord: https://www.spigotmc.org/go/discord +# Discord: https://www.spigotmc.org/go/discord
+# Forums: https://www.spigotmc.org/ +# Forums: https://www.spigotmc.org/
+# Bug tracker: https://www.spigotmc.org/go/bugs +# Bug tracker: https://www.spigotmc.org/go/bugs

View File

@@ -1,13 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com> From: IPECTER <ipectert@gmail.com>
Date: Tue, 28 Mar 2023 12:42:17 +0900 Date: Tue, 28 Mar 2023 12:42:17 +0900
Subject: [PATCH] Implement MemoryLeakFix Subject: [PATCH] Improve BiomeTemperatureCache
Original: fxmorin/MemoryLeakFix
Copyright (C) 2023 fxmorin
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bfad12d127 100644 index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..71880b6fde3a287aa75c3799ffdd82a7943bb9db 100644
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java --- a/src/main/java/net/minecraft/world/level/biome/Biome.java
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java +++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
@@ -67,7 +67,7 @@ public final class Biome { @@ -67,7 +67,7 @@ public final class Biome {
@@ -15,7 +13,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf
private final BiomeSpecialEffects specialEffects; private final BiomeSpecialEffects specialEffects;
// Pufferfish start - use our cache // Pufferfish start - use our cache
- private final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { - private final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> {
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - MemoryLeakFix + private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - Improve BiomeTemperatureCache
return Util.make(() -> { return Util.make(() -> {
/* /*
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) { Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
@@ -24,7 +22,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf
long l = blockPos.asLong(); long l = blockPos.asLong();
// Pufferfish start // Pufferfish start
- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get(); - gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get();
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - MemoryLeakFix + gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Improve BiomeTemperatureCache
float f = cache.getValue(l); float f = cache.getValue(l);
if (!Float.isNaN(f)) { if (!Float.isNaN(f)) {
return f; return f;

View File

@@ -1,106 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com>
Date: Wed, 6 Sep 2023 16:23:56 +0900
Subject: [PATCH] CarpetFixes-Optimizations-RecipeManager
Original: fxmorin/carpet-fixes
Copyright (C) 2023 fxmorin
RecipeManager optimization.
Optimized by taking out streams & doing extra early checks to quickly remove unrelated recipes
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
index 9ffb6999171f602f0b113dac40e0130410cad870..49b5fece692cd5da99ed21d7fd0864cea1609495 100644
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
@@ -103,13 +103,38 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
}
public <C extends Container, T extends Recipe<C>> Optional<T> getRecipeFor(RecipeType<T> type, C inventory, Level world) {
- // CraftBukkit start
- Optional<T> recipe = this.byType(type).values().stream().filter((irecipe) -> {
- return irecipe.matches(inventory, world);
- }).findFirst();
- inventory.setCurrentRecipe(recipe.orElse(null)); // CraftBukkit - Clear recipe when no recipe is found
- // CraftBukkit end
- return recipe;
+ // Plazma start - CarpetFixes - Optimized RecipeManager
+ if (world.plazmaLevelConfiguration().carpetFixes.optimizedRecipeManager() && type == RecipeType.CRAFTING) {
+ int slots = 0;
+ int count;
+ //compare size to quickly remove recipes that are not even close. Plus remove streams
+ for (int slot = 0; slot < inventory.getContainerSize(); slot++)
+ if (!inventory.getItem(slot).isEmpty()) slots++;
+ for (Recipe<C> recipe : this.byType(type).values()) {
+ count = 0;
+ if (recipe instanceof CustomRecipe) {
+ if (recipe.matches(inventory, world)) {
+ return (Optional<T>) Optional.of(recipe);
+ }
+ } else {
+ for (Ingredient ingredient : recipe.getIngredients())
+ if (ingredient != Ingredient.EMPTY) count++;
+ if (count == slots && recipe.matches(inventory, world)) {
+ return (Optional<T>) Optional.of(recipe);
+ }
+ }
+ }
+ return Optional.empty();
+ } else {
+ // CraftBukkit start
+ Optional<T> recipe = this.byType(type).values().stream().filter((irecipe) -> {
+ return irecipe.matches(inventory, world);
+ }).findFirst();
+ inventory.setCurrentRecipe(recipe.orElse(null)); // CraftBukkit - Clear recipe when no recipe is found
+ // CraftBukkit end
+ return recipe;
+ }
+ // Plazma end
}
public <C extends Container, T extends Recipe<C>> Optional<Pair<ResourceLocation, T>> getRecipeFor(RecipeType<T> type, C inventory, Level world, @Nullable ResourceLocation id) {
@@ -134,7 +159,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
}
public <C extends Container, T extends Recipe<C>> List<T> getAllRecipesFor(RecipeType<T> type) {
- return List.copyOf(this.byType(type).values());
+ return org.plazmamc.plazma.configurations.GlobalConfiguration.get().carpetFixes.optimizedRecipeManager() ? (List<T>) new java.util.ArrayList<>(this.byType(type).values()) : List.copyOf(this.byType(type).values()); // Plazma start - CarpetFixes - Optimized RecipeManager
}
public <C extends Container, T extends Recipe<C>> List<T> getRecipesFor(RecipeType<T> type, C inventory, Level world) {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index d329f77ab19ac781506c26909591fa4ae9dabb1e..36511f71fcf3a8a5da746dd087003861a4f0a8f4 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -83,10 +83,15 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean enabled = DO_OPTIMIZE;
boolean optimizedBiomeAccess = true;
+ boolean optimizedRecipeManager = true;
public boolean optimizedBiomeAccess() {
return enabled && optimizedBiomeAccess;
}
+ public boolean optimizedRecipeManager() {
+ return enabled && optimizedRecipeManager;
+ }
+
}
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
index b0deec445b5ea3cd3e4802eca04e99818b539bd8..e089a881600b61060bae1135b89703f6c0b5c7e8 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
@@ -137,6 +137,11 @@ public class LevelConfigurations extends ConfigurationPart {
public class CarpetFixes extends ConfigurationPart {
public boolean enabled = DO_OPTIMIZE;
+ boolean optimizedRecipeManager = true;
+
+ public boolean optimizedRecipeManager() {
+ return enabled && optimizedRecipeManager;
+ }
}
}

View File

@@ -56,23 +56,19 @@ index 54de1f782e45cb3e3b1442aeb56b6e8547b065c0..3b873dd76c0f10a7f29206e46c1bf9b2
private static CraftingContainer makeContainer(DyeColor firstColor, DyeColor secondColor) { private static CraftingContainer makeContainer(DyeColor firstColor, DyeColor secondColor) {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
index e089a881600b61060bae1135b89703f6c0b5c7e8..29d451f55dabc15478e9c32d2c37bd0ea2d9bebc 100644 index b0deec445b5ea3cd3e4802eca04e99818b539bd8..de1fa9ccb088597d059e8dc7fbb0c8788e3815fc 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java --- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java +++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
@@ -138,10 +138,15 @@ public class LevelConfigurations extends ConfigurationPart { @@ -137,6 +137,11 @@ public class LevelConfigurations extends ConfigurationPart {
public class CarpetFixes extends ConfigurationPart {
public boolean enabled = DO_OPTIMIZE; public boolean enabled = DO_OPTIMIZE;
boolean optimizedRecipeManager = true;
+ boolean optimizedSheepChildColor = false; + boolean optimizedSheepChildColor = false;
+
public boolean optimizedRecipeManager() {
return enabled && optimizedRecipeManager;
}
+ public boolean optimizedSheepChildColor() { + public boolean optimizedSheepChildColor() {
+ return enabled && optimizedSheepChildColor; + return enabled && optimizedSheepChildColor;
+ } + }
+
} }
} }
diff --git a/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java b/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java diff --git a/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java b/src/main/java/org/plazmamc/plazma/util/CarpetFixesUtils.java

View File

@@ -840,10 +840,10 @@ index 0e2b14e7dfedf209d63279c81723fd7955122d78..6e2c0790c3b932d3aad1b1eaf11d2798
public SwimNodeEvaluator(boolean canJumpOutOfWater) { public SwimNodeEvaluator(boolean canJumpOutOfWater) {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 36511f71fcf3a8a5da746dd087003861a4f0a8f4..06947eea29a23d8fa1fc87d5036b9297274f9060 100644 index d329f77ab19ac781506c26909591fa4ae9dabb1e..dc1553d555b0fa7015bdf55cb3fa0db786d6d253 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java --- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java +++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -94,4 +94,33 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -89,4 +89,33 @@ public class GlobalConfiguration extends ConfigurationPart {
} }
} }
@@ -878,7 +878,7 @@ index 36511f71fcf3a8a5da746dd087003861a4f0a8f4..06947eea29a23d8fa1fc87d5036b9297
+ } + }
} }
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
index 29d451f55dabc15478e9c32d2c37bd0ea2d9bebc..ed1963723db04aa027e987f1aa421b2a3e914cc4 100644 index de1fa9ccb088597d059e8dc7fbb0c8788e3815fc..6b69321b940e1083bd687a0c38fb8faa4801aa26 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java --- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java +++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
@@ -130,6 +130,19 @@ public class LevelConfigurations extends ConfigurationPart { @@ -130,6 +130,19 @@ public class LevelConfigurations extends ConfigurationPart {

View File

@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com>
Date: Sat, 30 Dec 2023 21:50:18 +0900
Subject: [PATCH] Paper-Add-another-slot-sanity-check
Backport of Paper ver/1.20.2 8493340
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
index 38d47fbcd49cc291040ea00470abeb982fe2714c..662f3eee6ff17e0b0191b1c59066465db818ed2b 100644
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
@@ -600,7 +600,7 @@ public abstract class AbstractContainerMenu {
int j2;
if (actionType == ClickType.SWAP) {
- if (slotIndex < 0) return; // Paper
+ if (slotIndex < 0 || button < 0) return; // Paper
slot2 = (Slot) this.slots.get(slotIndex);
itemstack1 = playerinventory.getItem(button);
itemstack = slot2.getItem();