From e16bcfdb16ef8beebfcde7f5c371d33bd42e47b5 Mon Sep 17 00:00:00 2001
From: Arkadiy <83061703+MEFRREEX@users.noreply.github.com>
Date: Mon, 31 Oct 2022 15:58:18 +0200
Subject: [PATCH] Add files via upload
---
pom.xml | 64 ++++++++++--------
src/main/java/me/driftay/chatfilter/Main.java | 17 ++---
.../me/driftay/chatfilter/WordsFilter.java | 23 +++----
src/main/resources/config.yml | 40 ++---------
src/main/resources/plugin.yml | 5 +-
target/ChatFilter.jar | Bin 0 -> 4823 bytes
target/classes/config.yml | 23 +++++++
.../classes/me/driftay/chatfilter/Main.class | Bin 0 -> 962 bytes
.../me/driftay/chatfilter/WordsFilter.class | Bin 0 -> 2404 bytes
target/classes/plugin.yml | 5 ++
target/maven-archiver/pom.properties | 5 ++
.../compile/default-compile/createdFiles.lst | 2 +
.../compile/default-compile/inputFiles.lst | 2 +
13 files changed, 95 insertions(+), 91 deletions(-)
create mode 100644 target/ChatFilter.jar
create mode 100644 target/classes/config.yml
create mode 100644 target/classes/me/driftay/chatfilter/Main.class
create mode 100644 target/classes/me/driftay/chatfilter/WordsFilter.class
create mode 100644 target/classes/plugin.yml
create mode 100644 target/maven-archiver/pom.properties
create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
diff --git a/pom.xml b/pom.xml
index c759455..4ce73e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,49 +1,55 @@
-
+
4.0.0
-
groupId
ChatFilter
2.0-SNAPSHOT
+
+ UTF-8
+ 1.8
+ 1.8
+
+
+
+
+ nukkitx-repo
+ https://repo.nukkitx.com/snapshot/
+
+
+
+
+
+ releases
+ nukkitx-releases
+ https://repo.nukkitx.com/release
+
+
+ snapshots
+ nukkitx-snapshots
+ https://repo.nukkitx.com/snapshot
+
+
- org.spigotmc
- spigot-api
- 1.8.8-R0.1-SNAPSHOT
+ cn.nukkit
+ nukkit
+ 1.0-SNAPSHOT
provided
-
-
- spigot-repo
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.0
-
-
- 1.8
-
-
-
+ clean package
+ ${project.name}
+ src/main/java
- src/main/resources
true
+ src/main/resources/
-
-
-
\ No newline at end of file
+
diff --git a/src/main/java/me/driftay/chatfilter/Main.java b/src/main/java/me/driftay/chatfilter/Main.java
index 3868d98..53070e7 100644
--- a/src/main/java/me/driftay/chatfilter/Main.java
+++ b/src/main/java/me/driftay/chatfilter/Main.java
@@ -1,18 +1,15 @@
package me.driftay.chatfilter;
-import org.bukkit.Bukkit;
-import org.bukkit.command.ConsoleCommandSender;
-import org.bukkit.plugin.java.JavaPlugin;
+import cn.nukkit.event.Listener;
+import cn.nukkit.plugin.PluginBase;
-public class Main extends JavaPlugin {
- ConsoleCommandSender Console = Bukkit.getConsoleSender();
+public class Main extends PluginBase {
public void onEnable() {
- this.Console.sendMessage("ChatFilter Enabled");
- this.Console.sendMessage("Author: Driftay");
- this.getConfig().options().copyDefaults(true);
+ this.getLogger().info("ChatFilter Enabled");
+ this.getLogger().info("Author: Driftay");
this.saveDefaultConfig();
- this.getServer().getPluginManager().registerEvents(new WordsFilter(this), this);
- this.getCommand("chatfilter").setExecutor(new ReloadCMD(this));
+
+ this.getServer().getPluginManager().registerEvents((Listener) new WordsFilter(this), this);
}
}
diff --git a/src/main/java/me/driftay/chatfilter/WordsFilter.java b/src/main/java/me/driftay/chatfilter/WordsFilter.java
index ac45b2c..8d935af 100644
--- a/src/main/java/me/driftay/chatfilter/WordsFilter.java
+++ b/src/main/java/me/driftay/chatfilter/WordsFilter.java
@@ -1,11 +1,10 @@
package me.driftay.chatfilter;
-import org.bukkit.ChatColor;
-import org.bukkit.configuration.file.FileConfiguration;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.AsyncPlayerChatEvent;
+import cn.nukkit.utils.Config;
+import cn.nukkit.Player;
+import cn.nukkit.event.EventHandler;
+import cn.nukkit.event.Listener;
+import cn.nukkit.event.player.PlayerChatEvent;
import java.util.Iterator;
@@ -18,17 +17,17 @@ public WordsFilter(Main main) {
@EventHandler
- public void onChat(AsyncPlayerChatEvent e) {
+ public void onChat(PlayerChatEvent e) {
Player p = e.getPlayer();
String message = e.getMessage();
- FileConfiguration config = this.main.getConfig();
+ Config config = this.main.getConfig();
boolean sendWarning = false;
- boolean bypassPerm = p.hasPermission(config.getString("ChatFilter.bypass-permission"));
+ boolean bypassPerm = p.hasPermission(config.getString("chatfilter.bypass-permission"));
- char star = config.getString("Replace-Symbol").charAt(0);
- Iterator stuff = config.getStringList("Muted-Words").iterator();
+ char star = config.getString("replace-symbol").charAt(0);
+ Iterator stuff = config.getStringList("muted-words").iterator();
while (stuff.hasNext()) {
String str = stuff.next();
if (message.toLowerCase().contains(str.toLowerCase()) && !bypassPerm) {
@@ -40,7 +39,7 @@ public void onChat(AsyncPlayerChatEvent e) {
}
if (sendWarning)
- p.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("ChatFilter.Warning-Message")));
+ p.sendMessage(config.getString("chatFilter.warning-message").replace("&", "§"));
e.setMessage(message);
}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 797a5e6..a776363 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -1,35 +1,15 @@
-#######################################################################################
-#######################################################################################
-#######################################################################################
-##### #####
-##### ChatFilter+ 2.0 #####
-##### Created By Driftay #####
-##### #####
-#######################################################################################
-#######################################################################################
-#######################################################################################
-
-
-#<---------------------->NOTES<---------------------->#
-#All Color Codes Can Be Used!
-#Refer to: https://wiki.ess3.net/mc/
-#<---------------------->NOTES<---------------------->#
-
-ChatFilter:
- reloaded: '&f[&bChat&cFilter&f] &2Configuration has been successfully reloaded!'
- no-perms: '&f[&bChat&cFilter&f] &cYou are not permitted to use &c/chatfilter'
- wrong-argument: '&f[&bChat&cFilter&f] &2Command Not Found! Try &c/chatfilter reload&2!'
+chatfilter:
bypass-permission: 'chatfilter.bypass'
- Warning-Message: '&d&lYOUR SERVER HERE &8» &bWe''ve noticed you''re using &6Profane Language &ba lot. Please keep it to a minimum.'
+ warning-message: '&d&lYOUR SERVER HERE &8» &bWe''ve noticed you''re using &6Profane Language &ba lot. Please keep it to a minimum.'
#Example: Hello will be replaced with ****
-Replace-Symbol: '*'
+replace-symbol: '*'
# You can continue this list as long as you want just copy my examples above
# NOTE: I do find these words HIGHLY OFFENSIVE and Recommend you keep them
-Muted-Words:
+muted-words:
- 'nigger'
- 'beaner'
- 'n1gger'
@@ -41,15 +21,3 @@ Muted-Words:
- 'whore'
- 'ass'
- 'asshole'
-
-
-#######################################################################################
-#######################################################################################
-#######################################################################################
-##### #####
-##### ChatFilter+ 2.0 #####
-##### Created By Driftay #####
-##### #####
-#######################################################################################
-#######################################################################################
-#######################################################################################
\ No newline at end of file
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 1b24463..4243bb1 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -2,7 +2,4 @@ main: me.driftay.chatfilter.Main
name: ChatFilter
author: Driftay
version: ${project.version}
-description: The Best Plugin For Managing Offensive Words
-commands:
- chatfilter:
- description: Reload the Config.
\ No newline at end of file
+description: The Best Plugin For Managing Offensive Words
\ No newline at end of file
diff --git a/target/ChatFilter.jar b/target/ChatFilter.jar
new file mode 100644
index 0000000000000000000000000000000000000000..ee98b65e77bbe9090c0ff3de9ba62306fe229e29
GIT binary patch
literal 4823
zcma)92UHVj7mYzeFG8dTlr9je6e&vyAiXyQlp-axgixf4phS8NvPcmWqzFh8P(e_X
z-lU62#~{5!Q1MT6mEBeTvoB{dbI!bb=gs%MdGB2VZKC7k0D_qZT{iu8@z)<2{;aEJ
zq72p4Qx`G#%Z(IZhIf-osH1Sl-wwkc;J>@+D(h*gs~MXJ>#A?+c6R7!LxtZ^X+s6N
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C|AVM);YYI{ZBN!kEpMtw-q
zWVfC4IJTQ_#Y__2#=$O{gp+b}7;cF1
z)RRu+M11wPW05_(1#fj3Idijj4?M{M9)0S}a8_XLOat&PZo6ThxJ!{vKzwQHR
zc2Z{Z~H(AdHexrc4q-h%~&tCwM>)94_~Qs$L@
zB|hhfvl}hj>8a@j~Pb&@Y8&i_R)TG9Lw7;`t%D}})#=vtsL6qU&u}fzzaucZM;{*4!WcJU^{pTVGx|28@q$NhO
zR_fca-64PO`LseQrz14sLL9WC;GDqrRfEW!EdUw1e>qTOil-Fy#dMPGganhk_*JBR
zl*4;DV{F+KHf&9G@an-nm)$cQP}zwb)S4OIqr;Nr9+&j0SaD{O8ByM5XG5KuTV1FO
zksrUs3g5wu59yg&Na
zy(Xwb6#fwX&smB@A&?FzZ@7b(v9ErYHdISUQ`b{K%7pXJl5hz7y&@(!
z6D&8BFf9Ir{Y@VqGW=Rl2%`175gy!(zx*a)kB*ceV!s;!fW=?p0f&2K=4(9uWP@5_Mt@kH`~95@pO-{?TlH@cq8s{9w!tz5Ac|{%Ssl3-$Z@a7e30edN3TEldLKVYM*O
SCI%50sPVrSgb(N2+W!wV#aZ3}
literal 0
HcmV?d00001
diff --git a/target/classes/config.yml b/target/classes/config.yml
new file mode 100644
index 0000000..a776363
--- /dev/null
+++ b/target/classes/config.yml
@@ -0,0 +1,23 @@
+chatfilter:
+ bypass-permission: 'chatfilter.bypass'
+ warning-message: '&d&lYOUR SERVER HERE &8» &bWe''ve noticed you''re using &6Profane Language &ba lot. Please keep it to a minimum.'
+
+
+#Example: Hello will be replaced with ****
+replace-symbol: '*'
+
+
+# You can continue this list as long as you want just copy my examples above
+# NOTE: I do find these words HIGHLY OFFENSIVE and Recommend you keep them
+muted-words:
+- 'nigger'
+- 'beaner'
+- 'n1gger'
+- 'nibba'
+- 'fuck'
+- 'bitch'
+- 'cunt'
+- 'slut'
+- 'whore'
+- 'ass'
+- 'asshole'
diff --git a/target/classes/me/driftay/chatfilter/Main.class b/target/classes/me/driftay/chatfilter/Main.class
new file mode 100644
index 0000000000000000000000000000000000000000..eb291b7c33cac4c022069bbe3711b5ea9be3fa6a
GIT binary patch
literal 962
zcmaJ=ZEq4m5Pp`@9-LR8*rN6oYSja^=W9*Gm?&*OU5yC_Vs;
z&iiD0%ZGwt>6KJ6dd;w4*E=S1$Qv*%T!Y21elDC|DEkrr>U0M@>PtTop>x8eV#s?U
zas$s3Aw$isyZ_0Ox-@erFqB&qRbLBbhD3r=;);l>=7>aM=Xb^-itA}afx}}>IZfPV|hI}LrMW4rh)CyEzdfK{S
zVG~ZHCgM*2`xl!XyRvge#svvpW-MhJXv7rhz*I
z;e4z=24QcQLS|wQ_cW(A!;bCF_t)GI6eb$DZ{UH2huCM>o|HPT0)|2;JUJwCk48d8
zLxux;icq019alRj5jLkRGtnq7G1LlrG*(4dD)BBpKNaBzO*E1323_uVcqp}gahZ(<
zlCo`H)eS=~Q0cfZnC&1AyMhp*ka^whzMcfsh{z0$KS(k?_aq(C9NHP}i;eGK-xBj9
zlG?20W0F?tfG2oL8lxX{`M8H{Vrw+UFv`ng6qCbRdbmN#`WV|kvG<9h-zBv^$xxvp
afIKY|W%^DPETfLXRK~`?jL*q4gM+_FGVkO7
literal 0
HcmV?d00001
diff --git a/target/classes/me/driftay/chatfilter/WordsFilter.class b/target/classes/me/driftay/chatfilter/WordsFilter.class
new file mode 100644
index 0000000000000000000000000000000000000000..aa92358ad95a6c2324f67aa7bef13a52536dbce5
GIT binary patch
literal 2404
zcma)8YjYD-7=BJ}o2J`R11T-HawBgD3`&Vp@>aBE{P_*|bZO-LSi%RJ`96
z$1jdE!Z$xCGcx0hqlQ5p$MK_o$rrEuy6YPSHYHPq_CDY01>U40fqsD)ohNn2(H3;y
zyPfN_Ya8YQy$3L;V2g^a*e0;$-iZC9^OjjQ7U;O@=(=lEoUFf=i(&_JZ*!BGU#V%1
zldkD@)o>icGGo|@T?%%q*n_{F0bk-`Xz+YWt~
zw4O!HIo*OHkXSG9Ton5SdTqT{(TaN7S*gxjl^8O}Dmb9xAw0ZFICnutn6-U`RSG31
zQu!zj3UpWNu3kznOMS?^$5cFq#|3&=8h=~CaJXaddNBO_Bq>?xmFvbhataQqcoLLn
zug6GhSs-dqi<)cMB$WkfFHbb>jPNv$D0oIi9!CY@Yh45sGBl-MCMfEEPVP9a;#r(v
zTBc`~x@#B1zco}+1}9ZKCw15DS_NxaxAU5#OZ%jXDV!p{qGh^Nzay}3Hn+xuuhh;)8yddxGtUx$MF|M1?qNmv(&nq>xz)c^})>T$e5g2GI+iw_BAiAlu^h3$}HJ%i?3+1g6
zJHm#7Vd_)$>b!2xX!8|X;svXyRc1BYkn^T7uEWODCoFE9$!l_`6I6X9gFTY8K=!ovn^5{&7u$^W$1OWfeydU*26r!`keL4$)J>1
z%&1Gk0nRayKKV8fG+f*
z##z7bjf=23<32Ac$%6xzYm6y=VEh=@ZjLt4Gs$7&)X2|J8rVD@3XX;M4~F8~8yITf
z!LbOx=`a**AU&pV@<;=Z-o_IGhRKf{7S1wQ4kz-Jr-xcVP|6=$vh
literal 0
HcmV?d00001
diff --git a/target/classes/plugin.yml b/target/classes/plugin.yml
new file mode 100644
index 0000000..1e64fa6
--- /dev/null
+++ b/target/classes/plugin.yml
@@ -0,0 +1,5 @@
+main: me.driftay.chatfilter.Main
+name: ChatFilter
+author: Driftay
+version: 2.0-SNAPSHOT
+description: The Best Plugin For Managing Offensive Words
\ No newline at end of file
diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties
new file mode 100644
index 0000000..82dcb3b
--- /dev/null
+++ b/target/maven-archiver/pom.properties
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Mon Oct 31 15:34:45 EET 2022
+groupId=groupId
+artifactId=ChatFilter
+version=2.0-SNAPSHOT
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
new file mode 100644
index 0000000..4d19d82
--- /dev/null
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -0,0 +1,2 @@
+me\driftay\chatfilter\WordsFilter.class
+me\driftay\chatfilter\Main.class
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
new file mode 100644
index 0000000..add485a
--- /dev/null
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -0,0 +1,2 @@
+C:\Users\mefrr\Desktop\ChatFilter-master\src\main\java\me\driftay\chatfilter\WordsFilter.java
+C:\Users\mefrr\Desktop\ChatFilter-master\src\main\java\me\driftay\chatfilter\Main.java