Skip to content

Commit 729ddb8

Browse files
committed
1.2.12
2 parents 33dd04a + 210e7f1 commit 729ddb8

File tree

163 files changed

+1466
-948
lines changed

Some content is hidden

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

163 files changed

+1466
-948
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@ hs_err_pid*
2727

2828
# Custom files
2929
build/
30+
core/build/
31+
bukkit/build/
3032
.idea/
3133
.gradle/

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LICENSE
33
* DiscordSRVUtils
44
* -------------
5-
* Copyright (C) 2020 - 2022 BlueTree242
5+
* Copyright (C) 2020 - 2023 BlueTree242
66
* -------------
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as

bukkit/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LICENSE
33
* DiscordSRVUtils
44
* -------------
5-
* Copyright (C) 2020 - 2022 BlueTree242
5+
* Copyright (C) 2020 - 2023 BlueTree242
66
* -------------
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as
@@ -56,9 +56,11 @@ dependencies {
5656
compileOnly urlFile("https://github.com/Zrips/CMI-API/releases/download/8.7.8.2/CMIAPI8.7.8.2.jar", "CMI-API")
5757
compileOnly 'net.lapismc:AFKPlus:3.3.15'
5858
implementation project(":core")
59-
compileOnly('com.discordsrv:discordsrv:1.26.0')
59+
implementation('org.slf4j:slf4j-api:2.0.1')
60+
compileOnly("com.discordsrv:discordsrv:${rootProject.discordsrv_version}")
6061
implementation 'org.jooq:jooq:3.14.16'
6162
compileOnly 'net.essentialsx:EssentialsX:2.19.0'
63+
implementation "org.json:json:${rootProject.org_json_version}"
6264
}
6365

6466

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LICENSE
33
* DiscordSRVUtils
44
* -------------
5-
* Copyright (C) 2020 - 2022 BlueTree242
5+
* Copyright (C) 2020 - 2023 BlueTree242
66
* -------------
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as
@@ -157,8 +157,7 @@ private List<Map<String, String>> getDSUFiles() throws Exception {
157157
files.add(fileMap("leveling.yml", Utils.readFile(core.getPlatform().getDataFolder() + core.fileseparator + "leveling.yml")));
158158
files.add(fileMap("status.yml", Utils.readFile(core.getPlatform().getDataFolder() + core.fileseparator + "status.yml")));
159159
files.add(fileMap("suggestions.yml", Utils.readFile(core.getPlatform().getDataFolder() + core.fileseparator + "suggestions.yml")));
160-
files.add(fileMap("leveling-roles.json", Utils.readFile(core.getPlatform().getDataFolder() + core.fileseparator + "leveling-roles.json")));
161-
files.add(fileMap("leveling-roles.json", Utils.readFile(core.getPlatform().getDataFolder() + core.fileseparator + "leveling-roles.json")));
160+
files.add(fileMap("leveling-rewards.json", Utils.readFile(core.getPlatform().getDataFolder() + core.fileseparator + "leveling-rewards.json")));
162161
return files;
163162
}
164163

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LICENSE
33
* DiscordSRVUtils
44
* -------------
5-
* Copyright (C) 2020 - 2022 BlueTree242
5+
* Copyright (C) 2020 - 2023 BlueTree242
66
* -------------
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LICENSE
33
* DiscordSRVUtils
44
* -------------
5-
* Copyright (C) 2020 - 2022 BlueTree242
5+
* Copyright (C) 2020 - 2023 BlueTree242
66
* -------------
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LICENSE
33
* DiscordSRVUtils
44
* -------------
5-
* Copyright (C) 2020 - 2022 BlueTree242
5+
* Copyright (C) 2020 - 2023 BlueTree242
66
* -------------
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LICENSE
33
* DiscordSRVUtils
44
* -------------
5-
* Copyright (C) 2020 - 2022 BlueTree242
5+
* Copyright (C) 2020 - 2023 BlueTree242
66
* -------------
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as
@@ -43,10 +43,12 @@ public class BukkitPlatformServer extends PlatformServer {
4343
private final DiscordSRVUtils core;
4444
@Getter
4545
private final Debugger debugger;
46+
private final DiscordSRVUtilsBukkit bcore;
4647

47-
public BukkitPlatformServer(DiscordSRVUtils core) {
48+
public BukkitPlatformServer(DiscordSRVUtils core, DiscordSRVUtilsBukkit bcore) {
4849
this.core = core;
4950
debugger = new BukkitDebugger(core);
51+
this.bcore = bcore;
5052
}
5153

5254
@Override
@@ -96,5 +98,23 @@ public PlatformPlayer getOfflinePlayer(UUID uuid) {
9698
return new BukkitOfflinePlayer(Bukkit.getOfflinePlayer(uuid), core);
9799
}
98100

101+
@Override
102+
public PlatformPlayer getPlayer(UUID uuid) {
103+
Player player = Bukkit.getPlayer(uuid);
104+
if (player == null) return null;
105+
return new BukkitPlayer(core, player);
106+
}
107+
108+
@Override
109+
public void executeConsoleCommands(String... cmds) {
110+
Runnable runnable = () -> {
111+
for (String cmd : cmds) {
112+
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd);
113+
}
114+
};
115+
if (Bukkit.isPrimaryThread()) runnable.run();
116+
else Bukkit.getScheduler().runTask(bcore, runnable);
117+
}
118+
99119

100120
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LICENSE
33
* DiscordSRVUtils
44
* -------------
5-
* Copyright (C) 2020 - 2022 BlueTree242
5+
* Copyright (C) 2020 - 2023 BlueTree242
66
* -------------
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LICENSE
33
* DiscordSRVUtils
44
* -------------
5-
* Copyright (C) 2020 - 2022 BlueTree242
5+
* Copyright (C) 2020 - 2023 BlueTree242
66
* -------------
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as
@@ -92,7 +92,7 @@ public File getDataFolder() {
9292

9393
@Override
9494
public PlatformServer getServer() {
95-
return new BukkitPlatformServer(core);
95+
return new BukkitPlatformServer(core, main);
9696
}
9797

9898
@Override

0 commit comments

Comments
 (0)