diff --git a/.classpath b/.classpath
deleted file mode 100644
index 540156a..0000000
--- a/.classpath
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.idea/VulnerabilityPatcher.iml b/.idea/VulnerabilityPatcher.iml
deleted file mode 100644
index d6ebd48..0000000
--- a/.idea/VulnerabilityPatcher.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__com_destroystokyo_paper_paper_api_1_13_2_R0_1_SNAPSHOT.xml b/.idea/libraries/Gradle__com_destroystokyo_paper_paper_api_1_13_2_R0_1_SNAPSHOT.xml
index d8413a1..edda5ee 100644
--- a/.idea/libraries/Gradle__com_destroystokyo_paper_paper_api_1_13_2_R0_1_SNAPSHOT.xml
+++ b/.idea/libraries/Gradle__com_destroystokyo_paper_paper_api_1_13_2_R0_1_SNAPSHOT.xml
@@ -1,13 +1,14 @@
-
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_spigotmc_spigot_api_1_13_2_R0_1_SNAPSHOT.xml b/.idea/libraries/Gradle__org_spigotmc_spigot_api_1_13_2_R0_1_SNAPSHOT.xml
deleted file mode 100644
index fb581a4..0000000
--- a/.idea/libraries/Gradle__org_spigotmc_spigot_api_1_13_2_R0_1_SNAPSHOT.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/me.CoolJWB.VulnerabilityPatcher.VulnerabilityPatcher.iml b/.idea/modules/me.CoolJWB.VulnerabilityPatcher.VulnerabilityPatcher.iml
deleted file mode 100644
index 52e8439..0000000
--- a/.idea/modules/me.CoolJWB.VulnerabilityPatcher.VulnerabilityPatcher.iml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/me.CoolJWB.VulnerabilityPatcher.VulnerabilityPatcher.main.iml b/.idea/modules/me.CoolJWB.VulnerabilityPatcher.VulnerabilityPatcher.main.iml
deleted file mode 100644
index d39aa5e..0000000
--- a/.idea/modules/me.CoolJWB.VulnerabilityPatcher.VulnerabilityPatcher.main.iml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
- SPIGOT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/me.CoolJWB.VulnerabilityPatcher.VulnerabilityPatcher.test.iml b/.idea/modules/me.CoolJWB.VulnerabilityPatcher.VulnerabilityPatcher.test.iml
deleted file mode 100644
index 8792491..0000000
--- a/.idea/modules/me.CoolJWB.VulnerabilityPatcher.VulnerabilityPatcher.test.iml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
- SPIGOT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.iml b/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.iml
index 40c7893..677faa0 100644
--- a/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.iml
+++ b/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.iml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.main.iml b/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.main.iml
index 0eb9f64..26bb147 100644
--- a/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.main.iml
+++ b/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.main.iml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.test.iml b/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.test.iml
index 75becca..38a49a2 100644
--- a/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.test.iml
+++ b/.idea/modules/me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher-Paper.test.iml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
deleted file mode 100644
index e96534f..0000000
--- a/.idea/uiDesigner.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 35eb1dd..94a25f7 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/workspace-SK54BF641F610A.xml b/.idea/workspace-SK54BF641F610A.xml
deleted file mode 100644
index 63c133c..0000000
--- a/.idea/workspace-SK54BF641F610A.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1548667472501
-
-
- 1548667472501
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d6663b4..f6398fd 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,7 +1,62 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -24,51 +79,34 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
+
+
+
+
+
+
@@ -78,13 +116,14 @@
+
-
+
@@ -118,15 +157,6 @@
-
-
-
-
-
-
-
-
-
@@ -136,13 +166,6 @@
-
-
-
-
-
-
-
@@ -150,7 +173,7 @@
-
+
@@ -184,6 +207,7 @@
+ true
@@ -202,19 +226,14 @@
-
-
-
-
-
-
-
+
-
-
-
-
+
+
+
+
+
@@ -222,39 +241,24 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -272,20 +276,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -293,13 +283,6 @@
-
-
-
-
-
-
-
@@ -307,13 +290,6 @@
-
-
-
-
-
-
-
@@ -328,13 +304,6 @@
-
-
-
-
-
-
-
@@ -349,41 +318,113 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
diff --git a/.project b/.project
deleted file mode 100644
index 149ce6f..0000000
--- a/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- VulnerabilityPatcher
- Project VulnerabilityPatcher created by Buildship.
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.buildship.core.gradleprojectbuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
- org.eclipse.buildship.core.gradleprojectnature
-
-
diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs
deleted file mode 100644
index e889521..0000000
--- a/.settings/org.eclipse.buildship.core.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-connection.project.dir=
-eclipse.preferences.version=1
diff --git a/README.md b/README.md
index b6b0961..eace293 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,10 @@
# VulnerabilityPatcher
**Info:**
-VulnerabilityPatcher is a light weight Spigot plugin that runs on 1.13.2 servers.
+VulnerabilityPatcher is a light weight Paper plugin that runs on 1.13.2 servers.
Its task is to prevent bugs in Spigot to cause issues for both the server and the players.
**Patches:**
It currently prevents 15+ vulnerabilities from being executed.
**Planned:**
-- More security patches.
-- A safe mode feature in emergencies when the plugin isn't working properly.
\ No newline at end of file
+- Spigot and Paper support.
diff --git a/bin/main/.gitignore b/bin/main/.gitignore
deleted file mode 100644
index 4060509..0000000
--- a/bin/main/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/me/
diff --git a/bin/main/config.yml b/bin/main/config.yml
deleted file mode 100644
index a96820d..0000000
--- a/bin/main/config.yml
+++ /dev/null
@@ -1,38 +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
-
-# All entities added below will be blocked to use in a spawn egg.
-BlockedEntityTags:
- - lightning_bolt
- - falling_block
-
-Commands:
- Help:
- Permission: vulnerability.help
- Version:
- Permission: vulnerability.version
- Reload:
- Permission: vulnerability.reload
-
-Notify:
- Enabled: false
- Permission: vulnerability.notify
-
-# DevMode should be set to false, unless you're a developer of this plugin.
-DevMode: false
-
-# This should not be changed unless you know what you're doing.
-ConfVersion: 0
\ No newline at end of file
diff --git a/bin/main/plugin.yml b/bin/main/plugin.yml
deleted file mode 100644
index f454d76..0000000
--- a/bin/main/plugin.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-name: VulnerabilityPatcher
-version: 0.2
-main: me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher
-api-version: 1.13
-authors: [CoolJWB]
-description: Patches the server vulnerabilities.
-commands:
- vulnerabilitypatcher:
- aliases: [vp]
- description: The main command for VulnerabilityPatcher.
- getnbt:
- description: Reveals an items NBT data.
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index cdce8d1..3588aab 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,2 +1,2 @@
pluginGroup=me.cooljwb.vulnerabilitypatcher
-pluginVersion=v0.3
+pluginVersion=v0.3.1
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/SMG.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/SMG.class
deleted file mode 100644
index 7999d94..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/SMG.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/VulnerabilityPatcher.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/VulnerabilityPatcher.class
deleted file mode 100644
index 5395d6e..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/VulnerabilityPatcher.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/commands/CommandVulnerabilityPatcher.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/commands/CommandVulnerabilityPatcher.class
deleted file mode 100644
index 485a76d..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/commands/CommandVulnerabilityPatcher.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Books.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Books.class
deleted file mode 100644
index b9037c3..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Books.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Egg.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Egg.class
deleted file mode 100644
index 4bbc7b7..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Egg.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Items$1.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Items$1.class
deleted file mode 100644
index 1b489f0..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Items$1.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Items$2.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Items$2.class
deleted file mode 100644
index 00248f7..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Items$2.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Items.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Items.class
deleted file mode 100644
index fcb0456..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Crash_Items.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Items$1.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Items$1.class
deleted file mode 100644
index 855c547..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Items$1.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Items$2.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Items$2.class
deleted file mode 100644
index 9058e85..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Items$2.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Items.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Items.class
deleted file mode 100644
index c560ff6..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Items.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Potions.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Potions.class
deleted file mode 100644
index ce62c23..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Death_Potions.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items$1.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items$1.class
deleted file mode 100644
index 0957ae2..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items$1.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items$2.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items$2.class
deleted file mode 100644
index 77f1127..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items$2.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items.class
deleted file mode 100644
index 773be90..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Disconnect_Items.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Follow_Range.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Follow_Range.class
deleted file mode 100644
index e5dc99b..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Follow_Range.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Patches.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Patches.class
deleted file mode 100644
index 2a353f2..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Patches.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Player_Knockback.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Player_Knockback.class
deleted file mode 100644
index eb57091..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Player_Knockback.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Rouge_Entity$1.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Rouge_Entity$1.class
deleted file mode 100644
index aeb45f6..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Rouge_Entity$1.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Rouge_Entity.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Rouge_Entity.class
deleted file mode 100644
index ae24be2..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Rouge_Entity.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Trident_Riptide$1.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Trident_Riptide$1.class
deleted file mode 100644
index 0d0d504..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Trident_Riptide$1.class and /dev/null differ
diff --git a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Trident_Riptide.class b/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Trident_Riptide.class
deleted file mode 100644
index 717b666..0000000
Binary files a/out/production/classes/me/cooljwb/vulnerabilitypatcher/patches/Trident_Riptide.class and /dev/null differ
diff --git a/out/production/resources/config.yml b/out/production/resources/config.yml
index 883f25b..af95a9c 100644
--- a/out/production/resources/config.yml
+++ b/out/production/resources/config.yml
@@ -1,18 +1,26 @@
-# VulnerabilityPatcher by CoolJWB
-# Patches:
-# DeathPotions, DeathItems, CrashSigns, Books, RougeEntity, Knockback, Riptide, FollowRange, DisconnectItems, CrashEgg.
+# 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
- - CrashSigns
+ - CrashItems
- Books
- RougeEntity
- - Knockback
+ - Arrows
- Riptide
- FollowRange
- DisconnectItems
- - CrashEgg
+ - 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:
@@ -21,10 +29,18 @@ Commands:
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
-# Should be set to false, unless you're a developer of this plugin.
+# DevMode should be set to false, unless you're a developer of this plugin.
DevMode: false
\ No newline at end of file
diff --git a/out/production/resources/plugin.yml b/out/production/resources/plugin.yml
index 35e8eed..78fa8d4 100644
--- a/out/production/resources/plugin.yml
+++ b/out/production/resources/plugin.yml
@@ -1,10 +1,12 @@
name: VulnerabilityPatcher
-version: @version@
-main: me.cooljwb.vulnerabilitypatcher.vulnerabilitypatcher.VulnerabilityPatcher
+version: 0.3
+main: me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher
api-version: 1.13
authors: [CoolJWB]
-description: Patches the server vulnerabilities.
+description: The brand new v0.3 VulnerabilityPatcher for Paper 1.13.2 servers.
commands:
vulnerabilitypatcher:
aliases: [vp]
- description: The main command for VulnerabilityPatcher.
\ No newline at end of file
+ description: The main command for VulnerabilityPatcher.
+ getnbt:
+ description: Reveals an items NBT data.
\ No newline at end of file
diff --git a/src/main/java/me/cooljwb/vulnerabilitypatcher/SMG.java b/src/main/java/me/cooljwb/vulnerabilitypatcher/SMG.java
index b20378e..004e8b1 100644
--- a/src/main/java/me/cooljwb/vulnerabilitypatcher/SMG.java
+++ b/src/main/java/me/cooljwb/vulnerabilitypatcher/SMG.java
@@ -42,6 +42,8 @@ public enum SMG {
ITEM_IN_CONTAINER(SMG.VULNERABILITYPATCHER.msg + "&cAn item in this container is not allowed."),
ITEM_NOTIFY(SMG.VULNERABILITYPATCHER.msg + "&c%s tried to %s a %s at x:%s y:%s z:%s"),
+ BLOCK(SMG.VULNERABILITYPATCHER.msg + "&cThis block is not allowed."),
+
NO_PERMISSION(SMG.VULNERABILITYPATCHER.msg + "&cYou do not have permission to do this."),
NOT_PLAYER(SMG.VULNERABILITYPATCHER.msg + "&cThis command can only be done in game."),
UNKNOWN_ARGUMENT(SMG.VULNERABILITYPATCHER.msg + "&cUnknown argument."),
diff --git a/src/main/java/me/cooljwb/vulnerabilitypatcher/VulnerabilityPatcher.java b/src/main/java/me/cooljwb/vulnerabilitypatcher/VulnerabilityPatcher.java
index cd82a9f..3396e74 100644
--- a/src/main/java/me/cooljwb/vulnerabilitypatcher/VulnerabilityPatcher.java
+++ b/src/main/java/me/cooljwb/vulnerabilitypatcher/VulnerabilityPatcher.java
@@ -97,6 +97,7 @@ public final class VulnerabilityPatcher extends JavaPlugin {
case "DisconnectItems": listeners.add(new Disconnect_Items()); break;
case "EntityTag": listeners.add(new Entity_Tag()); break;
case "Blocks": listeners.add(new Blocks()); break;
+ case "StructureBlocks": listeners.add(new Structure_Blocks()); break;
}
}
listeners.forEach(listener -> Bukkit.getPluginManager().registerEvents(listener, this));
diff --git a/src/main/java/me/cooljwb/vulnerabilitypatcher/commands/CommandVulnerabilityPatcher.java b/src/main/java/me/cooljwb/vulnerabilitypatcher/commands/CommandVulnerabilityPatcher.java
index 82d5664..7b6dbc4 100644
--- a/src/main/java/me/cooljwb/vulnerabilitypatcher/commands/CommandVulnerabilityPatcher.java
+++ b/src/main/java/me/cooljwb/vulnerabilitypatcher/commands/CommandVulnerabilityPatcher.java
@@ -89,7 +89,7 @@ public class CommandVulnerabilityPatcher extends Patches implements CommandExecu
main.getConfig().set("BlockedEntityTags", stringList);
main.saveConfig();
- msg(sender, SMG.UNBLOCKED_TAGS.msg);
+ msg(sender, String.format(SMG.UNBLOCKED_TAGS.msg, args[1]));
}
else
@@ -103,7 +103,7 @@ public class CommandVulnerabilityPatcher extends Patches implements CommandExecu
main.getConfig().set("Patches", stringList);
main.saveConfig();
- msg(sender, SMG.ENABLED_PATCH.msg);
+ msg(sender, String.format(SMG.ENABLED_PATCH.msg, args[1]));
}
else
@@ -117,7 +117,7 @@ public class CommandVulnerabilityPatcher extends Patches implements CommandExecu
main.getConfig().set("Patches", stringList);
main.saveConfig();
- msg(sender, SMG.DISABLED_PATCH.msg);
+ msg(sender, String.format(SMG.DISABLED_PATCH.msg, args[1]));
}
else
diff --git a/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Books.java b/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Books.java
index 4549754..bb6cf2a 100644
--- a/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Books.java
+++ b/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Books.java
@@ -78,14 +78,14 @@ public class Books extends Patches implements Listener {
public void knowledgeBook(Player player, EquipmentSlot hand) {
if(hand.name().equals("OFF_HAND")) {
ItemStack hand_item = player.getInventory().getItemInOffHand();
- hand_item.setAmount(-1);
- msg(player, SMG.ITEM.msg);
+ if(itemToString(hand_item).length() > 100)
+ hand_item.setItemMeta(null);
}
else if(hand.name().equals("HAND")) {
ItemStack hand_item = player.getInventory().getItemInMainHand();
- hand_item.setAmount(-1);
- msg(player, SMG.ITEM.msg);
+ if(itemToString(hand_item).length() > 100)
+ hand_item.setItemMeta(null);
}
}
diff --git a/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Death_Items.java b/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Death_Items.java
index 2625d4a..e0517cd 100644
--- a/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Death_Items.java
+++ b/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Death_Items.java
@@ -46,6 +46,7 @@ public class Death_Items extends Patches implements Listener {
private Logger log = Logger.getLogger("Minecraft");
+ /* When a dispenser dispenses a death item cancel the event and null the item. */
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockDispenseEvent(BlockDispenseEvent event) {
if(containsDeathItem(event.getItem())) {
@@ -65,6 +66,7 @@ public class Death_Items extends Patches implements Listener {
debug(event);
}
+ /* When a block is placed with a death item in it cancel the event and remove the item. */
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockPlaceEvent(BlockPlaceEvent event) {
if(event.getBlockPlaced().getState() instanceof Container) {
@@ -73,7 +75,6 @@ public class Death_Items extends Patches implements Listener {
for(ItemStack item : container.getInventory()) {
if(isDeathItem(item) || containsDeathItem(item)) {
container.getInventory().remove(item);
- event.setCancelled(true);
Player player = event.getPlayer();
msg(player, SMG.ITEM_IN_CONTAINER.msg);
@@ -85,6 +86,7 @@ public class Death_Items extends Patches implements Listener {
debug(event);
}
+ /* When an item is clicked on check if it's a death item and if so null it. */
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryClickEvent(InventoryClickEvent event) {
if(isDeathItem(event.getCursor()) || containsDeathItem(event.getCursor())) {
@@ -111,6 +113,7 @@ public class Death_Items extends Patches implements Listener {
debug(event);
}
+ /* When an item is dropped check if it's a death item and if so cancel the event and null the item. */
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerDropEvent(PlayerDropItemEvent event) {
ItemStack item = event.getItemDrop().getItemStack();
@@ -127,6 +130,7 @@ public class Death_Items extends Patches implements Listener {
debug(event);
}
+ /* Check if an item is a death item. */
public boolean isDeathItem(ItemStack item) {
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
@@ -135,6 +139,7 @@ public class Death_Items extends Patches implements Listener {
return false;
}
+ /* Check if a NBTTagCompound is a death item. */
public boolean isDeathItem(NBTTagCompound item) {
if(item != null) {
NBTTagList attrlist = item.getList("AttributeModifiers", 10);
@@ -152,6 +157,7 @@ public class Death_Items extends Patches implements Listener {
return false;
}
+ /* Check if an item such as a chest contains a death item. */
public boolean containsDeathItem(ItemStack item) {
if(item != null) {
net.minecraft.server.v1_13_R2.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
diff --git a/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Patches.java b/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Patches.java
index 8000ddb..d519e8e 100644
--- a/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Patches.java
+++ b/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Patches.java
@@ -119,7 +119,7 @@ public class Patches implements Listener {
for(String listener : listeners) {
switch(listener) {
case "DeathItems":
- if(death_items.isDeathItem(item) || death_items.containsDeathItem(item)) {
+ if(death_items.isDeathItem(item)) { // Removed containsDeathItem cause it's useless to check for death items in a container when it's checked event wise.
clearItemMeta(item);
notifyViolation(player, "acquire", "death item", player.getLocation());
msg(player, SMG.ITEMS.msg);
@@ -153,7 +153,7 @@ public class Patches implements Listener {
}
}
- }, 0L, 0);
+ }, 20L, 0); // Made the delay 20 ticks cause it's easier on the server.
}
public void msg(Player player, String msg) {
diff --git a/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Rouge_Entity.java b/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Rouge_Entity.java
index 6bb2dd9..7da6aff 100644
--- a/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Rouge_Entity.java
+++ b/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Rouge_Entity.java
@@ -2,21 +2,11 @@ package me.cooljwb.vulnerabilitypatcher.patches;
import com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent;
import org.bukkit.*;
-import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
-import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Entity;
-import org.bukkit.entity.LivingEntity;
import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
-import org.bukkit.event.entity.EntityDamageByEntityEvent;
-import org.bukkit.event.entity.EntityInteractEvent;
-import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitScheduler;
-import org.bukkit.util.Vector;
-import java.util.Random;
-import java.util.logging.Level;
import java.util.logging.Logger;
/*
diff --git a/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Structure_Blocks.java b/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Structure_Blocks.java
new file mode 100644
index 0000000..f983636
--- /dev/null
+++ b/src/main/java/me/cooljwb/vulnerabilitypatcher/patches/Structure_Blocks.java
@@ -0,0 +1,21 @@
+package me.cooljwb.vulnerabilitypatcher.patches;
+
+import org.bukkit.Material;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerInteractEvent;
+
+public class Structure_Blocks extends Patches implements Listener {
+
+ @EventHandler(priority = EventPriority.HIGHEST)
+ public void onPlayerInteractEvent(PlayerInteractEvent event) {
+ if(!(event.getClickedBlock() == null || event.isCancelled())) {
+ Material block = event.getClickedBlock().getType();
+ if (block == Material.STRUCTURE_BLOCK || block == Material.LEGACY_STRUCTURE_BLOCK) {
+ event.getClickedBlock().setType(Material.AIR);
+ event.setCancelled(true);
+ }
+ }
+ }
+}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 6258ece..af95a9c 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -14,6 +14,7 @@ Patches:
- DisconnectItems
- EntityTag
- Blocks
+ - StructureBlocks
# All entities added below will be blocked to use in a spawn egg.
BlockedEntityTags:
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 78fa8d4..78678c2 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,5 +1,5 @@
name: VulnerabilityPatcher
-version: 0.3
+version: 0.3.1
main: me.cooljwb.vulnerabilitypatcher.VulnerabilityPatcher
api-version: 1.13
authors: [CoolJWB]