Compare commits

...

12 Commits

Author SHA1 Message Date
Alpha
6f0b4273b3 Add option to disable startup warning (#80) 2024-01-18 23:26:41 +09:00
jihwan0511
9871a130b7 fix exploit (#74)
Validate ResourceLocation in NBT reading

Signed-off-by: jihwan0511 <98388174+jihwan0511@users.noreply.github.com>
2024-01-05 14:17:05 +09:00
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
54 changed files with 447 additions and 322 deletions

View File

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

View File

@@ -1,14 +0,0 @@
name: Close invalid PRs
on:
pull_request_target:
types: [ opened ]
jobs:
run:
if: ${{ github.repository != github.event.pull_request.head.repo.full_name && !startsWith(github.head_ref, 'ver/') }}
runs-on: ubuntu-22.04
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "Please do not open pull requests from the `master` branch, create a new branch instead."

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
### This is the branch for Plazma 1.20.1. If you want to know more about Plazma, please check the [main branch][main].
이곳은 플라즈마의 1.20.1용 브랜치 입니다. 플라즈마에 대해 자세히 알고 싶다면 [main 브랜치][main]를 확인해주세요.
> [!IMPORTANT]
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
### 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**을 사용하세요
| **Reobf Paperclip (Default)** | Mojmap Paperclip | Reobf Bundler | Mojmap Bundler |

View File

@@ -5,7 +5,7 @@ plugins {
java
`maven-publish`
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 {
@@ -18,19 +18,43 @@ repositories {
}
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")
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 {
apply(plugin = "java")
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
tasks {
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)
}
@@ -79,7 +103,17 @@ paperweight {
}
}
val upstreamTask = tasks.register("updateUpstream") {
tasks {
generateDevelopmentBundle {
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/"
)
}
register("updateUpstream") {
val tempDir = layout.cacheDir("updateUpstream");
val file = "gradle.properties";
@@ -104,3 +138,4 @@ val upstreamTask = tasks.register("updateUpstream") {
}
}
}
}

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
index 3d5397e2e7edf2ea1e1687c58126fd9a5d5d5736..8a12e0dda9d03f265603b80c9fa108eea736ae84 100644
index 55024a308f7a9125c6739efff4f7742ce530c750..58f10fa32a163ed263c5d1effb6d247bc999bb0b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
@@ -153,10 +153,10 @@ index b5b6657e52e4f7a630229bd3ba433438af293e22..c468733f44ccb3ff4ba3c20921a4ec52
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 a7ebf851a65231074c89a24f30de4ac2fb5b63e4..ed7bcd832340a7a46897f0275c99e72b7247a5de 100644
index a7ebf851a65231074c89a24f30de4ac2fb5b63e4..6f8b44bdf4d419b2bf0982dc209def53e4b4763c 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -111,6 +111,18 @@ public class Main {
@@ -111,6 +111,19 @@ public class Main {
*/ // CraftBukkit end
try {
@@ -169,6 +169,7 @@ index a7ebf851a65231074c89a24f30de4ac2fb5b63e4..ed7bcd832340a7a46897f0275c99e72b
+ \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┛
+ """);
+ 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.");
+ // Plazma end
+
@@ -321,6 +322,19 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0e695ea608c4e4770f5491d54ad47616
}
+ // Plazma end
}
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 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa4534f11d365 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java

View File

@@ -3,11 +3,11 @@ From: IPECTER <ipectert@gmail.com>
Date: Tue, 7 Mar 2023 12:28:34 +0900
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
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..78bd9082366ea678c1ee4107b69845062eeede86 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -211,8 +211,8 @@ public class PufferfishConfig {
@@ -42,8 +42,29 @@ index 3e36958365bc136516bafbaad0c168f7956406f1..b5eca4a809d5e7c77de9737941f3f6c3
"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 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
index 3bc7230ca62ebe3426da293e436a962bb0134f85..1a4b5dc4c5340de66553936bbbc074d1654a3ef8 100644
index 3bc7230ca62ebe3426da293e436a962bb0134f85..af7dd492435f66877078a69310c20c42757525f2 100644
--- a/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 {
@@ -55,8 +76,43 @@ index 3bc7230ca62ebe3426da293e436a962bb0134f85..1a4b5dc4c5340de66553936bbbc074d1
}
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
index f45afb7e2607617d1239abeca13a9002dd9a3a18..844ecc2a6d6677742e87ef22dede28867892a301 100644
index f45afb7e2607617d1239abeca13a9002dd9a3a18..3f7868dbc4b5b7cf665e9d60b146374f79481e42 100644
--- a/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 {
@@ -80,6 +136,17 @@ index f45afb7e2607617d1239abeca13a9002dd9a3a18..844ecc2a6d6677742e87ef22dede2886
}
}
@@ -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 {
@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)));
@@ -197,10 +264,10 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..18bc271a34ffba8c83743fef7eaf4a2c
}
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 6f8b44bdf4d419b2bf0982dc209def53e4b4763c..c1ea9101bfc4c101c98ea14d1db71dcb95cb7ceb 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -166,7 +166,7 @@ public class Main {
@@ -167,7 +167,7 @@ public class Main {
File configFile = (File) optionset.valueOf("bukkit-settings");
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile);
configuration.options().copyDefaults(true);
@@ -210,7 +277,7 @@ index ed7bcd832340a7a46897f0275c99e72b7247a5de..65e0a4c04b91e6fd6d2959927bdb75a4
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 1ea3012995c738c67b31e997c138f824f9e69ba1..8ed00a650b712cbf4bc8796165a539d76d390d0f 100644
index 1ea3012995c738c67b31e997c138f824f9e69ba1..9683794c187dcafc1fbbde4c074cb86402467cb1 100644
--- a/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
@@ -233,7 +300,8 @@ index 1ea3012995c738c67b31e997c138f824f9e69ba1..8ed00a650b712cbf4bc8796165a539d7
this.opPermissionLevel = this.get("op-permission-level", 4);
this.functionPermissionLevel = this.get("function-permission-level", 2);
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.viewDistance = this.get("view-distance", 10);
- this.simulationDistance = this.get("simulation-distance", 10);
@@ -401,7 +469,7 @@ index 5b5109e942b18418b3a3a0e2109fe4ef15045fe5..e24106f0d936375f200cb82339dc03f8
}
diff --git a/src/main/resources/configurations/bukkit_optimized.yml b/src/main/resources/configurations/bukkit_optimized.yml
new file mode 100644
index 0000000000000000000000000000000000000000..eb33b0a19d6060f78d7ead7a2ad63b1b2581293d
index 0000000000000000000000000000000000000000..93589d95cea41b7f4cf89be600b004ec42e8bd26
--- /dev/null
+++ b/src/main/resources/configurations/bukkit_optimized.yml
@@ -0,0 +1,45 @@

View File

@@ -1,13 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com>
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
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bfad12d127 100644
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..71880b6fde3a287aa75c3799ffdd82a7943bb9db 100644
--- a/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 {
@@ -15,7 +13,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf
private final BiomeSpecialEffects specialEffects;
// Pufferfish start - use our cache
- 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(() -> {
/*
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
@@ -24,7 +22,7 @@ index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..2bddcaf8762ee7834c32622402a976bf
long l = blockPos.asLong();
// Pufferfish start
- 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);
if (!Float.isNaN(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) {
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
+++ 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;
boolean optimizedRecipeManager = true;
+ boolean optimizedSheepChildColor = false;
public boolean optimizedRecipeManager() {
return enabled && optimizedRecipeManager;
}
+
+ public boolean 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

View File

@@ -840,10 +840,10 @@ index 0e2b14e7dfedf209d63279c81723fd7955122d78..6e2c0790c3b932d3aad1b1eaf11d2798
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
index 36511f71fcf3a8a5da746dd087003861a4f0a8f4..06947eea29a23d8fa1fc87d5036b9297274f9060 100644
index d329f77ab19ac781506c26909591fa4ae9dabb1e..dc1553d555b0fa7015bdf55cb3fa0db786d6d253 100644
--- a/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
index 29d451f55dabc15478e9c32d2c37bd0ea2d9bebc..ed1963723db04aa027e987f1aa421b2a3e914cc4 100644
index de1fa9ccb088597d059e8dc7fbb0c8788e3815fc..6b69321b940e1083bd687a0c38fb8faa4801aa26 100644
--- a/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 {

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();

View File

@@ -0,0 +1,62 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: jihwan0511 <cgjjj320@gmail.com>
Date: Fri, 5 Jan 2024 06:04:37 +0100
Subject: [PATCH] Validate ResourceLocation in NBT reading
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
index 7bc60901297d27d88efb401d02b4bc06d8b28874..f1b936bbef9a29d929646360df484fe24ade9780 100644
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
@@ -230,8 +230,10 @@ public final class NbtUtils {
if (!nbt.contains("Name", 8)) {
return Blocks.AIR.defaultBlockState();
} else {
- ResourceLocation resourceLocation = new ResourceLocation(nbt.getString("Name"));
- Optional<? extends Holder<Block>> optional = blockLookup.get(ResourceKey.create(Registries.BLOCK, resourceLocation));
+ // Paper start - Validate resource location
+ ResourceLocation resourceLocation = ResourceLocation.tryParse(nbt.getString("Name"));
+ Optional<? extends Holder<Block>> optional = resourceLocation != null ? blockLookup.get(ResourceKey.create(Registries.BLOCK, resourceLocation)) : Optional.empty();
+ // Paper end
if (optional.isEmpty()) {
return Blocks.AIR.defaultBlockState();
} else {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 699b166b6438cbe0cd197547df4d8dc4359e0b34..0d3ab6d59087da828698ae847929a31585f6796c 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -644,7 +644,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
this.setLeftHanded(nbt.getBoolean("LeftHanded"));
if (nbt.contains("DeathLootTable", 8)) {
- this.lootTable = new ResourceLocation(nbt.getString("DeathLootTable"));
+ this.lootTable = ResourceLocation.tryParse(nbt.getString("DeathLootTable")); // Paper - Validate ResourceLocation
this.lootTableSeed = nbt.getLong("DeathLootTableSeed");
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 6b070ad6aa1b62a66fb85d54042af9d64cdcea7f..306e30541aeed280c23ddfc8ca87a2fc4ea10a55 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -542,7 +542,7 @@ public abstract class AbstractArrow extends Projectile {
this.setCritArrow(nbt.getBoolean("crit"));
this.setPierceLevel(nbt.getByte("PierceLevel"));
if (nbt.contains("SoundEvent", 8)) {
- this.soundEvent = (SoundEvent) BuiltInRegistries.SOUND_EVENT.getOptional(new ResourceLocation(nbt.getString("SoundEvent"))).orElse(this.getDefaultHitGroundSoundEvent());
+ this.soundEvent = (SoundEvent) BuiltInRegistries.SOUND_EVENT.getOptional(ResourceLocation.tryParse(nbt.getString("SoundEvent"))).orElse(this.getDefaultHitGroundSoundEvent()); // Paper - Validate resource location
}
this.setShotFromCrossbow(nbt.getBoolean("ShotFromCrossbow"));
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
index 7529751afa2932fd16bc4591189b0358268a7b14..e2e1c7a017e82dc7299e5cd1783818e4f0319c0b 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
@@ -67,7 +67,7 @@ public interface ContainerEntity extends Container, MenuProvider {
default void readChestVehicleSaveData(CompoundTag nbt) {
this.clearItemStacks();
if (nbt.contains("LootTable", 8)) {
- this.setLootTable(new ResourceLocation(nbt.getString("LootTable")));
+ this.setLootTable(ResourceLocation.tryParse(nbt.getString("LootTable"))); // Paper - Validate ResourceLocation
this.setLootTableSeed(nbt.getLong("LootTableSeed"));
}