Remove all backwards compatibility due to 1.17 NMS changes

Arrow patch needs to be tested
This commit is contained in:
Telesphoreo 2021-09-29 21:07:21 -05:00
parent bd4c2bb449
commit 449a32fa9f
70 changed files with 656 additions and 3403 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/.gradle/
/build/
.DS_Store

View file

@ -2,11 +2,11 @@
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher" target="1.8" />
<module name="me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher" target="16" />
<module name="me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher.main" target="1.8" />
<module name="me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher.test" target="1.8" />
<module name="VulnerabilityPatcher.main" target="1.8" />
<module name="VulnerabilityPatcher.test" target="1.8" />
<module name="VulnerabilityPatcher.main" target="16" />
<module name="VulnerabilityPatcher.test" target="16" />
</bytecodeTargetLevel>
</component>
</project>

View file

@ -4,17 +4,16 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="C:/Gradle/gradle-5.0" />
<option name="gradleJvm" value="1.8" />
<option name="gradleJvm" value="16" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="useAutoImport" value="true" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

View file

@ -26,5 +26,30 @@
<option name="name" value="sonatype" />
<option name="url" value="https://oss.sonatype.org/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://hub.spigotmc.org/nexus/content/repositories/snapshots/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" />
</remote-repository>
<remote-repository>
<option name="id" value="maven3" />
<option name="name" value="maven3" />
<option name="url" value="https://oss.sonatype.org/content/repositories/central" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenLocal" />
<option name="name" value="MavenLocal" />
<option name="url" value="file:$MAVEN_REPOSITORY$/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven3" />
<option name="name" value="maven3" />
<option name="url" value="https://repo.codemc.io/repository/nms/" />
</remote-repository>
</component>
</project>

View file

@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="Gradle: com.destroystokyo.paper:paper-api:1.14-R0.1-SNAPSHOT">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.destroystokyo.paper/paper-api/1.14-R0.1-SNAPSHOT/389a9162fe8fe8b127d4ec5b7d9c7e69f6a03e04/paper-api-1.14-R0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.destroystokyo.paper/paper-api/1.14-R0.1-SNAPSHOT/d8eb6e238bfa98e57fbfaa2963c230e33dffcc47/paper-api-1.14-R0.1-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Gradle: com.google.code.findbugs:jsr305:1.3.9">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/1.3.9/40719ea6961c0cb6afaeb6a921eaa1f6afd4cfdf/jsr305-1.3.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -3,9 +3,7 @@
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/c4ba5371a29ac9b2ad6129b1d39ea38750043eff/gson-2.8.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/4791230388bf03457c7e235b69479b46a5931861/gson-2.8.0-javadoc.jar!/" />
</JAVADOC>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/baf95d8519fc1a11d388f8543cb40cd2bb9d66dc/gson-2.8.0-sources.jar!/" />
</SOURCES>

View file

@ -3,9 +3,7 @@
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/21.0/3a3d111be1be1b745edfa7d91678a12d7ed38709/guava-21.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/21.0/7d48c9b5304b8bab31d1ed7c9ef9670b646866c0/guava-21.0-javadoc.jar!/" />
</JAVADOC>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/21.0/b9ed26b8c23fe7cd3e6b463b34e54e5c6d9536d5/guava-21.0-sources.jar!/" />
</SOURCES>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.papermc.paper/paper-api/1.17.1-R0.1-SNAPSHOT/6ef05512a4a774576b40d8010b85a8330317189d/paper-api-1.17.1-R0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.papermc.paper/paper-api/1.17.1-R0.1-SNAPSHOT/89dd5b09d459516b63b92ad7f04139b5dbd46e10/paper-api-1.17.1-R0.1-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: it.unimi.dsi:fastutil:8.2.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/it.unimi.dsi/fastutil/8.2.2/975aab42e32a96ecb9696971a87c87a049055452/fastutil-8.2.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/it.unimi.dsi/fastutil/8.2.2/b28b0db221dfe3b71da63ca4a201479347c31981/fastutil-8.2.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="Gradle: junit:junit:4.12">
<ANNOTATIONS>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/externalAnnotations/junit/junit/4.12-an1/junit-4.12-an1-annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/a6c32b40bf3d76eca54e3c601e5d1470c86fcdfa/junit-4.12-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: net.kyori:adventure-api:4.9.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/adventure-api/4.9.1/5ac28b66a902a00c8c2cfd570232be0044cf9552/adventure-api-4.9.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/adventure-api/4.9.1/ee32c3b8e89375077b886c925d2f2b721a27ad61/adventure-api-4.9.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: net.kyori:adventure-key:4.9.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/adventure-key/4.9.1/5b5515cdfb258afcc17c2b332829c478cc56535b/adventure-key-4.9.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/adventure-key/4.9.1/6b52d772cfb147dd8a43d582c44fbefda67ef03e/adventure-key-4.9.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: net.kyori:adventure-text-serializer-gson:4.9.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/adventure-text-serializer-gson/4.9.1/155d204e6e5f5c92dd2d4c45aa80ed06ab36862b/adventure-text-serializer-gson-4.9.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/adventure-text-serializer-gson/4.9.1/dd31d1e03b4858b7ba796a281ffeed4266fe0ae6/adventure-text-serializer-gson-4.9.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: net.kyori:adventure-text-serializer-legacy:4.9.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/adventure-text-serializer-legacy/4.9.1/d22629af682ff1b7d73e9bbaa9dc61172d7b07ee/adventure-text-serializer-legacy-4.9.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/adventure-text-serializer-legacy/4.9.1/e5d1ee826ac9acb79558fcfc360a19df3a1ed7bb/adventure-text-serializer-legacy-4.9.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: net.kyori:adventure-text-serializer-plain:4.9.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/adventure-text-serializer-plain/4.9.1/347d56e9f4f43068e210c255a8b28bd56ff05d82/adventure-text-serializer-plain-4.9.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/adventure-text-serializer-plain/4.9.1/cfb662aa3d7ec11ef5539640ade56449c987aeee/adventure-text-serializer-plain-4.9.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: net.kyori:examination-api:1.3.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/examination-api/1.3.0/8a2d185275307f1e2ef2adf7152b9a0d1d44c30b/examination-api-1.3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/examination-api/1.3.0/24ee397e9360897e1a5053e269be691abc611ca2/examination-api-1.3.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: net.kyori:examination-string:1.3.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/examination-string/1.3.0/6f34afef5c54ccce4996bc321abf77518b55b4bd/examination-string-1.3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.kyori/examination-string/1.3.0/d06d07677cf2022bdf38136ba550aea9852cc1bd/examination-string-1.3.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="Gradle: net.md-5:bungeecord-chat:1.13-SNAPSHOT">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.md-5/bungeecord-chat/1.13-SNAPSHOT/d0cf49e1752e31eb09eb5d57d5f0835b81e5fe6/bungeecord-chat-1.13-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.md-5/bungeecord-chat/1.13-SNAPSHOT/f6a1e506014031b94aad748e1e94da617eba0c6a/bungeecord-chat-1.13-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: net.md-5:bungeecord-chat:1.16-R0.4">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.md-5/bungeecord-chat/1.16-R0.4/e043e8eed8fdb5c157090a84ac8fd64a6a8d0d88/bungeecord-chat-1.16-R0.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.md-5/bungeecord-chat/1.16-R0.4/b875c61dc56dce4a6919f4531b06efa0b63f1af6/bungeecord-chat-1.16-R0.4-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: org.apache.logging.log4j:log4j-api:2.14.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.14.1/cd8858fbbde69f46bce8db1152c18a43328aae78/log4j-api-2.14.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.14.1/b2327c47ca413c1ec183575b19598e281fcd74d8/log4j-api-2.14.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: org.checkerframework:checker-qual:3.18.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-qual/3.18.0/7d1ffd35973fa4c94c3aebf187a26cf0b4350281/checker-qual-3.18.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-qual/3.18.0/820398feae761f5940dd0d030593592c5fa3b166/checker-qual-3.18.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="Gradle: org.hamcrest:hamcrest-core:1.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b/hamcrest-core-1.3-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: org.jetbrains:annotations:22.0.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/22.0.0/fb9bebc90794c7602e73d6ed0cb165a0c650be62/annotations-22.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/22.0.0/2ff08ea87697c3932851b121ac84d0db43620d34/annotations-22.0.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="Gradle: org.ow2.asm:asm:7.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/7.1/fa29aa438674ff19d5e1386d2c3527a0267f291e/asm-7.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/7.1/9d170062d595240da35301362b079e5579c86f49/asm-7.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="Gradle: org.ow2.asm:asm-analysis:7.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-analysis/7.1/379e0250f7a4a42c66c5e94e14d4c4491b3c2ed3/asm-analysis-7.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-analysis/7.1/36789198124eb075f1a5efa18a0a7812fb16f47f/asm-analysis-7.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="Gradle: org.ow2.asm:asm-commons:7.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-commons/7.1/431dc677cf5c56660c1c9004870de1ed1ea7ce6c/asm-commons-7.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-commons/7.1/a62ff3ae6e37affda7c6fb7d63b89194c6d006ee/asm-commons-7.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="Gradle: org.slf4j:slf4j-api:1.7.25">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.25/da76ca59f6a57ee3102f8f9bd9cee742973efa8a/slf4j-api-1.7.25.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.25/962153db4a9ea71b79d047dfd1b2a0d80d8f4739/slf4j-api-1.7.25-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: org.slf4j:slf4j-api:1.7.30">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.30/b5a4b6d16ab13e34a88fae84c35cd5d68cac922c/slf4j-api-1.7.30.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.30/71a1fdefa224da50f1db6306ce609981e20186c9/slf4j-api-1.7.30-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="Gradle: org.spigotmc:spigot:1.17-R0.1-SNAPSHOT">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.spigotmc/spigot/1.17-R0.1-SNAPSHOT/8153068f3347e40b1e8039f93693d02a8549da00/spigot-1.17-R0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.spigotmc/spigot/1.17-R0.1-SNAPSHOT/fcf4bd9d407af248073767917f142d19ce1c3fa8/spigot-1.17-R0.1-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="Gradle: org.yaml:snakeyaml:1.23">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.23/ec62d74fe50689c28c0ff5b35d3aebcaa8b5be68/snakeyaml-1.23.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.23/1186bcf89d33080275bab74a0b0f495af5c812ef/snakeyaml-1.23-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,11 +1,11 @@
<component name="libraryTable">
<library name="Gradle: org.ow2.asm:asm-tree:7.1">
<library name="Gradle: org.yaml:snakeyaml:1.28">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-tree/7.1/a3662cf1c1d592893ffe08727f78db35392fa302/asm-tree-7.1.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.28/7cae037c3014350c923776548e71c9feb7a69259/snakeyaml-1.28.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-tree/7.1/157238292b551de8680505fa2d19590d136e25b9/asm-tree-7.1-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.28/1df44bcfb045ca926511dae52d4857b8b3721d31/snakeyaml-1.28-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -5,7 +5,10 @@
<item index="0" class="java.lang.String" itemvalue="org.bukkit.event.EventHandler" />
</list>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_16" default="true" project-jdk-name="16 (2)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="VulnerabilityPatcher:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="me.cooljwb.vulnerabilitypatcher" external.system.module.type="sourceSet" external.system.module.version="v1.9.1" type="JAVA_MODULE" version="4">
<module external.linked.project.id="VulnerabilityPatcher:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="me.cooljwb.vulnerabilitypatcher" external.system.module.type="sourceSet" external.system.module.version="v1.9.5" type="JAVA_MODULE" version="4">
<component name="CheckStyle-IDEA-Module">
<option name="configuration">
<map />
@ -9,11 +9,16 @@
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>PAPER</platformType>
<platformType>SPIGOT</platformType>
<platformType>MCP</platformType>
<platformType>ADVENTURE</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
<component name="McpModuleSettings">
<option name="srgType" value="SRG" />
</component>
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/../../build/classes/java/main" />
<exclude-output />
@ -23,65 +28,27 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../libs/Spigot-1.13.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../libs/Spigot-1.14.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../libs/Spigot-1.15.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../libs/Spigot-1.16.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../libs/Spigot-1.16.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: com.destroystokyo.paper:paper-api:1.14-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" name="Gradle: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" name="Gradle: net.md-5:bungeecord-chat:1.13-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" name="Gradle: org.yaml:snakeyaml:1.23" level="project" />
<orderEntry type="library" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm-commons:7.1" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm-analysis:7.1" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm-tree:7.1" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm:7.1" level="project" />
<orderEntry type="library" name="Gradle: junit:junit:4.10" level="project" />
<orderEntry type="library" name="Gradle: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.spigotmc:spigot:1.17-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.md-5:bungeecord-chat:1.16-R0.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.kyori:adventure-text-serializer-legacy:4.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.kyori:adventure-text-serializer-plain:4.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.kyori:adventure-api:4.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.kyori:adventure-text-serializer-gson:4.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.yaml:snakeyaml:1.28" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: it.unimi.dsi:fastutil:8.2.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.apache.logging.log4j:log4j-api:2.14.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.slf4j:slf4j-api:1.7.30" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.checkerframework:checker-qual:3.18.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.kyori:adventure-key:4.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.kyori:examination-string:1.3.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.kyori:examination-api:1.3.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains:annotations:22.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.hamcrest:hamcrest-core:1.1" level="project" />
</component>
</module>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="VulnerabilityPatcher:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="me.cooljwb.vulnerabilitypatcher" external.system.module.type="sourceSet" external.system.module.version="v1.9.1" type="JAVA_MODULE" version="4">
<module external.linked.project.id="VulnerabilityPatcher:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="me.cooljwb.vulnerabilitypatcher" external.system.module.type="sourceSet" external.system.module.version="v1.9.5" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
@ -19,66 +19,6 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="VulnerabilityPatcher.main" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../libs/Spigot-1.13.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../libs/Spigot-1.14.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../libs/Spigot-1.15.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../libs/Spigot-1.16.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../libs/Spigot-1.16.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: com.destroystokyo.paper:paper-api:1.14-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" name="Gradle: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Gradle: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Gradle: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" name="Gradle: net.md-5:bungeecord-chat:1.13-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" name="Gradle: org.yaml:snakeyaml:1.23" level="project" />
<orderEntry type="library" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm-commons:7.1" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm-analysis:7.1" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm-tree:7.1" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm:7.1" level="project" />
</component>
<component name="TestModuleProperties" production-module="VulnerabilityPatcher.main" />
</module>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="VulnerabilityPatcher" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="me.cooljwb.vulnerabilitypatcher" external.system.module.version="v1.9.1" type="JAVA_MODULE" version="4">
<module external.linked.project.id="VulnerabilityPatcher" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="me.cooljwb.vulnerabilitypatcher" external.system.module.version="v1.9.5" type="JAVA_MODULE" version="4">
<component name="CheckStyle-IDEA-Module">
<option name="configuration">
<map />

View file

@ -9,4 +9,8 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -9,4 +9,8 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

View file

@ -1,20 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="4038a6e9-7d52-4dd0-91ef-d9a12aa1c1b2" name="Default Changelist" comment="Added a fix to the new item name exploit that makes it possible to make clickable text and, made the chest patch work for all containers and so that books are cleared properly...">
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__io_papermc_paper_paper_api_1_17_1_R0_1_SNAPSHOT.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__it_unimi_dsi_fastutil_8_2_2.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__net_kyori_adventure_api_4_9_1.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__net_kyori_adventure_key_4_9_1.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__net_kyori_adventure_text_serializer_gson_4_9_1.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__net_kyori_adventure_text_serializer_legacy_4_9_1.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__net_kyori_adventure_text_serializer_plain_4_9_1.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__net_kyori_examination_api_1_3_0.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__net_kyori_examination_string_1_3_0.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__net_md_5_bungeecord_chat_1_16_R0_4.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__org_apache_logging_log4j_log4j_api_2_14_1.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__org_checkerframework_checker_qual_3_18_0.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__org_jetbrains_annotations_22_0_0.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_30.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__org_spigotmc_spigot_1_17_R0_1_SNAPSHOT.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__org_yaml_snakeyaml_1_28.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/runConfigurations.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/jarRepositories.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/jarRepositories.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__com_destroystokyo_paper_paper_api_1_14_R0_1_SNAPSHOT.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_1_3_9.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__com_google_code_gson_gson_2_8_0.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__com_google_code_gson_gson_2_8_0.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__com_google_guava_guava_21_0.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Gradle__com_google_guava_guava_21_0.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__junit_junit_4_12.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__net_md_5_bungeecord_chat_1_13_SNAPSHOT.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__org_ow2_asm_asm_7_1.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__org_ow2_asm_asm_analysis_7_1.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__org_ow2_asm_asm_commons_7_1.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__org_ow2_asm_asm_tree_7_1.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_25.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Gradle__org_yaml_snakeyaml_1_23.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules/VulnerabilityPatcher.main.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/VulnerabilityPatcher.main.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules/VulnerabilityPatcher.test.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/VulnerabilityPatcher.test.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher.main.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher.main.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher.test.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher.test.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gradle.properties" beforeDir="false" afterPath="$PROJECT_DIR$/gradle.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.jar" beforeDir="false" afterPath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.jar" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.properties" beforeDir="false" afterPath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gradlew" beforeDir="false" afterPath="$PROJECT_DIR$/gradlew" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gradlew.bat" beforeDir="false" afterPath="$PROJECT_DIR$/gradlew.bat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/libs/.idea/$PRODUCT_WORKSPACE_FILE$" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/.idea/.gitignore" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/.idea/checkstyle-idea.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/.idea/libs.iml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/.idea/modules.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/.idea/vcs.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/Spigot-1.14.jar" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/Spigot-1.15.jar" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/Spigot-1.16.2.jar" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/Spigot-1.16.5.jar" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/Spigot-1.16.jar" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/spigot-1.13.2.jar" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/resources/config.yml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/resources/plugin.yml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/VulnerabilityPatcher.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/VulnerabilityPatcher.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/commands/CommandVulnerabilityPatcher.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/commands/CommandVulnerabilityPatcher.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_13_2.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_13_2.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_14.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_14.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_15.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_15.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_16.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_16.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_16_2.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_16_2.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_13_2.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_14.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_15.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_16.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_16_2.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_16_3.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers/NBTModifier_1_17_1.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Arrows.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Arrows.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/plugin.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/plugin.yml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -43,13 +102,13 @@
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="VulnerabilityPatcher" type="f1a62948:ProjectNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
<item name="Dependencies" type="6de06a37:ExternalSystemViewDefaultContributor$MyDependenciesNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="VulnerabilityPatcher" type="f1a62948:ProjectNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
<item name="build" type="c8890929:TasksNode$1" />
<item name="Dependencies" type="6de06a37:ExternalSystemViewDefaultContributor$MyDependenciesNode" />
<item name="compileClasspath" type="62daadca:ExternalSystemViewDefaultContributor$DependencyScopeExternalSystemNode" />
</path>
</expand>
<select />
@ -75,27 +134,131 @@
</ignored-facets>
</component>
<component name="ProjectId" id="1P6hFDIIQNwz5laK1QMMQH1wCha" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1565016144369" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/main/java/me/cooljwb/vulnerabilitypatcher/modifiers" />
<property name="project.structure.last.edited" value="Libraries" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="editor.preferences.completion" />
<property name="settings.editor.selected.configurable" value="reference.settingsdialog.project.gradle" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="D:\DATA\Användare\Skrivbord\Programering\VulnerabilityPatcher\src\main\java\me\cooljwb\vulnerabilitypatcher\modifiers" />
<recent name="D:\DATA\Användare\Skrivbord\Programering\VulnerabilityPatcher\libs" />
</key>
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="me.cooljwb.vulnerabilitypatcher.modifiers" />
</key>
</component>
<component name="RunManager">
<component name="RunAnythingCache">
<option name="myCommands">
<command value="gradle build resolutionStrategy" />
<command value="gradle build --refresh-dependencies" />
<command value="gradle build" />
<command value="gradle clean build" />
</option>
</component>
<component name="RunManager" selected="Gradle.VulnerabilityPatcher [clean build]">
<configuration name="VulnerabilityPatcher [build resolutionStrategy]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="build" />
<option value="resolutionStrategy" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<configuration name="VulnerabilityPatcher [build]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="build" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<configuration name="VulnerabilityPatcher [clean build]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="clean" />
<option value="build" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<configuration name="VulnerabilityPatcher [libs]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="libs" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<configuration name="VulnerabilityPatcher build" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" value="VulnerabilityPatcher-Paper build" />
@ -112,10 +275,21 @@
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Gradle.VulnerabilityPatcher [clean build]" />
<item itemvalue="Gradle.VulnerabilityPatcher [build resolutionStrategy]" />
<item itemvalue="Gradle.VulnerabilityPatcher [libs]" />
<item itemvalue="Gradle.VulnerabilityPatcher [build]" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="SvnConfiguration">
<configuration />
</component>
@ -126,6 +300,9 @@
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1557533923338</updated>
<workItem from="1632962958058" duration="716000" />
<workItem from="1632963857957" duration="2055000" />
<workItem from="1632965951486" duration="1566000" />
</task>
<task id="LOCAL00001" summary="Added a fix to the new item name exploit that makes it possible to make clickable text and, made the chest patch work for all containers and so that books are cleared properly...">
<created>1595202547911</created>
@ -136,6 +313,9 @@
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
@ -149,33 +329,8 @@
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="Added a fix to the new item name exploit that makes it possible to make clickable text and, made the chest patch work for all containers and so that books are cleared properly..." />
<option name="LAST_COMMIT_MESSAGE" value="Added a fix to the new item name exploit that makes it possible to make clickable text and, made the chest patch work for all containers and so that books are cleared properly..." />
</component>
<component name="WindowStateProjectService">
<state width="1877" height="234" key="GridCell.Tab.0.bottom" timestamp="1601727826130">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="234" key="GridCell.Tab.0.bottom/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1601727826130" />
<state width="1877" height="234" key="GridCell.Tab.0.bottom/0.0.1920.1040/1920.0.1920.1040@1920.0.1920.1040" timestamp="1597498022867" />
<state width="1877" height="234" key="GridCell.Tab.0.center" timestamp="1601727826130">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="234" key="GridCell.Tab.0.center/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1601727826130" />
<state width="1877" height="234" key="GridCell.Tab.0.center/0.0.1920.1040/1920.0.1920.1040@1920.0.1920.1040" timestamp="1597498022867" />
<state width="1877" height="234" key="GridCell.Tab.0.left" timestamp="1601727826130">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="234" key="GridCell.Tab.0.left/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1601727826130" />
<state width="1877" height="234" key="GridCell.Tab.0.left/0.0.1920.1040/1920.0.1920.1040@1920.0.1920.1040" timestamp="1597498022867" />
<state width="1877" height="234" key="GridCell.Tab.0.right" timestamp="1601727826130">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="234" key="GridCell.Tab.0.right/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1601727826130" />
<state width="1877" height="234" key="GridCell.Tab.0.right/0.0.1920.1040/1920.0.1920.1040@1920.0.1920.1040" timestamp="1597498022867" />
<state x="92" y="92" width="1736" height="856" key="com.intellij.history.integration.ui.views.FileHistoryDialog" timestamp="1601724203001">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="92" y="92" width="1736" height="856" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.0.1920.1040/1920.0.1920.1040@0.0.1920.1040" timestamp="1601724203001" />
</component>
</project>

View file

@ -3,37 +3,24 @@ apply plugin: 'java'
group = pluginGroup
version = pluginVersion
sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 16
targetCompatibility = 16
repositories {
mavenCentral()
mavenLocal()
maven {
name = 'destroystokyo-repo'
url = 'https://repo.destroystokyo.com/repository/maven-public/'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
maven { url = 'https://repo.codemc.io/repository/nms/' }
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'com.destroystokyo.paper:paper-api:1.13.2-R0.1-SNAPSHOT'
compile 'com.destroystokyo.paper:paper-api:1.14-R0.1-SNAPSHOT'
compile files('libs/Spigot-1.13.2.jar')
compile files('libs/Spigot-1.14.jar')
compile files('libs/Spigot-1.15.jar')
compile files('libs/Spigot-1.16.jar')
compile files('libs/Spigot-1.16.2.jar')
compile files('libs/Spigot-1.16.5.jar')
compileOnly 'org.spigotmc:spigot:1.17-R0.1-SNAPSHOT'
compileOnly 'io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT'
}
import org.apache.tools.ant.filters.ReplaceTokens
processResources {
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: version]
}
}

View file

@ -1,2 +1,2 @@
pluginGroup=me.cooljwb.vulnerabilitypatcher
pluginVersion=v1.9.4
pluginVersion=v1.9.5

Binary file not shown.

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip

53
gradlew vendored Normal file → Executable file
View file

@ -1,5 +1,21 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@ -66,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@ -109,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
@ -138,19 +156,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
@ -159,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

173
gradlew.bat vendored
View file

@ -1,84 +1,89 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View file

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View file

@ -1,2 +0,0 @@
# Default ignored files
/workspace.xml

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA">
<option name="configuration">
<map>
<entry key="checkstyle-version" value="8.31" />
<entry key="copy-libs" value="true" />
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
<entry key="scan-before-checkin" value="false" />
<entry key="scanscope" value="JavaOnly" />
<entry key="suppress-errors" value="false" />
</map>
</option>
</component>
</project>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/libs.iml" filepath="$PROJECT_DIR$/.idea/libs.iml" />
</modules>
</component>
</project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,46 +0,0 @@
# VulnerabilityPatcher by CoolJWB.
# Patches: DeathPotions, DeathItems, CrashItems, Books, RougeEntity, Arrows, Riptide, FollowRange, DisconnectItems, EntityTag.
# All patches added in the list below will be activated on server startup.
Patches:
- DeathPotions
- DeathItems
- CrashItems
- Books
- RougeEntity
- Arrows
- Riptide
- FollowRange
- DisconnectItems
- EntityTag
- Blocks
- StructureBlocks
# All entities added below will be blocked to use in a spawn egg.
BlockedEntityTags:
- lightning_bolt
- falling_block
- area_effect_cloud
Commands:
Help:
Permission: vulnerability.help
Version:
Permission: vulnerability.version
Reload:
Permission: vulnerability.reload
BlockTags:
Permission: vulnerability.tags.block
UnblockTags:
Permission: vulnerability.tags.unblock
EnablePatch:
Permission: vulnerability.patch.enable
DisablePatch:
Permission: vulnerability.patch.disable
Notify:
Enabled: false
Permission: vulnerability.notify
# DevMode should be set to false, unless you're a developer of this plugin.
DevMode: false

View file

@ -1,12 +0,0 @@
name: VulnerabilityPatcher
version: 0.3.1
main: me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher
api-version: 1.13
authors: [CoolJWB]
description: The brand new v0.3 VulnerabilityPatcher for Paper 1.13.2 servers.
commands:
vulnerabilitypatcher:
aliases: [vp]
description: The main command for VulnerabilityPatcher.
getnbt:
description: Reveals an items NBT data.

View file

@ -81,21 +81,8 @@ public final class VulnerabilityPatcher extends JavaPlugin
{
switch (version)
{
case "1.13.2":
case "1.14":
case "1.14.1":
case "1.14.2":
case "1.14.3":
case "1.14.4":
case "1.15":
case "1.15.1":
case "1.15.2":
case "1.16":
case "1.16.1":
case "1.16.2":
case "1.16.3":
case "1.16.4":
case "1.16.5":
case "1.17":
case "1.17.1":
return true;
default:
log.log(Level.WARNING, String.format("[%s] Server version %s may not work fully or at all with %s-%s, try an earlier plugin version or a newer server version.", pluginName, version, pluginName, pluginVersion));

View file

@ -36,38 +36,15 @@ public class NBTModifier
{
private Logger log = Logger.getLogger("Minecraft"); // Get the server logger.
private NBTModifier_1_13_2 nbt_1_13_2 = new NBTModifier_1_13_2();
private NBTModifier_1_14 nbt_1_14 = new NBTModifier_1_14();
private NBTModifier_1_15 nbt_1_15 = new NBTModifier_1_15();
private NBTModifier_1_16 nbt_1_16 = new NBTModifier_1_16();
private NBTModifier_1_16_2 nbt_1_16_2 = new NBTModifier_1_16_2();
private NBTModifier_1_16_3 nbt_1_16_3 = new NBTModifier_1_16_3();
private NBTModifier_1_17_1 nbt_1_17_1 = new NBTModifier_1_17_1();
public static String getVersion()
{
switch (Bukkit.getVersion().substring((Bukkit.getVersion().indexOf(":") + 1), Bukkit.getVersion().indexOf(")")).trim())
{
case "1.13.2":
return "1.13.2";
case "1.14":
case "1.14.1":
case "1.14.2":
case "1.14.3":
case "1.14.4":
return "1.14";
case "1.15":
case "1.15.1":
case "1.15.2":
return "1.15";
case "1.16":
case "1.16.1":
return "1.16";
case "1.16.2":
case "1.16.3":
return "1.16.2";
case "1.16.4":
case "1.16.5":
return "1.16.5";
case "1.17":
case "1.17.1":
return "1.17";
default:
return "";
}
@ -77,18 +54,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.itemToString(item);
case "1.14":
return nbt_1_14.itemToString(item);
case "1.15":
return nbt_1_15.itemToString(item);
case "1.16":
return nbt_1_16.itemToString(item);
case "1.16.2":
return nbt_1_16_2.itemToString(item);
case "1.16.5":
return nbt_1_16_3.itemToString(item);
case "1.17":
return nbt_1_17_1.itemToString(item);
default:
return "";
}
@ -98,18 +65,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.removePlayerdata(player);
case "1.14":
return nbt_1_14.removePlayerdata(player);
case "1.15":
return nbt_1_15.removePlayerdata(player);
case "1.16":
return nbt_1_16.removePlayerdata(player);
case "1.16.2":
return nbt_1_16_2.removePlayerdata(player);
case "1.16.5":
return nbt_1_16_3.removePlayerdata(player);
case "1.17":
return nbt_1_17_1.removePlayerdata(player);
}
return false;
}
@ -118,24 +75,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
nbt_1_13_2.resetMeta(player, item, mainhand);
break;
case "1.14":
nbt_1_14.resetMeta(player, item, mainhand);
break;
case "1.15":
nbt_1_15.resetMeta(player, item, mainhand);
break;
case "1.16":
nbt_1_16.resetMeta(player, item, mainhand);
break;
case "1.16.2":
nbt_1_16_2.resetMeta(player, item, mainhand);
break;
case "1.16.5":
nbt_1_16_3.resetMeta(player, item, mainhand);
break;
case "1.17":
nbt_1_17_1.resetMeta(player, item, mainhand);
}
}
@ -143,18 +84,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.isPlayer(source);
case "1.14":
return nbt_1_14.isPlayer(source);
case "1.15":
return nbt_1_15.isPlayer(source);
case "1.16":
return nbt_1_16.isPlayer(source);
case "1.16.2":
return nbt_1_16_2.isPlayer(source);
case "1.16.5":
return nbt_1_16_3.isPlayer(source);
case "1.17":
return nbt_1_17_1.isPlayer(source);
default:
return false;
}
@ -164,18 +95,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.getArrowDamage(arrow);
case "1.14":
return nbt_1_14.getArrowDamage(arrow);
case "1.15":
return nbt_1_15.getArrowDamage(arrow);
case "1.16":
return nbt_1_16.getArrowDamage(arrow);
case "1.16.2":
return nbt_1_16_2.getArrowDamage(arrow);
case "1.16.5":
return nbt_1_16_3.getArrowDamage(arrow);
case "1.17":
return nbt_1_17_1.getArrowDamage(arrow);
default:
return 0;
}
@ -185,23 +106,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
nbt_1_13_2.setArrowDamage(arrow, amount);
break;
case "1.14":
nbt_1_14.setArrowDamage(arrow, amount);
break;
case "1.15":
nbt_1_15.setArrowDamage(arrow, amount);
break;
case "1.16":
nbt_1_16.setArrowDamage(arrow, amount);
break;
case "1.16.2":
nbt_1_16_2.setArrowDamage(arrow, amount);
break;
case "1.16.5":
nbt_1_16_3.setArrowDamage(arrow, amount);
case "1.17":
nbt_1_17_1.setArrowDamage(arrow, amount);
break;
}
}
@ -210,18 +116,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.getFireworkEffectSize(firework);
case "1.14":
return nbt_1_14.getFireworkEffectSize(firework);
case "1.15":
return nbt_1_15.getFireworkEffectSize(firework);
case "1.16":
return nbt_1_16.getFireworkEffectSize(firework);
case "1.16.2":
return nbt_1_16_2.getFireworkEffectSize(firework);
case "1.16.5":
return nbt_1_16_3.getFireworkEffectSize(firework);
case "1.17":
return nbt_1_17_1.getFireworkEffectSize(firework);
default:
return 0;
}
@ -231,18 +127,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.hasFireworkLargeEffect(firework);
case "1.14":
return nbt_1_14.hasFireworkLargeEffect(firework);
case "1.15":
return nbt_1_15.hasFireworkLargeEffect(firework);
case "1.16":
return nbt_1_16.hasFireworkLargeEffect(firework);
case "1.16.2":
return nbt_1_16_2.hasFireworkLargeEffect(firework);
case "1.16.5":
return nbt_1_16_3.hasFireworkLargeEffect(firework);
case "1.17":
return nbt_1_17_1.hasFireworkLargeEffect(firework);
default:
return false;
}
@ -252,18 +138,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.isCrashItem(item);
case "1.14":
return nbt_1_14.isCrashItem(item);
case "1.15":
return nbt_1_15.isCrashItem(item);
case "1.16":
return nbt_1_16.isCrashItem(item);
case "1.16.2":
return nbt_1_16_2.isCrashItem(item);
case "1.16.5":
return nbt_1_16_3.isCrashItem(item);
case "1.17":
return nbt_1_17_1.isCrashItem(item);
default:
return false;
}
@ -273,18 +149,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.containsCrashItem(item);
case "1.14":
return nbt_1_14.containsCrashItem(item);
case "1.15":
return nbt_1_15.containsCrashItem(item);
case "1.16":
return nbt_1_16.containsCrashItem(item);
case "1.16.2":
return nbt_1_16_2.containsCrashItem(item);
case "1.16.5":
return nbt_1_16_3.containsCrashItem(item);
case "1.17":
return nbt_1_17_1.containsCrashItem(item);
default:
return false;
}
@ -294,18 +160,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.isDeathItem(item);
case "1.14":
return nbt_1_14.isDeathItem(item);
case "1.15":
return nbt_1_15.isDeathItem(item);
case "1.16":
return nbt_1_16.isDeathItem(item);
case "1.16.2":
return nbt_1_16_2.isDeathItem(item);
case "1.16.5":
return nbt_1_16_3.isDeathItem(item);
case "1.17":
return nbt_1_17_1.isDeathItem(item);
default:
return false;
}
@ -315,18 +171,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.containsDeathItem(item);
case "1.14":
return nbt_1_14.containsDeathItem(item);
case "1.15":
return nbt_1_15.containsDeathItem(item);
case "1.16":
return nbt_1_16.containsDeathItem(item);
case "1.16.2":
return nbt_1_16_2.containsDeathItem(item);
case "1.16.5":
return nbt_1_16_3.containsDeathItem(item);
case "1.17":
return nbt_1_17_1.containsDeathItem(item);
default:
return false;
}
@ -336,18 +182,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.isDisconnectItem(entity);
case "1.14":
return nbt_1_14.isDisconnectItem(entity);
case "1.15":
return nbt_1_15.isDisconnectItem(entity);
case "1.16":
return nbt_1_16.isDisconnectItem(entity);
case "1.16.2":
return nbt_1_16_2.isDisconnectItem(entity);
case "1.16.5":
return nbt_1_16_3.isDisconnectItem(entity);
case "1.17":
return nbt_1_17_1.isDisconnectItem(entity);
default:
return false;
}
@ -357,18 +193,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.isDisconnectItem(item);
case "1.14":
return nbt_1_14.isDisconnectItem(item);
case "1.15":
return nbt_1_15.isDisconnectItem(item);
case "1.16":
return nbt_1_16.isDisconnectItem(item);
case "1.16.2":
return nbt_1_16_2.isDisconnectItem(item);
case "1.16.5":
return nbt_1_16_3.isDisconnectItem(item);
case "1.17":
return nbt_1_17_1.isDisconnectItem(item);
default:
return false;
}
@ -378,18 +204,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
return nbt_1_13_2.containsDisconnectItem(item);
case "1.14":
return nbt_1_14.containsDisconnectItem(item);
case "1.15":
return nbt_1_15.containsDisconnectItem(item);
case "1.16":
return nbt_1_16.containsDisconnectItem(item);
case "1.16.2":
return nbt_1_16_2.containsDisconnectItem(item);
case "1.16.5":
return nbt_1_16_3.containsDisconnectItem(item);
case "1.17":
return nbt_1_17_1.containsDisconnectItem(item);
default:
return false;
}
@ -400,22 +216,7 @@ public class NBTModifier
switch (getVersion())
{
case "1.13.2":
nbt_1_13_2.removeInvalidValues(entity);
break;
case "1.14":
nbt_1_14.removeInvalidValues(entity);
break;
case "1.15":
nbt_1_15.removeInvalidValues(entity);
break;
case "1.16":
nbt_1_16.removeInvalidValues(entity);
break;
case "1.16.2":
nbt_1_16_2.removeInvalidValues(entity);
break;
case "1.16.5":
nbt_1_16_3.removeInvalidValues(entity);
nbt_1_17_1.removeInvalidValues(entity);
break;
}
}
@ -424,42 +225,12 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
case "1.17":
if (item != null && item.getType().name().equalsIgnoreCase("spawn_egg"))
{
return true;
}
return nbt_1_13_2.isDangerousEgg(item);
case "1.14":
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
return true;
}
return nbt_1_14.isDangerousEgg(item);
case "1.15":
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
return true;
}
return nbt_1_15.isDangerousEgg(item);
case "1.16":
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
return true;
}
return nbt_1_16.isDangerousEgg(item);
case "1.16.2":
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
return true;
}
return nbt_1_16_2.isDangerousEgg(item);
case "1.16.5":
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
return true;
}
return nbt_1_16_3.isDangerousEgg(item);
return nbt_1_17_1.isDangerousEgg(item);
default:
return false;
}
@ -469,23 +240,8 @@ public class NBTModifier
{
switch (getVersion())
{
case "1.13.2":
nbt_1_13_2.isDangerousSkull(item);
break;
case "1.14":
nbt_1_14.isDangerousSkull(item);
break;
case "1.15":
nbt_1_15.isDangerousSkull(item);
break;
case "1.16":
nbt_1_16.isDangerousSkull(item);
break;
case "1.16.2":
nbt_1_16_2.isDangerousSkull(item);
break;
case "1.16.5":
nbt_1_16_3.isDangerousSkull(item);
case "1.17":
nbt_1_17_1.isDangerousSkull(item);
break;
}
return false;
@ -493,18 +249,18 @@ public class NBTModifier
protected boolean isOversizedSign(ItemStack item)
{
if (getVersion().equals("1.16.5"))
if (getVersion().equals("1.17"))
{
return nbt_1_16_3.isOversizedSign(item);
return nbt_1_17_1.isOversizedSign(item);
}
return false;
}
protected void clearOversizedSign(BlockPlaceEvent event)
{
if (getVersion().equals("1.16.5"))
if (getVersion().equals("1.17"))
{
nbt_1_16_3.clearOversizedSign(event);
nbt_1_17_1.clearOversizedSign(event);
}
}
}

View file

@ -1,487 +0,0 @@
package me.cooljwb.vulnerabilitypatcher.modifiers;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.cooljwb.vulnerabilitypatcher.Variables;
import me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher;
import me.cooljwb.vulnerabilitypatcher.patches.Patches;
import net.minecraft.server.v1_13_R2.MojangsonParser;
import net.minecraft.server.v1_13_R2.NBTBase;
import net.minecraft.server.v1_13_R2.NBTTagCompound;
import net.minecraft.server.v1_13_R2.NBTTagList;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftItem;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Firework;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.inventory.meta.SpawnEggMeta;
import org.bukkit.projectiles.ProjectileSource;
import java.io.File;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
public class NBTModifier_1_13_2
{
private Logger log = Logger.getLogger("Minecraft");
/* Misc */
public void log(Level level, String message)
{
log.log(level, String.format("[%s] %s", VulnerabilityPatcher.pluginName, message));
}
private void fired_countermeasure(String reason)
{
if (Patches.devmode)
{
log(Level.INFO, String.format("Fired countermeasure in %s reason: %s", getClass().getName(), reason));
}
}
private NBTTagCompound getItemNBT(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null)
{
return nmsItemStack.getTag();
}
}
return null;
}
private NBTTagCompound getEntityNBT(Entity entity)
{
net.minecraft.server.v1_13_R2.Entity nmsEntity = ((CraftEntity) entity).getHandle();
NBTTagCompound tag = new NBTTagCompound();
nmsEntity.save(tag);
return tag;
}
private void setEntityNBT(Entity entity, NBTTagCompound nbtTagCompound)
{
net.minecraft.server.v1_13_R2.Entity nmsEntity = ((CraftEntity) entity).getHandle();
nmsEntity.f(nbtTagCompound);
}
public NBTTagList getAttributeList(ItemStack item)
{
NBTTagCompound itemtag = getItemNBT(item);
if (item != null && itemtag != null && itemtag.hasKey("AttributeModifiers"))
{
return getItemNBT(item).getList("AttributeModifiers", 10);
}
return null;
}
String itemToString(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag())
{
return nmsItemStack.getTag().toString();
}
}
return "";
}
boolean removePlayerdata(String player)
{
if (Bukkit.getPlayer(player) != null)
{
((CraftEntity) Bukkit.getPlayer(player)).getHandle().f(new NBTTagCompound());
return true;
}
else if (Bukkit.getOfflinePlayer(player) != null)
{
File file = new File(Bukkit.getServer().getWorldContainer() + "/world/playerdata/" + Bukkit.getOfflinePlayer(player).getUniqueId().toString() + ".dat");
return file.delete();
}
return false;
}
void resetMeta(Player player, ItemStack item, boolean mainhand)
{
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag() && nmsItemStack.getTag().hasKey("pages"))
{
String pages = nmsItemStack.getTag().getList("pages", 8).toString();
if (pages.contains("clickEvent") || pages.contains("hoverEvent"))
{
BookMeta meta = (BookMeta) item.getItemMeta();
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
meta.setPages(meta.getPages());
book.setItemMeta(meta);
if (mainhand)
{
player.getInventory().setItemInMainHand(book);
}
else
{
player.getInventory().setItemInOffHand(book);
}
}
}
}
boolean isPlayer(ProjectileSource source)
{
return source instanceof CraftPlayer;
}
double getArrowDamage(Arrow arrow)
{
return getEntityNBT(arrow).hasKey("damage") ? getEntityNBT(arrow).getDouble("damage") : 0;
}
void setArrowDamage(Arrow arrow, double amount)
{
NBTTagCompound tag = getEntityNBT(arrow);
if (tag.hasKey("damage"))
{
tag.setDouble("damage", amount);
setEntityNBT(arrow, tag);
}
}
int getFireworkEffectSize(Firework firework)
{
NBTTagCompound tag = getEntityNBT(firework);
if (tag.hasKey("FireworksItem") && tag.getCompound("FireworksItem").hasKey("tag") && tag.getCompound("FireworksItem").getCompound("tag").hasKey("Fireworks") && tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").hasKey("Explosions"))
{
return tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").getList("Explosions", 10).size();
}
return 0;
}
boolean hasFireworkLargeEffect(Firework firework)
{
NBTTagCompound tag = getEntityNBT(firework);
if (tag.hasKey("FireworksItem") && tag.getCompound("FireworksItem").hasKey("tag") && tag.getCompound("FireworksItem").getCompound("tag").hasKey("Fireworks") && tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").hasKey("Explosions"))
{
NBTTagList explosions = tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").getList("Explosions", 10);
for (int x = 0; x <= (explosions.size() - 1); x++)
{
if (explosions.getCompound(x).getInt("Type") == 1 || explosions.getCompound(x).getInt("Type") == 3)
{
return true;
}
}
}
return false;
}
boolean isCrashItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound itemtag = nmsItemStack.getTag();
if (itemtag.toString().contains("translation.test.invalid"))
{
fired_countermeasure("isCrashItem");
return true;
}
}
}
return false;
}
boolean containsCrashItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound blockentitytag = nmsItemStack.getTag().getCompound("BlockEntityTag");
NBTTagList itemlist = blockentitytag.getList("Items", 10);
for (int a = 0; a <= itemlist.size(); a++)
{
NBTTagCompound itemtag = itemlist.getCompound(a).getCompound("tag");
if (itemtag.toString().contains("translation.test.invalid"))
{
fired_countermeasure("containsCrashItem");
return true;
}
}
}
}
return false;
}
boolean isDeathItem(ItemStack item)
{
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
return isDeathItem(nmsItemStack.getTag());
}
return false;
}
private boolean isDeathItem(NBTTagCompound item)
{
if (item != null)
{
NBTTagList attrlist = item.getList("AttributeModifiers", 10);
if (attrlist != null)
{
for (int i = 0; i < attrlist.size(); i++)
{
NBTTagCompound compound = (NBTTagCompound) attrlist.get(i);
if ((compound.getString("Name").equalsIgnoreCase("MAX_HEALTH") || compound.getString("AttributeName").equalsIgnoreCase("generic.maxhealth")) && compound.getDouble("Amount") <= 0)
{
fired_countermeasure("isDeathItem");
return true;
}
}
}
}
return false;
}
boolean containsDeathItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound blockentitytag = nmsItemStack.getTag().getCompound("BlockEntityTag");
NBTTagList itemlist = blockentitytag.getList("Items", 10);
for (int a = 0; a <= itemlist.size(); a++)
{
NBTTagList attrlist = itemlist.getCompound(a).getCompound("tag").getList("AttributeModifiers", 10);
for (int b = 0; b <= attrlist.size(); b++)
{
String attribute_name = attrlist.getCompound(b).getString("AttributeName");
String name = attrlist.getCompound(b).getString("Name");
Double amount = attrlist.getCompound(b).getDouble("Amount");
if ((name.equalsIgnoreCase("MAX_HEALTH") || attribute_name.equalsIgnoreCase("generic.maxhealth")) && amount <= 0)
{
fired_countermeasure("containsDeathItem");
return true;
}
}
}
}
}
return false;
}
boolean isDisconnectItem(ItemStack item)
{
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
return isDisconnectItem(nmsItemStack.getTag());
}
return false;
}
boolean isDisconnectItem(Entity entity)
{
if (entity instanceof CraftItem)
{
return isDisconnectItem(entity);
}
return false;
}
private boolean isDisconnectItem(NBTTagCompound item)
{
if (item != null)
{
if (item.hasKey("CustomPotionColor") && item.getInt("CustomPotionColor") < 0)
{
fired_countermeasure("isCustomPotionColorDisconnectItem");
return true;
}
else if ((item.getCompound("display").hasKey("color") && item.getCompound("display").getInt("color") < 0))
{
fired_countermeasure("isDisplayColorDisconnectItem");
return true;
}
else if (item.getCompound("BlockEntityTag").hasKey("Patterns"))
{
NBTTagList patterns = item.getCompound("BlockEntityTag").getList("Patterns", 10);
for (int x = 0; x <= (patterns.size() - 1); x++)
{
if (patterns.get(x).getTypeId() == 10)
{
if (patterns.getCompound(x).hasKey("Color") && patterns.getCompound(x).getInt("Color") < 0)
{
return true;
}
}
}
for (NBTBase base : item.getCompound("BlockEntityTag").getList("Patterns", 10))
{
if (base.asString().contains("Color:-1"))
{
fired_countermeasure("isDisplayBannedColorDisconnectItem");
return true;
}
}
}
else if (item.toString().length() > 262140 || isMovementDisconnectItem(item) || isInvalidAttributeName(item))
{
fired_countermeasure("isLargeNBTDisconnectItem");
return true;
}
}
return false;
}
boolean containsDisconnectItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.getTag() != null)
{
NBTTagList items = nmsItemStack.getTag().getCompound("BlockEntityTag").getList("Items", 10);
if (items != null)
{
for (int a = 0; a <= items.size(); a++)
{
NBTTagCompound nmsitem = items.getCompound(a);
return isDisconnectItem(nmsitem.getCompound("tag"));
}
}
}
}
return false;
}
private boolean isMovementDisconnectItem(NBTTagCompound tag)
{
if (tag != null)
{
NBTTagList attrlist = tag.getList("AttributeModifiers", 10);
if (attrlist != null)
{
HashMap<String, Float> attributes = new HashMap<>();
for (int a = 0; a <= attrlist.size(); a++)
{
NBTTagCompound attribute = attrlist.getCompound(a);
if (attribute.getString("AttributeName").equalsIgnoreCase("generic.movementspeed") && attributes.containsKey(attribute.getString("AttributeName").toLowerCase()) && !Float.isFinite(attribute.getFloat("Amount")))
{
fired_countermeasure("isMovementDisconnectItem");
return true;
}
attributes.put(attribute.getString("AttributeName").toLowerCase(), attribute.getFloat("Amount"));
}
}
}
return false;
}
private boolean isInvalidAttributeName(NBTTagCompound tag)
{
if (tag != null)
{
NBTTagList attrlist = tag.getList("AttributeModifiers", 10);
if (attrlist != null)
{
for (int a = 0; a <= attrlist.size(); a++)
{
NBTTagCompound attribute = attrlist.getCompound(a);
if (attribute != null && attribute.getString("AttributeName").toLowerCase() != "")
{
if (!Variables.LeagacyAttributes.liststr.contains(attribute.getString("AttributeName").toLowerCase()))
{
fired_countermeasure("isInvalidAttributeNameDisconnectItem");
return true;
}
}
}
}
}
return false;
}
void removeInvalidValues(Entity entity)
{
NBTTagCompound tag = getEntityNBT(entity);
if (tag.toString().contains("Color:-"))
{
try
{
MojangsonParser.parse(tag.toString().replaceAll("Color:-", ""));
}
catch (CommandSyntaxException e)
{
e.printStackTrace();
}
}
}
boolean isDangerousEgg(ItemStack item)
{
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack.asNMSCopy(item);
return nmsItemStack.hasTag() && VulnerabilityPatcher.main.getConfig().getStringList("BlockedEntityTags").contains(nmsItemStack.getTag().getCompound("EntityTag").getString("id").replaceAll("minecraft:", ""));
}
return false;
}
boolean isDangerousSkull(ItemStack item)
{
if (item != null && item.hasItemMeta())
{
NBTTagCompound tag = CraftItemStack.asNMSCopy(item).getTag();
if (tag != null && tag.hasKey("SkullOwner") && tag.getString("SkullOwner").trim().equals(""))
{
return true;
}
}
return false;
}
}

View file

@ -1,506 +0,0 @@
package me.cooljwb.vulnerabilitypatcher.modifiers;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.cooljwb.vulnerabilitypatcher.Variables;
import me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher;
import me.cooljwb.vulnerabilitypatcher.patches.Patches;
import net.minecraft.server.v1_14_R1.MojangsonParser;
import net.minecraft.server.v1_14_R1.NBTBase;
import net.minecraft.server.v1_14_R1.NBTTagCompound;
import net.minecraft.server.v1_14_R1.NBTTagList;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftItem;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftItemStack;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Firework;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.inventory.meta.SpawnEggMeta;
import org.bukkit.projectiles.ProjectileSource;
import java.io.File;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
/*
* Copyright 2019 CoolJWB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This class is a function port to 1.14
* Date: 2020-06-13
*
* @author CoolJWB
*/
public class NBTModifier_1_14
{
private Logger log = Logger.getLogger("Minecraft");
/* Misc */
public void log(Level level, String message)
{
log.log(level, String.format("[%s] %s", VulnerabilityPatcher.pluginName, message));
}
private void fired_countermeasure(String reason)
{
if (Patches.devmode)
{
log(Level.INFO, String.format("Fired countermeasure in %s reason: %s", getClass().getName(), reason));
}
}
private NBTTagCompound getItemNBT(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_14_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null)
{
return nmsItemStack.getTag();
}
}
return null;
}
private NBTTagCompound getEntityNBT(Entity entity)
{
net.minecraft.server.v1_14_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
NBTTagCompound tag = new NBTTagCompound();
nmsEntity.save(tag);
return tag;
}
private void setEntityNBT(Entity entity, NBTTagCompound nbtTagCompound)
{
net.minecraft.server.v1_14_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
nmsEntity.f(nbtTagCompound);
}
public NBTTagList getAttributeList(ItemStack item)
{
NBTTagCompound itemtag = getItemNBT(item);
if (item != null && itemtag != null && itemtag.hasKey("AttributeModifiers"))
{
return getItemNBT(item).getList("AttributeModifiers", 10);
}
return null;
}
String itemToString(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_14_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag())
{
return nmsItemStack.getTag().toString();
}
}
return "";
}
boolean removePlayerdata(String player)
{
if (Bukkit.getPlayer(player) != null)
{
((CraftEntity) Bukkit.getPlayer(player)).getHandle().f(new net.minecraft.server.v1_14_R1.NBTTagCompound());
return true;
}
else if (Bukkit.getOfflinePlayer(player) != null)
{
File file = new File(Bukkit.getServer().getWorldContainer() + "/world/playerdata/" + Bukkit.getOfflinePlayer(player).getUniqueId().toString() + ".dat");
return file.delete();
}
return false;
}
void resetMeta(Player player, ItemStack item, boolean mainhand)
{
net.minecraft.server.v1_14_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag() && nmsItemStack.getTag().hasKey("pages"))
{
String pages = nmsItemStack.getTag().getList("pages", 8).toString();
if (pages.contains("clickEvent") || pages.contains("hoverEvent"))
{
BookMeta meta = (BookMeta) item.getItemMeta();
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
meta.setPages(meta.getPages());
book.setItemMeta(meta);
if (mainhand)
{
player.getInventory().setItemInMainHand(book);
}
else
{
player.getInventory().setItemInOffHand(book);
}
}
}
}
boolean isPlayer(ProjectileSource source)
{
return source instanceof CraftPlayer;
}
double getArrowDamage(Arrow arrow)
{
return getEntityNBT(arrow).hasKey("damage") ? getEntityNBT(arrow).getDouble("damage") : 0;
}
void setArrowDamage(Arrow arrow, double amount)
{
NBTTagCompound tag = getEntityNBT(arrow);
if (tag.hasKey("damage"))
{
tag.setDouble("damage", amount);
setEntityNBT(arrow, tag);
}
}
int getFireworkEffectSize(Firework firework)
{
NBTTagCompound tag = getEntityNBT(firework);
if (tag.hasKey("FireworksItem") && tag.getCompound("FireworksItem").hasKey("tag") && tag.getCompound("FireworksItem").getCompound("tag").hasKey("Fireworks") && tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").hasKey("Explosions"))
{
return tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").getList("Explosions", 10).size();
}
return 0;
}
boolean hasFireworkLargeEffect(Firework firework)
{
NBTTagCompound tag = getEntityNBT(firework);
if (tag.hasKey("FireworksItem") && tag.getCompound("FireworksItem").hasKey("tag") && tag.getCompound("FireworksItem").getCompound("tag").hasKey("Fireworks") && tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").hasKey("Explosions"))
{
NBTTagList explosions = tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").getList("Explosions", 10);
for (int x = 0; x <= (explosions.size() - 1); x++)
{
if (explosions.getCompound(x).getInt("Type") == 1 || explosions.getCompound(x).getInt("Type") == 3)
{
return true;
}
}
}
return false;
}
boolean isCrashItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_14_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound itemtag = nmsItemStack.getTag();
if (itemtag.toString().contains("translation.test.invalid"))
{
fired_countermeasure("isCrashItem");
return true;
}
}
}
return false;
}
boolean containsCrashItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_14_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound blockentitytag = nmsItemStack.getTag().getCompound("BlockEntityTag");
NBTTagList itemlist = blockentitytag.getList("Items", 10);
for (int a = 0; a <= itemlist.size(); a++)
{
NBTTagCompound itemtag = itemlist.getCompound(a).getCompound("tag");
if (itemtag.toString().contains("translation.test.invalid"))
{
fired_countermeasure("containsCrashItem");
return true;
}
}
}
}
return false;
}
boolean isDeathItem(ItemStack item)
{
net.minecraft.server.v1_14_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
return isDeathItem(nmsItemStack.getTag());
return false;
}
private boolean isDeathItem(NBTTagCompound item)
{
if (item != null)
{
NBTTagList attrlist = item.getList("AttributeModifiers", 10);
if (attrlist != null)
{
for (int i = 0; i < attrlist.size(); i++)
{
NBTTagCompound compound = (NBTTagCompound) attrlist.get(i);
if ((compound.getString("Name").equalsIgnoreCase("MAX_HEALTH") || compound.getString("AttributeName").equalsIgnoreCase("generic.maxhealth")) && compound.getDouble("Amount") <= 0)
{
fired_countermeasure("isDeathItem");
return true;
}
}
}
}
return false;
}
boolean containsDeathItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_14_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound blockentitytag = nmsItemStack.getTag().getCompound("BlockEntityTag");
NBTTagList itemlist = blockentitytag.getList("Items", 10);
for (int a = 0; a <= itemlist.size(); a++)
{
NBTTagList attrlist = itemlist.getCompound(a).getCompound("tag").getList("AttributeModifiers", 10);
for (int b = 0; b <= attrlist.size(); b++)
{
String attribute_name = attrlist.getCompound(b).getString("AttributeName");
String name = attrlist.getCompound(b).getString("Name");
Double amount = attrlist.getCompound(b).getDouble("Amount");
if ((name.equalsIgnoreCase("MAX_HEALTH") || attribute_name.equalsIgnoreCase("generic.maxhealth")) && amount <= 0)
{
fired_countermeasure("containsDeathItem");
return true;
}
}
}
}
}
return false;
}
boolean isDisconnectItem(ItemStack item)
{
net.minecraft.server.v1_14_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
return isDisconnectItem(nmsItemStack.getTag());
}
return false;
}
boolean isDisconnectItem(Entity entity)
{
if (entity instanceof CraftItem)
return isDisconnectItem((CraftItem) entity);
return false;
}
private boolean isDisconnectItem(NBTTagCompound item)
{
if (item != null)
{
if (item.hasKey("CustomPotionColor") && item.getInt("CustomPotionColor") < 0)
{
fired_countermeasure("isCustomPotionColorDisconnectItem");
return true;
}
else if ((item.getCompound("display").hasKey("color") && item.getCompound("display").getInt("color") < 0))
{
fired_countermeasure("isDisplayColorDisconnectItem");
return true;
}
else if (item.getCompound("BlockEntityTag").hasKey("Patterns"))
{
NBTTagList patterns = item.getCompound("BlockEntityTag").getList("Patterns", 10);
for (int x = 0; x <= (patterns.size() - 1); x++)
{
if (patterns.get(x).getTypeId() == 10)
{
if (patterns.getCompound(x).hasKey("Color") && patterns.getCompound(x).getInt("Color") < 0)
{
return true;
}
}
}
for (NBTBase base : item.getCompound("BlockEntityTag").getList("Patterns", 10))
{
if (base.asString().contains("Color:-1"))
{
fired_countermeasure("isDisplayBannedColorDisconnectItem");
return true;
}
}
}
else if (item.toString().length() > 262140 || isMovementDisconnectItem(item) || isInvalidAttributeName(item))
{
fired_countermeasure("isLargeNBTDisconnectItem");
return true;
}
}
return false;
}
boolean containsDisconnectItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_14_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.getTag() != null)
{
NBTTagList items = nmsItemStack.getTag().getCompound("BlockEntityTag").getList("Items", 10);
if (items != null)
{
for (int x = 0; x <= (items.size() - 1); x++)
{
NBTTagCompound nmsitem = items.getCompound(x);
return isDisconnectItem(nmsitem.getCompound("tag"));
}
}
}
}
return false;
}
private boolean isMovementDisconnectItem(NBTTagCompound tag)
{
if (tag != null)
{
NBTTagList attrlist = tag.getList("AttributeModifiers", 10);
if (attrlist != null)
{
HashMap<String, Float> attributes = new HashMap<>();
for (int a = 0; a <= attrlist.size(); a++)
{
NBTTagCompound attribute = attrlist.getCompound(a);
if (attribute.getString("AttributeName").equalsIgnoreCase("generic.movementspeed") && attributes.containsKey(attribute.getString("AttributeName").toLowerCase()) && !Float.isFinite(attribute.getFloat("Amount")))
{
fired_countermeasure("isMovementDisconnectItem");
return true;
}
attributes.put(attribute.getString("AttributeName").toLowerCase(), attribute.getFloat("Amount"));
}
}
}
return false;
}
private boolean isInvalidAttributeName(NBTTagCompound tag)
{
if (tag != null)
{
NBTTagList attrlist = tag.getList("AttributeModifiers", 10);
if (attrlist != null)
{
for (int a = 0; a <= attrlist.size(); a++)
{
NBTTagCompound attribute = attrlist.getCompound(a);
if (attribute != null && attribute.getString("AttributeName").toLowerCase() != "")
{
if (!Variables.LeagacyAttributes.liststr.contains(attribute.getString("AttributeName").toLowerCase()))
{
fired_countermeasure("isInvalidAttributeNameDisconnectItem");
return true;
}
}
}
}
}
return false;
}
void removeInvalidValues(Entity entity)
{
NBTTagCompound tag = getEntityNBT(entity);
if (tag.asString().contains("Color:-"))
{
try
{
setEntityNBT(entity, MojangsonParser.parse(tag.asString().replaceAll("Color:-", "")));
}
catch (CommandSyntaxException e)
{
e.printStackTrace();
}
}
}
boolean isDangerousEgg(ItemStack item)
{
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
net.minecraft.server.v1_14_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
return nmsItemStack.hasTag() && VulnerabilityPatcher.main.getConfig().getStringList("BlockedEntityTags").contains(nmsItemStack.getTag().getCompound("EntityTag").getString("id").replaceAll("minecraft:", ""));
}
return false;
}
boolean isDangerousSkull(ItemStack item)
{
if (item != null && item.hasItemMeta())
{
NBTTagCompound tag = CraftItemStack.asNMSCopy(item).getTag();
if (tag != null && tag.hasKey("SkullOwner") && tag.getString("SkullOwner").trim().equals(""))
{
return true;
}
}
return false;
}
}

View file

@ -1,510 +0,0 @@
package me.cooljwb.vulnerabilitypatcher.modifiers;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.cooljwb.vulnerabilitypatcher.Variables;
import me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher;
import me.cooljwb.vulnerabilitypatcher.patches.Patches;
import net.minecraft.server.v1_15_R1.MojangsonParser;
import net.minecraft.server.v1_15_R1.NBTBase;
import net.minecraft.server.v1_15_R1.NBTTagCompound;
import net.minecraft.server.v1_15_R1.NBTTagList;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftItem;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Firework;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.inventory.meta.SpawnEggMeta;
import org.bukkit.projectiles.ProjectileSource;
import java.io.File;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
/*
* Copyright 2019 CoolJWB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This class is a function port to 1.15
* Date: 2020-06-13
*
* @author CoolJWB
*/
public class NBTModifier_1_15
{
private Logger log = Logger.getLogger("Minecraft");
/* Misc */
public void log(Level level, String message)
{
log.log(level, String.format("[%s] %s", VulnerabilityPatcher.pluginName, message));
}
private void fired_countermeasure(String reason)
{
if (Patches.devmode)
{
log(Level.INFO, String.format("Fired countermeasure in %s reason: %s", getClass().getName(), reason));
}
}
private NBTTagCompound getItemNBT(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_15_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null)
{
return nmsItemStack.getTag();
}
}
return null;
}
private NBTTagCompound getEntityNBT(Entity entity)
{
net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
NBTTagCompound tag = new NBTTagCompound();
nmsEntity.save(tag);
return tag;
}
private void setEntityNBT(Entity entity, NBTTagCompound nbtTagCompound)
{
net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
nmsEntity.f(nbtTagCompound);
}
public NBTTagList getAttributeList(ItemStack item)
{
NBTTagCompound itemtag = getItemNBT(item);
if (item != null && itemtag != null && itemtag.hasKey("AttributeModifiers"))
{
return getItemNBT(item).getList("AttributeModifiers", 10);
}
return null;
}
String itemToString(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_15_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag())
{
return nmsItemStack.getTag().toString();
}
}
return "";
}
boolean removePlayerdata(String player)
{
if (Bukkit.getPlayer(player) != null)
{
((CraftEntity) Bukkit.getPlayer(player)).getHandle().f(new net.minecraft.server.v1_15_R1.NBTTagCompound());
return true;
}
else if (Bukkit.getOfflinePlayer(player) != null)
{
File file = new File(Bukkit.getServer().getWorldContainer() + "/world/playerdata/" + Bukkit.getOfflinePlayer(player).getUniqueId().toString() + ".dat");
return file.delete();
}
return false;
}
void resetMeta(Player player, ItemStack item, boolean mainhand)
{
net.minecraft.server.v1_15_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag() && nmsItemStack.getTag().hasKey("pages"))
{
String pages = nmsItemStack.getTag().getList("pages", 8).toString();
if (pages.contains("clickEvent") || pages.contains("hoverEvent"))
{
BookMeta meta = (BookMeta) item.getItemMeta();
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
meta.setPages(meta.getPages());
book.setItemMeta(meta);
if (mainhand)
{
player.getInventory().setItemInMainHand(book);
}
else
{
player.getInventory().setItemInOffHand(book);
}
}
}
}
boolean isPlayer(ProjectileSource source)
{
return source instanceof CraftPlayer;
}
double getArrowDamage(Arrow arrow)
{
return getEntityNBT(arrow).hasKey("damage") ? getEntityNBT(arrow).getDouble("damage") : 0;
}
void setArrowDamage(Arrow arrow, double amount)
{
NBTTagCompound tag = getEntityNBT(arrow);
if (tag.hasKey("damage"))
{
tag.setDouble("damage", amount);
setEntityNBT(arrow, tag);
}
}
int getFireworkEffectSize(Firework firework)
{
NBTTagCompound tag = getEntityNBT(firework);
if (tag.hasKey("FireworksItem") && tag.getCompound("FireworksItem").hasKey("tag") && tag.getCompound("FireworksItem").getCompound("tag").hasKey("Fireworks") && tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").hasKey("Explosions"))
{
return tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").getList("Explosions", 10).size();
}
return 0;
}
boolean hasFireworkLargeEffect(Firework firework)
{
NBTTagCompound tag = getEntityNBT(firework);
if (tag.hasKey("FireworksItem") && tag.getCompound("FireworksItem").hasKey("tag") && tag.getCompound("FireworksItem").getCompound("tag").hasKey("Fireworks") && tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").hasKey("Explosions"))
{
NBTTagList explosions = tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").getList("Explosions", 10);
for (int x = 0; x <= (explosions.size() - 1); x++)
{
if (explosions.getCompound(x).getInt("Type") == 1 || explosions.getCompound(x).getInt("Type") == 3)
{
return true;
}
}
}
return false;
}
boolean isCrashItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_15_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound itemtag = nmsItemStack.getTag();
if (itemtag.toString().contains("translation.test.invalid"))
{
fired_countermeasure("isCrashItem");
return true;
}
}
}
return false;
}
boolean containsCrashItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_15_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound blockentitytag = nmsItemStack.getTag().getCompound("BlockEntityTag");
NBTTagList itemlist = blockentitytag.getList("Items", 10);
for (int a = 0; a <= itemlist.size(); a++)
{
NBTTagCompound itemtag = itemlist.getCompound(a).getCompound("tag");
if (itemtag.toString().contains("translation.test.invalid"))
{
fired_countermeasure("containsCrashItem");
return true;
}
}
}
}
return false;
}
boolean isDeathItem(ItemStack item)
{
net.minecraft.server.v1_15_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
return isDeathItem(nmsItemStack.getTag());
}
return false;
}
private boolean isDeathItem(NBTTagCompound item)
{
if (item != null)
{
NBTTagList attrlist = item.getList("AttributeModifiers", 10);
if (attrlist != null)
{
for (int i = 0; i < attrlist.size(); i++)
{
NBTTagCompound compound = (NBTTagCompound) attrlist.get(i);
if ((compound.getString("Name").equalsIgnoreCase("MAX_HEALTH") || compound.getString("AttributeName").equalsIgnoreCase("generic.maxhealth")) && compound.getDouble("Amount") <= 0)
{
fired_countermeasure("isDeathItem");
return true;
}
}
}
}
return false;
}
boolean containsDeathItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_15_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound blockentitytag = nmsItemStack.getTag().getCompound("BlockEntityTag");
NBTTagList itemlist = blockentitytag.getList("Items", 10);
for (int a = 0; a <= itemlist.size(); a++)
{
NBTTagList attrlist = itemlist.getCompound(a).getCompound("tag").getList("AttributeModifiers", 10);
for (int b = 0; b <= attrlist.size(); b++)
{
String attribute_name = attrlist.getCompound(b).getString("AttributeName");
String name = attrlist.getCompound(b).getString("Name");
Double amount = attrlist.getCompound(b).getDouble("Amount");
if ((name.equalsIgnoreCase("MAX_HEALTH") || attribute_name.equalsIgnoreCase("generic.maxhealth")) && amount <= 0)
{
fired_countermeasure("containsDeathItem");
return true;
}
}
}
}
}
return false;
}
boolean isDisconnectItem(ItemStack item)
{
net.minecraft.server.v1_15_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
return isDisconnectItem(nmsItemStack.getTag());
}
return false;
}
boolean isDisconnectItem(Entity entity)
{
if (entity instanceof CraftItem)
{
return isDisconnectItem((CraftItem) entity);
}
return false;
}
private boolean isDisconnectItem(NBTTagCompound item)
{
if (item != null)
{
if (item.hasKey("CustomPotionColor") && item.getInt("CustomPotionColor") < 0)
{
fired_countermeasure("isCustomPotionColorDisconnectItem");
return true;
}
else if ((item.getCompound("display").hasKey("color") && item.getCompound("display").getInt("color") < 0))
{
fired_countermeasure("isDisplayColorDisconnectItem");
return true;
}
else if (item.getCompound("BlockEntityTag").hasKey("Patterns"))
{
NBTTagList patterns = item.getCompound("BlockEntityTag").getList("Patterns", 10);
for (int x = 0; x <= (patterns.size() - 1); x++)
{
if (patterns.get(x).getTypeId() == 10)
{
if (patterns.getCompound(x).hasKey("Color") && patterns.getCompound(x).getInt("Color") < 0)
{
return true;
}
}
}
for (NBTBase base : item.getCompound("BlockEntityTag").getList("Patterns", 10))
{
if (base.asString().contains("Color:-1"))
{
fired_countermeasure("isDisplayBannedColorDisconnectItem");
return true;
}
}
}
else if (item.toString().length() > 262140 || isMovementDisconnectItem(item) || isInvalidAttributeName(item))
{
fired_countermeasure("isLargeNBTDisconnectItem");
return true;
}
}
return false;
}
boolean containsDisconnectItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_15_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.getTag() != null)
{
NBTTagList items = nmsItemStack.getTag().getCompound("BlockEntityTag").getList("Items", 10);
if (items != null)
{
for (int x = 0; x <= (items.size() - 1); x++)
{
NBTTagCompound nmsitem = items.getCompound(x);
return isDisconnectItem(nmsitem.getCompound("tag"));
}
}
}
}
return false;
}
private boolean isMovementDisconnectItem(NBTTagCompound tag)
{
if (tag != null)
{
NBTTagList attrlist = tag.getList("AttributeModifiers", 10);
if (attrlist != null)
{
HashMap<String, Float> attributes = new HashMap<>();
for (int a = 0; a <= attrlist.size(); a++)
{
NBTTagCompound attribute = attrlist.getCompound(a);
if (attribute.getString("AttributeName").equalsIgnoreCase("generic.movementspeed") && attributes.containsKey(attribute.getString("AttributeName").toLowerCase()) && !Float.isFinite(attribute.getFloat("Amount")))
{
fired_countermeasure("isMovementDisconnectItem");
return true;
}
attributes.put(attribute.getString("AttributeName").toLowerCase(), attribute.getFloat("Amount"));
}
}
}
return false;
}
private boolean isInvalidAttributeName(NBTTagCompound tag)
{
if (tag != null)
{
NBTTagList attrlist = tag.getList("AttributeModifiers", 10);
if (attrlist != null)
{
for (int a = 0; a <= attrlist.size(); a++)
{
NBTTagCompound attribute = attrlist.getCompound(a);
if (attribute != null && attribute.getString("AttributeName").toLowerCase() != "")
{
if (!Variables.LeagacyAttributes.liststr.contains(attribute.getString("AttributeName").toLowerCase()))
{
fired_countermeasure("isInvalidAttributeNameDisconnectItem");
return true;
}
}
}
}
}
return false;
}
void removeInvalidValues(Entity entity)
{
NBTTagCompound tag = getEntityNBT(entity);
if (tag.asString().contains("Color:-"))
{
try
{
setEntityNBT(entity, MojangsonParser.parse(tag.asString().replaceAll("Color:-", "")));
}
catch (CommandSyntaxException e)
{
e.printStackTrace();
}
}
}
boolean isDangerousEgg(ItemStack item)
{
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
net.minecraft.server.v1_15_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
return nmsItemStack.hasTag() && VulnerabilityPatcher.main.getConfig().getStringList("BlockedEntityTags").contains(nmsItemStack.getTag().getCompound("EntityTag").getString("id").replaceAll("minecraft:", ""));
}
return false;
}
boolean isDangerousSkull(ItemStack item)
{
if (item != null && item.hasItemMeta())
{
NBTTagCompound tag = CraftItemStack.asNMSCopy(item).getTag();
if (tag != null && tag.hasKey("SkullOwner") && tag.getString("SkullOwner").trim().equals(""))
{
return true;
}
}
return false;
}
}

View file

@ -1,506 +0,0 @@
package me.cooljwb.vulnerabilitypatcher.modifiers;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.cooljwb.vulnerabilitypatcher.Variables;
import me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher;
import me.cooljwb.vulnerabilitypatcher.patches.Patches;
import net.minecraft.server.v1_16_R1.MojangsonParser;
import net.minecraft.server.v1_16_R1.NBTBase;
import net.minecraft.server.v1_16_R1.NBTTagCompound;
import net.minecraft.server.v1_16_R1.NBTTagList;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftItem;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Firework;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.inventory.meta.SpawnEggMeta;
import org.bukkit.projectiles.ProjectileSource;
import java.io.File;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
/**
* This class is a function port to 1.15
* Date: 2020-06-13
*
* @author CoolJWB
*/
public class NBTModifier_1_16
{
private Logger log = Logger.getLogger("Minecraft");
/* Misc */
public void log(Level level, String message)
{
log.log(level, String.format("[%s] %s", VulnerabilityPatcher.pluginName, message));
}
private void fired_countermeasure(String reason)
{
if (Patches.devmode)
{
log(Level.INFO, String.format("Fired countermeasure in %s reason: %s", getClass().getName(), reason));
}
}
private NBTTagCompound getItemNBT(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null)
{
return nmsItemStack.getTag();
}
}
return null;
}
private NBTTagCompound getEntityNBT(Entity entity)
{
net.minecraft.server.v1_16_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
NBTTagCompound tag = new NBTTagCompound();
nmsEntity.save(tag);
return tag;
}
private void setEntityNBT(Entity entity, NBTTagCompound nbtTagCompound)
{
net.minecraft.server.v1_16_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
nmsEntity.save(nbtTagCompound);
}
public NBTTagList getAttributeList(ItemStack item)
{
NBTTagCompound itemtag = getItemNBT(item);
if (item != null && itemtag != null && itemtag.hasKey("AttributeModifiers"))
{
return getItemNBT(item).getList("AttributeModifiers", 10);
}
return null;
}
String itemToString(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag())
{
return nmsItemStack.getTag().toString();
}
}
return "";
}
boolean removePlayerdata(String player)
{
if (Bukkit.getPlayer(player) != null)
{
((CraftEntity) Bukkit.getPlayer(player)).getHandle().save(new net.minecraft.server.v1_16_R1.NBTTagCompound());
return true;
}
else if (Bukkit.getOfflinePlayer(player) != null)
{
File file = new File(Bukkit.getServer().getWorldContainer() + "/world/playerdata/" + Bukkit.getOfflinePlayer(player).getUniqueId().toString() + ".dat");
return file.delete();
}
return false;
}
void resetMeta(Player player, ItemStack item, boolean mainhand)
{
net.minecraft.server.v1_16_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag() && nmsItemStack.getTag().hasKey("pages"))
{
String pages = nmsItemStack.getTag().getList("pages", 8).toString();
if (pages.contains("clickEvent") || pages.contains("hoverEvent"))
{
BookMeta meta = (BookMeta) item.getItemMeta();
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
meta.setPages(meta.getPages());
book.setItemMeta(meta);
if (mainhand)
{
player.getInventory().setItemInMainHand(book);
}
else
{
player.getInventory().setItemInOffHand(book);
}
}
}
}
boolean isPlayer(ProjectileSource source)
{
return source instanceof CraftPlayer;
}
double getArrowDamage(Arrow arrow)
{
return getEntityNBT(arrow).hasKey("damage") ? getEntityNBT(arrow).getDouble("damage") : 0;
}
void setArrowDamage(Arrow arrow, double amount)
{
NBTTagCompound tag = getEntityNBT(arrow);
if (tag.hasKey("damage"))
{
tag.setDouble("damage", amount);
setEntityNBT(arrow, tag);
}
}
int getFireworkEffectSize(Firework firework)
{
NBTTagCompound tag = getEntityNBT(firework);
if (tag.hasKey("FireworksItem") && tag.getCompound("FireworksItem").hasKey("tag") && tag.getCompound("FireworksItem").getCompound("tag").hasKey("Fireworks") && tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").hasKey("Explosions"))
{
return tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").getList("Explosions", 10).size();
}
return 0;
}
boolean hasFireworkLargeEffect(Firework firework)
{
NBTTagCompound tag = getEntityNBT(firework);
if (tag.hasKey("FireworksItem") && tag.getCompound("FireworksItem").hasKey("tag") && tag.getCompound("FireworksItem").getCompound("tag").hasKey("Fireworks") && tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").hasKey("Explosions"))
{
NBTTagList explosions = tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").getList("Explosions", 10);
for (int x = 0; x <= (explosions.size() - 1); x++)
{
if (explosions.getCompound(x).getInt("Type") == 1 || explosions.getCompound(x).getInt("Type") == 3)
{
return true;
}
}
}
return false;
}
boolean isCrashItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound itemtag = nmsItemStack.getTag();
if (itemtag.toString().contains("translation.test.invalid"))
{
fired_countermeasure("isCrashItem");
return true;
}
}
}
return false;
}
boolean containsCrashItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
Pattern pattern = Pattern.compile("([a-z0-9/._-])");
NBTTagCompound blockEntityTag = nmsItemStack.getTag().getCompound("BlockEntityTag");
NBTTagList itemlist = blockEntityTag.getList("Items", 10);
for (int a = 0; a <= itemlist.size(); a++)
{
NBTTagCompound itemtag = itemlist.getCompound(a).getCompound("tag");
if (itemtag.toString().contains("translation.test.invalid")
|| (blockEntityTag.hasKey("LootTable") && !pattern.matcher(blockEntityTag.getString("LootTable")).find()))
{
fired_countermeasure("containsCrashItem");
return true;
}
}
}
}
return false;
}
boolean isDeathItem(ItemStack item)
{
net.minecraft.server.v1_16_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
return isDeathItem(nmsItemStack.getTag());
}
return false;
}
private boolean isDeathItem(NBTTagCompound item)
{
if (item != null)
{
NBTTagList attrlist = item.getList("AttributeModifiers", 10);
if (attrlist != null)
{
for (int i = 0; i < attrlist.size(); i++)
{
NBTTagCompound compound = (NBTTagCompound) attrlist.get(i);
if ((compound.getString("Name").equalsIgnoreCase("MAX_HEALTH") || compound.getString("AttributeName").equalsIgnoreCase("generic.max_health")) && compound.getDouble("Amount") <= 0)
{
fired_countermeasure("isDeathItem");
return true;
}
}
}
}
return false;
}
boolean containsDeathItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound blockentitytag = nmsItemStack.getTag().getCompound("BlockEntityTag");
NBTTagList itemlist = blockentitytag.getList("Items", 10);
for (int a = 0; a <= itemlist.size(); a++)
{
NBTTagList attrlist = itemlist.getCompound(a).getCompound("tag").getList("AttributeModifiers", 10);
for (int b = 0; b <= attrlist.size(); b++)
{
String attribute_name = attrlist.getCompound(b).getString("AttributeName");
String name = attrlist.getCompound(b).getString("Name");
Double amount = attrlist.getCompound(b).getDouble("Amount");
if ((name.equalsIgnoreCase("MAX_HEALTH") || attribute_name.equalsIgnoreCase("generic.max_health")) && amount <= 0)
{
fired_countermeasure("containsDeathItem");
return true;
}
}
}
}
}
return false;
}
boolean isDisconnectItem(ItemStack item)
{
net.minecraft.server.v1_16_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
return isDisconnectItem(nmsItemStack.getTag());
}
return false;
}
boolean isDisconnectItem(Entity entity)
{
if (entity instanceof CraftItem)
{
return isDisconnectItem((CraftItem) entity);
}
return false;
}
private boolean isDisconnectItem(NBTTagCompound item)
{
if (item != null)
{
if (item.hasKey("CustomPotionColor") && item.getInt("CustomPotionColor") < 0)
{
fired_countermeasure("isCustomPotionColorDisconnectItem");
return true;
}
else if ((item.getCompound("display").hasKey("color") && item.getCompound("display").getInt("color") < 0))
{
fired_countermeasure("isDisplayColorDisconnectItem");
return true;
}
else if (item.getCompound("BlockEntityTag").hasKey("Patterns"))
{
NBTTagList patterns = item.getCompound("BlockEntityTag").getList("Patterns", 10);
for (int x = 0; x <= (patterns.size() - 1); x++)
{
if (patterns.get(x).getTypeId() == 10)
{
if (patterns.getCompound(x).hasKey("Color") && patterns.getCompound(x).getInt("Color") < 0)
{
return true;
}
}
}
for (NBTBase base : item.getCompound("BlockEntityTag").getList("Patterns", 10))
{
if (base.asString().contains("Color:-1"))
{
fired_countermeasure("isDisplayBannedColorDisconnectItem");
return true;
}
}
}
else if (item.toString().length() > 262140)
{
fired_countermeasure("isLargeNBTDisconnectItem");
return true;
}
else if (isMovementDisconnectItem(item) /*|| isInvalidAttributeName(item)*/)
{
return true;
}
}
return false;
}
boolean containsDisconnectItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.getTag() != null)
{
NBTTagList items = nmsItemStack.getTag().getCompound("BlockEntityTag").getList("Items", 10);
if (items != null)
{
for (int x = 0; x <= (items.size() - 1); x++)
{
NBTTagCompound nmsitem = items.getCompound(x);
return isDisconnectItem(nmsitem.getCompound("tag"));
}
}
}
}
return false;
}
private boolean isMovementDisconnectItem(NBTTagCompound tag)
{
if (tag != null)
{
NBTTagList attrlist = tag.getList("AttributeModifiers", 10);
if (attrlist != null)
{
HashMap<String, Float> attributes = new HashMap<>();
for (int a = 0; a <= attrlist.size(); a++)
{
NBTTagCompound attribute = attrlist.getCompound(a);
if (attribute.getString("AttributeName").equalsIgnoreCase("generic.movement_speed") && attributes.containsKey(attribute.getString("AttributeName").toLowerCase()) && !Float.isFinite(attribute.getFloat("Amount")))
{
fired_countermeasure("isMovementDisconnectItem");
return true;
}
attributes.put(attribute.getString("AttributeName").toLowerCase(), attribute.getFloat("Amount"));
}
}
}
return false;
}
/**
* Does not have any use as this is patched in newer versions and only causes issues.
*/
@Deprecated
private boolean isInvalidAttributeName(NBTTagCompound tag)
{
if (tag != null)
{
NBTTagList attrlist = tag.getList("AttributeModifiers", 10);
if (attrlist != null)
{
for (int a = 0; a <= attrlist.size(); a++)
{
NBTTagCompound attribute = attrlist.getCompound(a);
if (attribute != null && attribute.getString("AttributeName").toLowerCase() != "")
{
if (!Variables.Attributes.liststr.contains(attribute.getString("AttributeName").toLowerCase()))
{
fired_countermeasure("isInvalidAttributeNameDisconnectItem");
return true;
}
}
}
}
}
return false;
}
void removeInvalidValues(Entity entity)
{
NBTTagCompound tag = getEntityNBT(entity);
if (tag.asString().contains("Color:-"))
{
try
{
setEntityNBT(entity, MojangsonParser.parse(tag.asString().replaceAll("Color:-", "")));
}
catch (CommandSyntaxException e)
{
e.printStackTrace();
}
}
}
boolean isDangerousEgg(ItemStack item)
{
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
net.minecraft.server.v1_16_R1.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
return nmsItemStack.hasTag() && VulnerabilityPatcher.main.getConfig().getStringList("BlockedEntityTags").contains(nmsItemStack.getTag().getCompound("EntityTag").getString("id").replaceAll("minecraft:", ""));
}
return false;
}
boolean isDangerousSkull(ItemStack item)
{
if (item != null && item.hasItemMeta())
{
NBTTagCompound tag = CraftItemStack.asNMSCopy(item).getTag();
if (tag != null && tag.hasKey("SkullOwner") && tag.getString("SkullOwner").trim().equals(""))
{
return true;
}
}
return false;
}
}

View file

@ -1,526 +0,0 @@
package me.cooljwb.vulnerabilitypatcher.modifiers;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.cooljwb.vulnerabilitypatcher.Variables;
import me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher;
import me.cooljwb.vulnerabilitypatcher.patches.Patches;
import net.minecraft.server.v1_16_R2.MojangsonParser;
import net.minecraft.server.v1_16_R2.NBTBase;
import net.minecraft.server.v1_16_R2.NBTTagCompound;
import net.minecraft.server.v1_16_R2.NBTTagList;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_16_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_16_R2.entity.CraftItem;
import org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_16_R2.inventory.CraftItemStack;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Firework;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.inventory.meta.SpawnEggMeta;
import org.bukkit.projectiles.ProjectileSource;
import java.io.File;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
/*
* Copyright 2019 CoolJWB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This class is a function port to 1.15
* Date: 2020-06-13
*
* @author CoolJWB
*/
public class NBTModifier_1_16_2
{
private Logger log = Logger.getLogger("Minecraft");
/* Misc */
public void log(Level level, String message)
{
log.log(level, String.format("[%s] %s", VulnerabilityPatcher.pluginName, message));
}
private void fired_countermeasure(String reason)
{
if (Patches.devmode)
{
log(Level.INFO, String.format("Fired countermeasure in %s reason: %s", getClass().getName(), reason));
}
}
private NBTTagCompound getItemNBT(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null)
{
return nmsItemStack.getTag();
}
}
return null;
}
private NBTTagCompound getEntityNBT(Entity entity)
{
net.minecraft.server.v1_16_R2.Entity nmsEntity = ((CraftEntity) entity).getHandle();
NBTTagCompound tag = new NBTTagCompound();
nmsEntity.save(tag);
return tag;
}
private void setEntityNBT(Entity entity, NBTTagCompound nbtTagCompound)
{
net.minecraft.server.v1_16_R2.Entity nmsEntity = ((CraftEntity) entity).getHandle();
nmsEntity.save(nbtTagCompound);
}
public NBTTagList getAttributeList(ItemStack item)
{
NBTTagCompound itemtag = getItemNBT(item);
if (item != null && itemtag != null && itemtag.hasKey("AttributeModifiers"))
{
return getItemNBT(item).getList("AttributeModifiers", 10);
}
return null;
}
String itemToString(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag())
{
return nmsItemStack.getTag().toString();
}
}
return "";
}
boolean removePlayerdata(String player)
{
boolean success = false;
for (World world : Bukkit.getWorlds())
{
File localUUIDfile = new File(Bukkit.getServer().getWorldContainer() + "/" + world.getName() + "/playerdata/" + Bukkit.getOfflinePlayer(player).getUniqueId().toString() + ".dat");
if (localUUIDfile.exists())
{
if (localUUIDfile.delete())
{
success = true;
}
}
}
return success;
}
void resetMeta(Player player, ItemStack item, boolean mainhand)
{
net.minecraft.server.v1_16_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag() && nmsItemStack.getTag().hasKey("pages"))
{
String pages = nmsItemStack.getTag().getList("pages", 8).toString();
if (pages.contains("clickEvent") || pages.contains("hoverEvent"))
{
BookMeta meta = (BookMeta) item.getItemMeta();
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
meta.setPages(meta.getPages());
book.setItemMeta(meta);
if (mainhand)
{
player.getInventory().setItemInMainHand(book);
}
else
{
player.getInventory().setItemInOffHand(book);
}
}
}
}
boolean isPlayer(ProjectileSource source)
{
return source instanceof CraftPlayer;
}
double getArrowDamage(Arrow arrow)
{
return getEntityNBT(arrow).hasKey("damage") ? getEntityNBT(arrow).getDouble("damage") : 0;
}
void setArrowDamage(Arrow arrow, double amount)
{
NBTTagCompound tag = getEntityNBT(arrow);
if (tag.hasKey("damage"))
{
tag.setDouble("damage", amount);
setEntityNBT(arrow, tag);
}
}
int getFireworkEffectSize(Firework firework)
{
NBTTagCompound tag = getEntityNBT(firework);
if (tag.hasKey("FireworksItem") && tag.getCompound("FireworksItem").hasKey("tag") && tag.getCompound("FireworksItem").getCompound("tag").hasKey("Fireworks") && tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").hasKey("Explosions"))
{
return tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").getList("Explosions", 10).size();
}
return 0;
}
boolean hasFireworkLargeEffect(Firework firework)
{
NBTTagCompound tag = getEntityNBT(firework);
if (tag.hasKey("FireworksItem") && tag.getCompound("FireworksItem").hasKey("tag") && tag.getCompound("FireworksItem").getCompound("tag").hasKey("Fireworks") && tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").hasKey("Explosions"))
{
NBTTagList explosions = tag.getCompound("FireworksItem").getCompound("tag").getCompound("Fireworks").getList("Explosions", 10);
for (int x = 0; x <= (explosions.size() - 1); x++)
{
if (explosions.getCompound(x).getInt("Type") == 1 || explosions.getCompound(x).getInt("Type") == 3)
{
return true;
}
}
}
return false;
}
boolean isCrashItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound itemtag = nmsItemStack.getTag();
if (itemtag.toString().contains("translation.test.invalid"))
{
fired_countermeasure("isCrashItem");
return true;
}
}
}
return false;
}
boolean containsCrashItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
Pattern pattern = Pattern.compile("([a-z0-9/._-])");
NBTTagCompound blockEntityTag = nmsItemStack.getTag().getCompound("BlockEntityTag");
NBTTagList itemlist = blockEntityTag.getList("Items", 10);
for (int a = 0; a <= itemlist.size(); a++)
{
NBTTagCompound itemtag = itemlist.getCompound(a).getCompound("tag");
if (itemtag.toString().contains("translation.test.invalid")
|| (blockEntityTag.hasKey("LootTable") && !pattern.matcher(blockEntityTag.getString("LootTable")).find()))
{
fired_countermeasure("containsCrashItem");
return true;
}
}
}
}
return false;
}
boolean isDeathItem(ItemStack item)
{
net.minecraft.server.v1_16_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
return isDeathItem(nmsItemStack.getTag());
}
return false;
}
private boolean isDeathItem(NBTTagCompound item)
{
if (item != null)
{
NBTTagList attrlist = item.getList("AttributeModifiers", 10);
if (attrlist != null)
{
for (int i = 0; i < attrlist.size(); i++)
{
NBTTagCompound compound = (NBTTagCompound) attrlist.get(i);
if ((compound.getString("Name").equalsIgnoreCase("MAX_HEALTH") || compound.getString("AttributeName").equalsIgnoreCase("generic.max_health")) && compound.getDouble("Amount") <= 0)
{
fired_countermeasure("isDeathItem");
return true;
}
}
}
}
return false;
}
boolean containsDeathItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
NBTTagCompound blockentitytag = nmsItemStack.getTag().getCompound("BlockEntityTag");
NBTTagList itemlist = blockentitytag.getList("Items", 10);
for (int a = 0; a <= itemlist.size(); a++)
{
NBTTagList attrlist = itemlist.getCompound(a).getCompound("tag").getList("AttributeModifiers", 10);
for (int b = 0; b <= attrlist.size(); b++)
{
String attribute_name = attrlist.getCompound(b).getString("AttributeName");
String name = attrlist.getCompound(b).getString("Name");
Double amount = attrlist.getCompound(b).getDouble("Amount");
if ((name.equalsIgnoreCase("MAX_HEALTH") || attribute_name.equalsIgnoreCase("generic.max_health")) && amount <= 0)
{
fired_countermeasure("containsDeathItem");
return true;
}
}
}
}
}
return false;
}
boolean isDisconnectItem(ItemStack item)
{
net.minecraft.server.v1_16_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
return isDisconnectItem(nmsItemStack.getTag());
}
return false;
}
boolean isDisconnectItem(Entity entity)
{
if (entity instanceof CraftItem)
{
return isDisconnectItem((CraftItem) entity);
}
return false;
}
private boolean isDisconnectItem(NBTTagCompound item)
{
if (item != null)
{
if (item.hasKey("CustomPotionColor") && item.getInt("CustomPotionColor") < 0)
{
fired_countermeasure("isCustomPotionColorDisconnectItem");
return true;
}
else if ((item.getCompound("display").hasKey("color") && item.getCompound("display").getInt("color") < 0))
{
fired_countermeasure("isDisplayColorDisconnectItem");
return true;
}
else if (item.getCompound("BlockEntityTag").hasKey("Patterns"))
{
NBTTagList patterns = item.getCompound("BlockEntityTag").getList("Patterns", 10);
for (int x = 0; x <= (patterns.size() - 1); x++)
{
if (patterns.get(x).getTypeId() == 10)
{
if (patterns.getCompound(x).hasKey("Color") && patterns.getCompound(x).getInt("Color") < 0)
{
return true;
}
}
}
for (NBTBase base : item.getCompound("BlockEntityTag").getList("Patterns", 10))
{
if (base.asString().contains("Color:-1"))
{
fired_countermeasure("isDisplayBannedColorDisconnectItem");
return true;
}
}
}
else if (item.toString().length() > 262140)
{
fired_countermeasure("isLargeNBTDisconnectItem");
return true;
}
else if (isMovementDisconnectItem(item) /*|| isInvalidAttributeName(item)*/)
{
return true;
}
}
return false;
}
boolean containsDisconnectItem(ItemStack item)
{
if (item != null)
{
net.minecraft.server.v1_16_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.getTag() != null)
{
NBTTagList items = nmsItemStack.getTag().getCompound("BlockEntityTag").getList("Items", 10);
if (items != null)
{
for (int x = 0; x <= (items.size() - 1); x++)
{
NBTTagCompound nmsitem = items.getCompound(x);
return isDisconnectItem(nmsitem.getCompound("tag"));
}
}
}
}
return false;
}
private boolean isMovementDisconnectItem(NBTTagCompound tag)
{
if (tag != null)
{
NBTTagList attrlist = tag.getList("AttributeModifiers", 10);
if (attrlist != null)
{
HashMap<String, Float> attributes = new HashMap<>();
for (int a = 0; a <= attrlist.size(); a++)
{
NBTTagCompound attribute = attrlist.getCompound(a);
if (attribute.getString("AttributeName").equalsIgnoreCase("generic.movement_speed") && attributes.containsKey(attribute.getString("AttributeName").toLowerCase()) && !Float.isFinite(attribute.getFloat("Amount")))
{
fired_countermeasure("isMovementDisconnectItem");
return true;
}
attributes.put(attribute.getString("AttributeName").toLowerCase(), attribute.getFloat("Amount"));
}
}
}
return false;
}
/**
* Does not have any use as this is patched in newer versions and only causes issues.
*/
@Deprecated
private boolean isInvalidAttributeName(NBTTagCompound tag)
{
if (tag != null)
{
NBTTagList attrlist = tag.getList("AttributeModifiers", 10);
if (attrlist != null)
{
for (int a = 0; a <= attrlist.size(); a++)
{
NBTTagCompound attribute = attrlist.getCompound(a);
if (attribute != null && attribute.getString("AttributeName").toLowerCase() != "")
{
if (!Variables.Attributes.liststr.contains(attribute.getString("AttributeName").toLowerCase()))
{
fired_countermeasure("isInvalidAttributeNameDisconnectItem");
return true;
}
}
}
}
}
return false;
}
void removeInvalidValues(Entity entity)
{
NBTTagCompound tag = getEntityNBT(entity);
if (tag.asString().contains("Color:-"))
{
try
{
setEntityNBT(entity, MojangsonParser.parse(tag.asString().replaceAll("Color:-", "")));
}
catch (CommandSyntaxException e)
{
e.printStackTrace();
}
}
}
boolean isDangerousEgg(ItemStack item)
{
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
net.minecraft.server.v1_16_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
return nmsItemStack.hasTag() && VulnerabilityPatcher.main.getConfig().getStringList("BlockedEntityTags").contains(nmsItemStack.getTag().getCompound("EntityTag").getString("id").replaceAll("minecraft:", ""));
}
return false;
}
boolean isDangerousSkull(ItemStack item)
{
if (item != null && item.hasItemMeta())
{
NBTTagCompound tag = CraftItemStack.asNMSCopy(item).getTag();
if (tag != null && tag.hasKey("SkullOwner") && tag.getString("SkullOwner").trim().equals(""))
{
return true;
}
}
return false;
}
}

View file

@ -4,17 +4,17 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.cooljwb.vulnerabilitypatcher.Variables;
import me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher;
import me.cooljwb.vulnerabilitypatcher.patches.Patches;
import net.minecraft.server.v1_16_R3.MojangsonParser;
import net.minecraft.server.v1_16_R3.NBTBase;
import net.minecraft.server.v1_16_R3.NBTTagCompound;
import net.minecraft.server.v1_16_R3.NBTTagList;
import net.minecraft.nbt.MojangsonParser;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftItem;
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftItem;
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Firework;
@ -31,7 +31,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
public class NBTModifier_1_16_3
public class NBTModifier_1_17_1
{
private Logger log = Logger.getLogger("Minecraft");
@ -54,7 +54,7 @@ public class NBTModifier_1_16_3
{
if (item != null)
{
net.minecraft.server.v1_16_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null)
{
return nmsItemStack.getTag();
@ -65,7 +65,7 @@ public class NBTModifier_1_16_3
private NBTTagCompound getEntityNBT(Entity entity)
{
net.minecraft.server.v1_16_R3.Entity nmsEntity = ((CraftEntity) entity).getHandle();
net.minecraft.world.entity.Entity nmsEntity = ((CraftEntity) entity).getHandle();
NBTTagCompound tag = new NBTTagCompound();
nmsEntity.save(tag);
return tag;
@ -73,7 +73,7 @@ public class NBTModifier_1_16_3
private void setEntityNBT(Entity entity, NBTTagCompound nbtTagCompound)
{
net.minecraft.server.v1_16_R3.Entity nmsEntity = ((CraftEntity) entity).getHandle();
net.minecraft.world.entity.Entity nmsEntity = ((CraftEntity) entity).getHandle();
nmsEntity.save(nbtTagCompound);
}
@ -92,7 +92,7 @@ public class NBTModifier_1_16_3
{
if (item != null)
{
net.minecraft.server.v1_16_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag())
{
@ -122,7 +122,7 @@ public class NBTModifier_1_16_3
void resetMeta(Player player, ItemStack item, boolean mainhand)
{
net.minecraft.server.v1_16_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.hasTag() && nmsItemStack.getTag().hasKey("pages"))
{
@ -198,7 +198,7 @@ public class NBTModifier_1_16_3
{
if (item != null)
{
net.minecraft.server.v1_16_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
@ -218,7 +218,7 @@ public class NBTModifier_1_16_3
{
if (item != null)
{
net.minecraft.server.v1_16_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
@ -244,7 +244,7 @@ public class NBTModifier_1_16_3
boolean isDeathItem(ItemStack item)
{
net.minecraft.server.v1_16_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
@ -279,7 +279,7 @@ public class NBTModifier_1_16_3
{
if (item != null)
{
net.minecraft.server.v1_16_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack.getTag() != null)
{
@ -310,7 +310,7 @@ public class NBTModifier_1_16_3
boolean isDisconnectItem(ItemStack item)
{
net.minecraft.server.v1_16_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.hasTag())
{
@ -387,7 +387,7 @@ public class NBTModifier_1_16_3
{
if (item != null)
{
net.minecraft.server.v1_16_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
if (nmsItemStack != null && nmsItemStack.getTag() != null)
{
@ -482,7 +482,7 @@ public class NBTModifier_1_16_3
{
if (item != null && item.getItemMeta() instanceof SpawnEggMeta)
{
net.minecraft.server.v1_16_R3.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
return nmsItemStack.hasTag() && VulnerabilityPatcher.main.getConfig().getStringList("BlockedEntityTags").contains(nmsItemStack.getTag().getCompound("EntityTag").getString("id").replaceAll("minecraft:", ""));
}
return false;
@ -506,7 +506,7 @@ public class NBTModifier_1_16_3
{
if (item != null && item.getType().name().contains("SIGN"))
{
net.minecraft.server.v1_16_R3.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
NBTTagCompound tag = nmsItem.getTag();
if (tag != null)
{
@ -524,7 +524,7 @@ public class NBTModifier_1_16_3
void clearOversizedSign(BlockPlaceEvent event)
{
ItemStack item = event.getItemInHand();
net.minecraft.server.v1_16_R3.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
NBTTagCompound tag = nmsItem.getTag().getCompound("BlockEntityTag");
String text1 = tag.hasKey("Text1") ? tag.getString("Text1").toLowerCase() : "";
String text2 = tag.hasKey("Text2") ? tag.getString("Text2").toLowerCase() : "";

View file

@ -85,7 +85,7 @@ public class Arrows extends Patches implements Listener
if (event.getEntity() instanceof SpectralArrow)
{
SpectralArrow spec_arrow = (SpectralArrow) event.getEntity();
damage = getArrowDamage(spec_arrow);
damage = getArrowDamage((Arrow) spec_arrow);
knockback = spec_arrow.getKnockbackStrength();
if (knockback > 10)
@ -97,7 +97,7 @@ public class Arrows extends Patches implements Listener
if (damage < 0 || damage > 214748364)
{
fired_countermeasure("ArrowDamage: " + damage);
setArrowDamage(spec_arrow, 0);
setArrowDamage((Arrow) spec_arrow, 0);
}
}
else

View file

@ -1,6 +1,6 @@
name: VulnerabilityPatcher
version: "1.9.4"
api-version: 1.13
version: "1.9.5"
api-version: "1.17"
main: me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher
authors: [CoolJWB]
description: Patches vulnerabilities that cause server instabilaty.