Fixed 122 errors - by fixing the pom

Also other fixes
This commit is contained in:
Norbi Peti 2018-11-22 23:11:19 +01:00
parent d12fe961c0
commit 9527be99d1
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
3 changed files with 20 additions and 3 deletions

18
pom.xml
View file

@ -106,6 +106,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<branch>master</branch> <!-- Should be master if building ButtonCore locally -->
</properties>
<repositories>
@ -173,7 +174,7 @@
<dependency>
<groupId>com.github.TBMCPlugins.ButtonCore</groupId>
<artifactId>ButtonCore</artifactId>
<version>${env.TRAVIS_BRANCH}-SNAPSHOT</version>
<version>${branch}-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -225,4 +226,19 @@
<version>4.0.0</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>ci</id>
<activation>
<property>
<name>env.TRAVIS_BRANCH</name>
</property>
</activation>
<properties>
<!-- Override only if necessary -->
<branch>${env.TRAVIS_BRANCH}</branch>
</properties>
</profile>
</profiles>
</project>

View file

@ -51,6 +51,7 @@ public abstract class DiscordSenderBase implements CommandSender {
public void sendMessage(String message) {
try {
final boolean broadcast = new Exception().getStackTrace()[2].getMethodName().contains("broadcast");
//if (broadcast && DiscordPlugin.hooked) - TODO: What should happen if unhooked
if (broadcast)
return;
final String sendmsg = DPUtils.sanitizeString(message);

View file

@ -39,8 +39,8 @@ import sx.blah.discord.util.MissingPermissionsException;
import javax.annotation.Nullable;
import java.awt.*;
import java.time.Instant;
import java.util.*;
import java.util.List;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;
@ -81,7 +81,7 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
time = se.getValue();
final String authorPlayer = "[" + DPUtils.sanitizeStringNoEscape(e.getChannel().DisplayName) + "] " //
+ ("Minecraft".equals(e.getOrigin()) ? "" : "[" + e.getOrigin() + "]") //
+ ("Minecraft".equals(e.getOrigin()) ? "" : "[" + e.getOrigin().substring(0, 1) + "]") //
+ (DPUtils.sanitizeStringNoEscape(e.getSender() instanceof Player //
? ((Player) e.getSender()).getDisplayName() //
: e.getSender().getName()));