Skip to content

Commit 2757a51

Browse files
committed
Reload messages configs on /sponge plugins reload or /dtp reloadconfig
Add a check so now we only check the vanilla's main channel, not others
1 parent 6c84234 commit 2757a51

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ repositories {
1818

1919
spongestart {
2020
minecraft '1.12.2'
21+
spongeVanilla '1.12.2-7.1.0-BETA-9'
2122
}
2223

2324
dependencies {

src/main/java/me/morpheus/dtpunishment/DTPunishment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public void onServerInit(GameInitializationEvent event) {
9999
public void onReload(GameReloadEvent e) {
100100
this.mainConfig.load();
101101
this.chatConfig.load();
102+
this.messages.load();
102103
}
103104

104105
public static DTPunishment getInstance() {

src/main/java/me/morpheus/dtpunishment/listeners/PlayerListener.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ public void onPlayerChat(MessageChannelEvent.Chat event, @Root Player player) {
9191
String message = event.getRawMessage().toPlain();
9292
UUID uuid = player.getUniqueId();
9393
int mutePointsIncurred = 0;
94+
if (!event.getChannel().isPresent() || !event.getChannel().get().getClass().getName().startsWith("org.spongepowered.api.text.channel.MessageChannel"))
95+
return;
9496

9597
if (dataStore.isMuted(uuid)) {
9698
Instant expiration = dataStore.getExpiration(uuid);

0 commit comments

Comments
 (0)