Skip to content

Commit 96c8539

Browse files
committed
Some fixes :P
1 parent e36cdfc commit 96c8539

File tree

19 files changed

+448
-232
lines changed

19 files changed

+448
-232
lines changed

abstraction/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@
4141
<id>jitpack.io</id>
4242
<url>https://jitpack.io</url>
4343
</repository>
44-
<repository>
45-
<id>pinodev-repo-releases</id>
46-
<name>Pineta</name>
47-
<url>https://repo.pinodev.it/releases</url>
48-
</repository>
4944
<repository>
5045
<id>spigotmc-repo</id>
5146
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>

abstraction/src/main/java/com/loohp/multichatdiscordsrvaddon/config/Config.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ public record Hook(
418418
CASE SENSITIVE! Must be shown as above.
419419
""") String selected,
420420
@Comment("\nWhether to only use channels system if supported in the chat plugin.") boolean useChannels,
421-
@Comment("\nIf your chat plugin supports \"channels\", you can blacklist certain channels here.") List<String> ignoredChannels,
422-
@Comment("\nPriority to use for events: LOWEST, LOW, NORMAL, HIGH, HIGHEST, MONITOR") String priority,
421+
@Comment("\nIf your chat plugin supports \"channels\", you can blacklist certain channels here (CASE SENSITIVE).\nNOTE: ZelChat has two types of channels (as of this time): \"STAFF\" and \"EVERYONE\"") List<String> ignoredChannels,
422+
@Comment("\nPriority to use for events: LOWEST, LOW, NORMAL, HIGH, HIGHEST, MONITOR\nNOTE: ZelChat does not support the MONITOR priority.") String priority,
423423
@Comment("\n") DynmapHook dynmap
424424
) {}
425425

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
package com.loohp.multichatdiscordsrvaddon.integration;
2+
3+
import lombok.Getter;
4+
import org.bukkit.Bukkit;
5+
import org.bukkit.Server;
6+
import org.bukkit.command.CommandSender;
7+
import org.bukkit.entity.Player;
8+
import org.bukkit.permissions.Permission;
9+
import org.bukkit.permissions.PermissionAttachment;
10+
import org.bukkit.permissions.PermissionAttachmentInfo;
11+
import org.bukkit.plugin.Plugin;
12+
import org.jetbrains.annotations.NotNull;
13+
import org.jetbrains.annotations.Nullable;
14+
15+
import java.util.Set;
16+
import java.util.UUID;
17+
18+
@Getter
19+
public class DynmapSender implements CommandSender {
20+
21+
private Player offlinePlayer;
22+
23+
public DynmapSender(@NotNull String name) {
24+
if (!name.isEmpty()) {
25+
Player player = Bukkit.getPlayerExact(name);
26+
if (player != null) this.offlinePlayer = player;
27+
}
28+
}
29+
30+
@Override
31+
public void sendMessage(@NotNull String s) {
32+
33+
}
34+
35+
@Override
36+
public void sendMessage(@NotNull String... strings) {
37+
38+
}
39+
40+
@Override
41+
public void sendMessage(@Nullable UUID uuid, @NotNull String s) {
42+
43+
}
44+
45+
@Override
46+
public void sendMessage(@Nullable UUID uuid, @NotNull String... strings) {
47+
48+
}
49+
50+
@Override
51+
public @NotNull Server getServer() {
52+
return Bukkit.getServer();
53+
}
54+
55+
@Override
56+
public @NotNull String getName() {
57+
return offlinePlayer == null ? "" : offlinePlayer.getName();
58+
}
59+
60+
@Override
61+
public @NotNull Spigot spigot() {
62+
return null;
63+
}
64+
65+
@Override
66+
public boolean isPermissionSet(@NotNull String s) {
67+
return false;
68+
}
69+
70+
@Override
71+
public boolean isPermissionSet(@NotNull Permission permission) {
72+
return false;
73+
}
74+
75+
@Override
76+
public boolean hasPermission(@NotNull String s) {
77+
return false;
78+
}
79+
80+
@Override
81+
public boolean hasPermission(@NotNull Permission permission) {
82+
return false;
83+
}
84+
85+
@Override
86+
public @NotNull PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String s, boolean b) {
87+
return null;
88+
}
89+
90+
@Override
91+
public @NotNull PermissionAttachment addAttachment(@NotNull Plugin plugin) {
92+
return null;
93+
}
94+
95+
@Override
96+
public @Nullable PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String s, boolean b, int i) {
97+
return null;
98+
}
99+
100+
@Override
101+
public @Nullable PermissionAttachment addAttachment(@NotNull Plugin plugin, int i) {
102+
return null;
103+
}
104+
105+
@Override
106+
public void removeAttachment(@NotNull PermissionAttachment permissionAttachment) {
107+
108+
}
109+
110+
@Override
111+
public void recalculatePermissions() {
112+
113+
}
114+
115+
@Override
116+
public @NotNull Set<PermissionAttachmentInfo> getEffectivePermissions() {
117+
return Set.of();
118+
}
119+
120+
@Override
121+
public boolean isOp() {
122+
return false;
123+
}
124+
125+
@Override
126+
public void setOp(boolean b) {
127+
128+
}
129+
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.loohp.multichatdiscordsrvaddon.integration;
22

3+
import org.bukkit.plugin.java.JavaPlugin;
4+
35
public interface MultiChatIntegration {
46

57
String getPluginName();
68

79
boolean shouldEnable();
810

9-
void enable();
11+
void enable(JavaPlugin plugin);
1012

1113
}

common/pom.xml

Lines changed: 59 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -104,63 +104,63 @@
104104
<relocations>
105105
<relocation>
106106
<pattern>okhttp3</pattern>
107-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.okhttp3</shadedPattern>
107+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.okhttp3</shadedPattern>
108108
</relocation>
109109
<relocation>
110110
<pattern>com.madgag.gif</pattern>
111-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.com.madgag.gif</shadedPattern>
111+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.com.madgag.gif</shadedPattern>
112112
</relocation>
113113
<relocation>
114114
<pattern>com.loohp.blockmodelrenderer</pattern>
115-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.com.loohp.blockmodelrenderer</shadedPattern>
115+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.com.loohp.blockmodelrenderer</shadedPattern>
116116
</relocation>
117117
<relocation>
118118
<pattern>me.lucko.jarrelocator</pattern>
119-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.me.lucko.jarrelocator</shadedPattern>
119+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.me.lucko.jarrelocator</shadedPattern>
120120
</relocation>
121121
<relocation>
122122
<pattern>com.ibm.icu</pattern>
123-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.com.ibm.icu</shadedPattern>
123+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.com.ibm.icu</shadedPattern>
124124
</relocation>
125125
<relocation>
126126
<pattern>darwin.</pattern>
127-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.darwin.</shadedPattern>
127+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.darwin.</shadedPattern>
128128
</relocation>
129129
<relocation>
130130
<pattern>kotlin.</pattern>
131-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.kotlin.</shadedPattern>
131+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.kotlin.</shadedPattern>
132132
</relocation>
133133
<relocation>
134134
<pattern>linux.</pattern>
135-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.linux.</shadedPattern>
135+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.linux.</shadedPattern>
136136
</relocation>
137137
<relocation>
138138
<pattern>win32.</pattern>
139-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.win32.</shadedPattern>
139+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.win32.</shadedPattern>
140140
</relocation>
141141
<relocation>
142142
<pattern>net.jpountz</pattern>
143-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.net.jpountz</shadedPattern>
143+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.net.jpountz</shadedPattern>
144144
</relocation>
145145
<relocation>
146146
<pattern>org.checkerframework</pattern>
147-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.org.checkerframework</shadedPattern>
147+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.org.checkerframework</shadedPattern>
148148
</relocation>
149149
<relocation>
150150
<pattern>org.eclipse</pattern>
151-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.org.eclipse</shadedPattern>
151+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.org.eclipse</shadedPattern>
152152
</relocation>
153153
<relocation>
154154
<pattern>org.mapdb</pattern>
155-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.org.mapdb</shadedPattern>
155+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.org.mapdb</shadedPattern>
156156
</relocation>
157157
<relocation>
158158
<pattern>com.intellij</pattern>
159-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.com.intellij</shadedPattern>
159+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.com.intellij</shadedPattern>
160160
</relocation>
161161
<relocation>
162162
<pattern>org.objectweb</pattern>
163-
<shadedPattern>com.loohp.MultiChatDiscordSrvAddon.libs.org.objectweb</shadedPattern>
163+
<shadedPattern>com.loohp.multichatdiscordsrvaddon.libs.org.objectweb</shadedPattern>
164164
</relocation>
165165
</relocations>
166166
</configuration>
@@ -292,10 +292,6 @@
292292
<id>dmulloy2-repo</id>
293293
<url>https://repo.dmulloy2.net/repository/public/</url>
294294
</repository>
295-
<repository>
296-
<id>MikeRepo</id>
297-
<url>https://repo.mikeprimm.com/</url>
298-
</repository>
299295
<repository>
300296
<id>Scarsz-Nexus</id>
301297
<url>https://nexus.scarsz.me/content/groups/public/</url>
@@ -333,11 +329,6 @@
333329
<id>papermc-repo</id>
334330
<url>https://repo.papermc.io/repository/maven-public/</url>
335331
</repository>
336-
<repository>
337-
<id>pinodev-repo-releases</id>
338-
<name>Pineta</name>
339-
<url>https://repo.pinodev.it/releases</url>
340-
</repository>
341332
</repositories>
342333

343334
<dependencies>
@@ -418,21 +409,17 @@
418409
<version>4.0.8</version>
419410
<scope>provided</scope>
420411
</dependency>
421-
<dependency>
422-
<groupId>it.pino.zelchat</groupId>
423-
<artifactId>api</artifactId>
424-
<version>2.0.0</version>
425-
<scope>provided</scope>
426-
</dependency>
427412
<dependency>
428413
<groupId>net.kyori</groupId>
429414
<artifactId>adventure-text-serializer-json</artifactId>
430415
<version>4.18.0</version>
416+
<scope>provided</scope>
431417
</dependency>
432418
<dependency>
433419
<groupId>net.kyori</groupId>
434420
<artifactId>adventure-text-serializer-gson</artifactId>
435421
<version>4.18.0</version>
422+
<scope>provided</scope>
436423
</dependency>
437424
<dependency>
438425
<groupId>com.loohp</groupId>
@@ -512,6 +499,25 @@
512499
<version>${project.version}</version>
513500
<scope>compile</scope>
514501
</dependency>
502+
<dependency>
503+
<groupId>com.loohp</groupId>
504+
<artifactId>MultiChatDiscordSrvAddon-ChatControlIntegration</artifactId>
505+
<version>${project.version}</version>
506+
<scope>compile</scope>
507+
</dependency>
508+
<dependency>
509+
<groupId>com.loohp</groupId>
510+
<artifactId>MultiChatDiscordSrvAddon-ChatControlRedIntegration</artifactId>
511+
<version>${project.version}</version>
512+
<scope>compile</scope>
513+
</dependency>
514+
<dependency>
515+
<groupId>com.loohp</groupId>
516+
<artifactId>MultiChatDiscordSrvAddon-ZelChatIntegration</artifactId>
517+
<version>${project.version}</version>
518+
<scope>compile</scope>
519+
</dependency>
520+
515521
<dependency>
516522
<groupId>org.projectlombok</groupId>
517523
<artifactId>lombok</artifactId>
@@ -528,6 +534,7 @@
528534
<groupId>org.apache.commons</groupId>
529535
<artifactId>commons-compress</artifactId>
530536
<version>1.27.1</version>
537+
<scope>provided</scope>
531538
</dependency>
532539
<dependency>
533540
<groupId>com.mojang</groupId>
@@ -542,21 +549,6 @@
542549
<scope>provided</scope>
543550
</dependency>
544551

545-
<dependency>
546-
<groupId>org.minecademy</groupId>
547-
<artifactId>chatcontrol</artifactId>
548-
<version>11.1.7</version>
549-
<scope>system</scope>
550-
<systemPath>${project.build.directory}/../../lib/ChatControl.jar</systemPath>
551-
</dependency>
552-
<dependency>
553-
<groupId>org.minecademy</groupId>
554-
<artifactId>chatcontrolred</artifactId>
555-
<version>10.28.4</version>
556-
<scope>system</scope>
557-
<systemPath>${project.build.directory}/../../lib/ChatControl-Red.jar</systemPath>
558-
</dependency>
559-
560552
<dependency>
561553
<groupId>mineverse.aust1n46</groupId>
562554
<artifactId>venturechat</artifactId>
@@ -568,6 +560,28 @@
568560
<groupId>com.github.Carleslc.Simple-YAML</groupId>
569561
<artifactId>Simple-Yaml</artifactId>
570562
<version>1.8.4</version>
563+
<scope>provided</scope>
564+
</dependency>
565+
566+
<dependency>
567+
<groupId>org.spigotmc</groupId>
568+
<artifactId>spigot-api</artifactId>
569+
<version>1.20-R0.1-SNAPSHOT</version>
570+
<scope>provided</scope>
571+
</dependency>
572+
573+
<dependency>
574+
<groupId>com.googlecode.json-simple</groupId>
575+
<artifactId>json-simple</artifactId>
576+
<version>1.1.1</version>
577+
<scope>provided</scope>
578+
</dependency>
579+
580+
<dependency>
581+
<groupId>it.unimi.dsi</groupId>
582+
<artifactId>fastutil</artifactId>
583+
<version>8.5.15</version>
584+
<scope>provided</scope>
571585
</dependency>
572586
</dependencies>
573587
</project>

common/src/main/java/com/loohp/multichatdiscordsrvaddon/MultiChatDiscordSrvAddon.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ public void onLoad() {
183183
@Override
184184
public void onEnable() {
185185
plugin = this;
186+
186187
ChatUtils.init(this);
187188
VersionManager.init();
188189
discordsrv = DiscordSRV.getPlugin();

common/src/main/java/com/loohp/multichatdiscordsrvaddon/integration/IntegrationManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public void load(String selected) {
1616
MultiChatIntegration integration = (MultiChatIntegration) clazz.getDeclaredConstructor().newInstance();
1717
if (integration.shouldEnable()) {
1818
ChatUtils.sendMessage("<grey>Detected " + integration.getPluginName() + ", enabling integration...");
19-
integration.enable();
19+
integration.enable(plugin);
2020
} else {
2121
ChatUtils.sendMessage("<red>Integration of name " + selected + " could not be enabled! Do you have the corresponding plugin installed?");
2222
Bukkit.getPluginManager().disablePlugin(plugin);

0 commit comments

Comments
 (0)