Skip to content

Commit 544552e

Browse files
committed
Merged develop for release 1.2.9
2 parents dbbf762 + 9c1825f commit 544552e

File tree

172 files changed

+5248
-4695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+5248
-4695
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@ DiscordSRVUtils is a plugin that adds more features to the DiscordSRV bot
1111
Put these into your pom.xml
1212

1313
```xml
14-
<repository>
15-
<id>jitpack.io</id>
16-
<url>https://jitpack.io</url>
17-
</repository>
14+
15+
<repository>
16+
<id>jitpack.io</id>
17+
<url>https://jitpack.io</url>
18+
</repository>
1819
```
1920

2021
```xml
21-
<dependency>
22-
<groupId>com.github.BlueTree242</groupId>
23-
<artifactId>DiscordSRVUtils</artifactId>
24-
<version>VERSION</version>
25-
</dependency>
22+
23+
<dependency>
24+
<groupId>com.github.BlueTree242</groupId>
25+
<artifactId>DiscordSRVUtils</artifactId>
26+
<version>VERSION</version>
27+
</dependency>
2628
```
2729

2830
For gradle

build.gradle

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/*
2-
* LICENSE
3-
* DiscordSRVUtils
4-
* -------------
5-
* Copyright (C) 2020 - 2021 BlueTree242
6-
* -------------
7-
* This program is free software: you can redistribute it and/or modify
8-
* it under the terms of the GNU General Public License as
9-
* published by the Free Software Foundation, either version 3 of the
10-
* License, or (at your option) any later version.
2+
* LICENSE
3+
* DiscordSRVUtils
4+
* -------------
5+
* Copyright (C) 2020 - 2022 BlueTree242
6+
* -------------
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
1111
*
12-
* This program is distributed in the hope that it will be useful,
13-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
* GNU General Public License for more details.
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
1616
*
17-
* You should have received a copy of the GNU General Public
18-
* License along with this program. If not, see
19-
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20-
* END
17+
* You should have received a copy of the GNU General Public
18+
* License along with this program. If not, see
19+
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20+
* END
2121
*/
2222
import org.apache.tools.ant.filters.ReplaceTokens
2323

@@ -27,11 +27,11 @@ plugins {
2727
id 'com.github.johnrengelman.shadow' version '6.1.0'
2828
}
2929
compileJava.options.encoding 'UTF-8'
30+
build.finalizedBy shadowJar
3031
allprojects {
3132
repositories {
3233
mavenLocal()
3334
mavenCentral()
34-
jcenter()
3535
maven {
3636
url = uri('https://repo.citizensnpcs.co')
3737
}
@@ -98,6 +98,9 @@ allprojects {
9898
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
9999
}
100100
}
101+
dependencies {
102+
implementation project(":bukkit")
103+
}
101104
def buildNumber = project.properties['buildNumber'] == null ? "NONE" : project.properties['buildNumber']
102105
System.out.println("Build Number is " + buildNumber)
103106
def commit = project.properties['commit'] == null ? "NONE" : project.properties['commit']
@@ -125,9 +128,6 @@ subprojects {
125128
shadowJar {
126129
classifier ''
127130
}
128-
dependencies {
129-
implementation project(":bukkit")
130-
}
131131
publishing {
132132
publications {
133133
maven(MavenPublication) {
@@ -143,3 +143,5 @@ allprojects {
143143

144144

145145

146+
147+

bukkit/build.gradle

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* LICENSE
3+
* DiscordSRVUtils
4+
* -------------
5+
* Copyright (C) 2020 - 2022 BlueTree242
6+
* -------------
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public
18+
* License along with this program. If not, see
19+
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20+
* END
21+
*/
22+
123
plugins {
224
id 'java'
325
id 'maven-publish'
@@ -35,9 +57,7 @@ dependencies {
3557
compileOnly urlFile("https://github.com/Zrips/CMI-API/releases/download/8.7.8.2/CMIAPI8.7.8.2.jar", "CMI-API")
3658
compileOnly 'net.lapismc:AFKPlus:3.3.13'
3759
implementation project(":core")
38-
compileOnly('com.discordsrv:discordsrv:1.24.0') {
39-
exclude group: 'net.kyori'
40-
}
60+
compileOnly('com.discordsrv:discordsrv:1.25.0')
4161
compileOnly 'net.ess3:EssentialsX:2.17.2'
4262
}
4363

bukkit/src/main/java/tk/bluetree242/discordsrvutils/bukkit/BukkitDebugger.java

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* LICENSE
3+
* DiscordSRVUtils
4+
* -------------
5+
* Copyright (C) 2020 - 2022 BlueTree242
6+
* -------------
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public
18+
* License along with this program. If not, see
19+
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20+
* END
21+
*/
22+
123
package tk.bluetree242.discordsrvutils.bukkit;
224

325
import github.scarsz.discordsrv.DiscordSRV;
@@ -9,7 +31,6 @@
931
import github.scarsz.discordsrv.dependencies.commons.lang3.exception.ExceptionUtils;
1032
import github.scarsz.discordsrv.dependencies.jda.api.entities.Role;
1133
import github.scarsz.discordsrv.dependencies.okhttp3.*;
12-
import github.scarsz.discordsrv.hooks.PluginHook;
1334
import github.scarsz.discordsrv.hooks.SkriptHook;
1435
import github.scarsz.discordsrv.hooks.VaultHook;
1536
import github.scarsz.discordsrv.util.DiscordUtil;
@@ -20,6 +41,7 @@
2041
import org.json.JSONArray;
2142
import org.json.JSONObject;
2243
import tk.bluetree242.discordsrvutils.DiscordSRVUtils;
44+
import tk.bluetree242.discordsrvutils.hooks.PluginHook;
2345
import tk.bluetree242.discordsrvutils.platform.Debugger;
2446
import tk.bluetree242.discordsrvutils.utils.Utils;
2547

@@ -55,6 +77,7 @@ public String run(String stacktrace) throws Exception {
5577
Map<String, String> information = new HashMap<>();
5678
information.put("DSU Version", core.getPlatform().getDescription().getVersion());
5779
information.put("DSU Command Executor", Bukkit.getServer().getPluginCommand("discordsrvutils").getPlugin() + "");
80+
information.put("DSU Hooked Plugins", core.getPluginHookManager().getHooks().stream().filter(PluginHook::isHooked).map(Object::toString).collect(Collectors.joining(", ")));
5881
information.put("DiscordSRV Version", DiscordSRV.getPlugin() + "");
5982
information.put("DiscordSRV Config Version", DiscordSRV.config().getString("ConfigVersion"));
6083
information.put("DSU Status", core.isEnabled() ? "Enabled" : "Disabled");
@@ -69,12 +92,11 @@ public String run(String stacktrace) throws Exception {
6992
information.put("/discord command executor", (Bukkit.getServer().getPluginCommand("discord") != null ? Bukkit.getServer().getPluginCommand("discord").getPlugin() + "" : ""));
7093
information.put("threads",
7194
"\n channel topic updater -> alive: " + (DiscordSRV.getPlugin().getChannelTopicUpdater() != null && DiscordSRV.getPlugin().getChannelTopicUpdater().isAlive()) +
72-
"\n console message queue worker -> alive: " + (DiscordSRV.getPlugin().getConsoleMessageQueueWorker() != null && DiscordSRV.getPlugin().getConsoleMessageQueueWorker().isAlive()) +
7395
"\n server watchdog -> alive: " + (DiscordSRV.getPlugin().getServerWatchdog() != null && DiscordSRV.getPlugin().getServerWatchdog().isAlive()) +
7496
"\n nickname updater -> alive: " + (DiscordSRV.getPlugin().getNicknameUpdater() != null && DiscordSRV.getPlugin().getNicknameUpdater().isAlive())
7597
);
7698
information.put("ExecutorService Status", core.getAsyncManager().getPool() == null ? "null" : (core.getAsyncManager().getPool().isShutdown() ? "Shutdown" : "Q:" + core.getAsyncManager().getPool().getQueue().size() + ", R:" + core.getAsyncManager().getPool().getActiveCount() + ", AV:" + core.getAsyncManager().getPool().getPoolSize()));
77-
information.put("DiscordSRV Hooked Plugins", DiscordSRV.getPlugin().getPluginHooks().stream().map(PluginHook::getPlugin).filter(Objects::nonNull).map(Object::toString).collect(Collectors.joining(", ")));
99+
information.put("DiscordSRV Hooked Plugins", DiscordSRV.getPlugin().getPluginHooks().stream().map(github.scarsz.discordsrv.hooks.PluginHook::getPlugin).filter(Objects::nonNull).map(Object::toString).collect(Collectors.joining(", ")));
78100
information.put("Scripts", String.join(", ", SkriptHook.getSkripts()));
79101
data.put(new JSONObject().put("type", "key_value").put("name", "Information").put("data", MapToKeyValue(information)));
80102
Map<String, String> versionConfig = new HashMap<>();
@@ -275,7 +297,7 @@ private String getRegisteredListeners() {
275297
private String getRelevantLinesFromServerLog() {
276298
List<String> output = new LinkedList<>();
277299
try {
278-
FileReader fr = new FileReader(new File("logs/latest.log"));
300+
FileReader fr = new FileReader("logs/latest.log");
279301
BufferedReader br = new BufferedReader(fr);
280302
boolean done = false;
281303
while (!done) {
@@ -303,7 +325,7 @@ public byte[] encrypt(byte[] key, String data) {
303325
}
304326
}
305327

306-
public byte[] encrypt(byte[] key, byte[] data) throws Exception {
328+
public byte[] encrypt(byte[] key, byte[] data) {
307329
try {
308330
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
309331
byte[] iv = new byte[cipher.getBlockSize()];

bukkit/src/main/java/tk/bluetree242/discordsrvutils/bukkit/BukkitDiscordSRV.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/*
2-
* LICENSE
3-
* DiscordSRVUtils
4-
* -------------
5-
* Copyright (C) 2020 - 2021 BlueTree242
6-
* -------------
7-
* This program is free software: you can redistribute it and/or modify
8-
* it under the terms of the GNU General Public License as
9-
* published by the Free Software Foundation, either version 3 of the
10-
* License, or (at your option) any later version.
2+
* LICENSE
3+
* DiscordSRVUtils
4+
* -------------
5+
* Copyright (C) 2020 - 2022 BlueTree242
6+
* -------------
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
1111
*
12-
* This program is distributed in the hope that it will be useful,
13-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
* GNU General Public License for more details.
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
1616
*
17-
* You should have received a copy of the GNU General Public
18-
* License along with this program. If not, see
19-
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20-
* END
17+
* You should have received a copy of the GNU General Public
18+
* License along with this program. If not, see
19+
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20+
* END
2121
*/
2222

2323
package tk.bluetree242.discordsrvutils.bukkit;

bukkit/src/main/java/tk/bluetree242/discordsrvutils/bukkit/BukkitListener.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/*
2-
* LICENSE
3-
* DiscordSRVUtils
4-
* -------------
5-
* Copyright (C) 2020 - 2021 BlueTree242
6-
* -------------
7-
* This program is free software: you can redistribute it and/or modify
8-
* it under the terms of the GNU General Public License as
9-
* published by the Free Software Foundation, either version 3 of the
10-
* License, or (at your option) any later version.
2+
* LICENSE
3+
* DiscordSRVUtils
4+
* -------------
5+
* Copyright (C) 2020 - 2022 BlueTree242
6+
* -------------
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
1111
*
12-
* This program is distributed in the hope that it will be useful,
13-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
* GNU General Public License for more details.
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
1616
*
17-
* You should have received a copy of the GNU General Public
18-
* License along with this program. If not, see
19-
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20-
* END
17+
* You should have received a copy of the GNU General Public
18+
* License along with this program. If not, see
19+
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20+
* END
2121
*/
2222

2323
package tk.bluetree242.discordsrvutils.bukkit;

bukkit/src/main/java/tk/bluetree242/discordsrvutils/bukkit/BukkitOfflinePlayer.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* LICENSE
3+
* DiscordSRVUtils
4+
* -------------
5+
* Copyright (C) 2020 - 2022 BlueTree242
6+
* -------------
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public
18+
* License along with this program. If not, see
19+
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20+
* END
21+
*/
22+
123
package tk.bluetree242.discordsrvutils.bukkit;
224

325
import lombok.Getter;

bukkit/src/main/java/tk/bluetree242/discordsrvutils/bukkit/BukkitPlatformServer.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/*
2-
* LICENSE
3-
* DiscordSRVUtils
4-
* -------------
5-
* Copyright (C) 2020 - 2021 BlueTree242
6-
* -------------
7-
* This program is free software: you can redistribute it and/or modify
8-
* it under the terms of the GNU General Public License as
9-
* published by the Free Software Foundation, either version 3 of the
10-
* License, or (at your option) any later version.
2+
* LICENSE
3+
* DiscordSRVUtils
4+
* -------------
5+
* Copyright (C) 2020 - 2022 BlueTree242
6+
* -------------
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
1111
*
12-
* This program is distributed in the hope that it will be useful,
13-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
* GNU General Public License for more details.
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
1616
*
17-
* You should have received a copy of the GNU General Public
18-
* License along with this program. If not, see
19-
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20-
* END
17+
* You should have received a copy of the GNU General Public
18+
* License along with this program. If not, see
19+
* <http://www.gnu.org/licenses/gpl-3.0.html>.
20+
* END
2121
*/
2222

2323
package tk.bluetree242.discordsrvutils.bukkit;

0 commit comments

Comments
 (0)