aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhackthetime <l4bg0jb7@duck.com>2023-10-05 13:29:44 +0200
committerhackthetime <l4bg0jb7@duck.com>2023-10-05 13:29:44 +0200
commit563839b24b09bd4fa28fbb2fabe79712c5024a56 (patch)
tree4d7632fb1abf74a847c63302650a51caba6d923d
parent354abd2073e2b4f0d4be274fcb9639702dd292c2 (diff)
downloadBBsentials-563839b24b09bd4fa28fbb2fabe79712c5024a56.tar.gz
BBsentials-563839b24b09bd4fa28fbb2fabe79712c5024a56.tar.bz2
BBsentials-563839b24b09bd4fa28fbb2fabe79712c5024a56.zip
fixed mining events all events not working
-rw-r--r--src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java68
1 files changed, 35 insertions, 33 deletions
diff --git a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
index acaed15..bb0ad28 100644
--- a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
+++ b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
@@ -361,35 +361,37 @@ public class BBsentialConnection {
if (!config.toDisplayConfig.getValue("disableAll")) {
//its will returns false cause disabled is checked already before.
if (config.toDisplayConfig.blockChEvents && packet.island.equals(Islands.CRYSTAL_HOLLOWS)) return;
- if (packet.event.equals(MiningEvents.RAFFLE)) {
- if (!config.toDisplayConfig.raffle) return;
- }
- else if (packet.event.equals(MiningEvents.GOBLIN_RAID)) {
- if (!config.toDisplayConfig.goblinRaid) return;
- }
- else if (packet.event.equals(MiningEvents.MITHRIL_GOURMAND)) {
- if (!config.toDisplayConfig.mithrilGourmand) return;
- }
- else if (packet.event.equals(MiningEvents.BETTER_TOGETHER)) {
- if (config.toDisplayConfig.betterTogether.equals("none")) return;
- if (config.toDisplayConfig.betterTogether.equals(Islands.DWARVEN_MINES.getDisplayName()) && packet.island.equals(Islands.CRYSTAL_HOLLOWS))
- return;
- if (config.toDisplayConfig.betterTogether.equals(Islands.CRYSTAL_HOLLOWS.getDisplayName()) && packet.island.equals(Islands.DWARVEN_MINES))
- return;
- }
- else if (packet.event.equals(MiningEvents.DOUBLE_POWDER)) {
- if (config.toDisplayConfig.doublePowder.equals("none")) return;
- if (config.toDisplayConfig.doublePowder.equals(Islands.DWARVEN_MINES.getDisplayName()) && packet.island.equals(Islands.CRYSTAL_HOLLOWS))
- return;
- if (config.toDisplayConfig.doublePowder.equals(Islands.CRYSTAL_HOLLOWS.getDisplayName()) && packet.island.equals(Islands.DWARVEN_MINES))
- return;
- }
- else if (packet.event.equals(MiningEvents.GONE_WITH_THE_WIND)) {
- if (config.toDisplayConfig.goneWithTheWind.equals("none")) return;
- if (config.toDisplayConfig.goneWithTheWind.equals(Islands.DWARVEN_MINES.getDisplayName()) && packet.island.equals(Islands.CRYSTAL_HOLLOWS))
- return;
- if (config.toDisplayConfig.goneWithTheWind.equals(Islands.CRYSTAL_HOLLOWS.getDisplayName()) && packet.island.equals(Islands.DWARVEN_MINES))
- return;
+ if (!(config.toDisplayConfig.allEvents)) {
+ if (packet.event.equals(MiningEvents.RAFFLE)) {
+ if (!config.toDisplayConfig.raffle) return;
+ }
+ else if (packet.event.equals(MiningEvents.GOBLIN_RAID)) {
+ if (!config.toDisplayConfig.goblinRaid) return;
+ }
+ else if (packet.event.equals(MiningEvents.MITHRIL_GOURMAND)) {
+ if (!config.toDisplayConfig.mithrilGourmand) return;
+ }
+ else if (packet.event.equals(MiningEvents.BETTER_TOGETHER)) {
+ if (config.toDisplayConfig.betterTogether.equals("none")) return;
+ if (config.toDisplayConfig.betterTogether.equals(Islands.DWARVEN_MINES.getDisplayName()) && packet.island.equals(Islands.CRYSTAL_HOLLOWS))
+ return;
+ if (config.toDisplayConfig.betterTogether.equals(Islands.CRYSTAL_HOLLOWS.getDisplayName()) && packet.island.equals(Islands.DWARVEN_MINES))
+ return;
+ }
+ else if (packet.event.equals(MiningEvents.DOUBLE_POWDER)) {
+ if (config.toDisplayConfig.doublePowder.equals("none")) return;
+ if (config.toDisplayConfig.doublePowder.equals(Islands.DWARVEN_MINES.getDisplayName()) && packet.island.equals(Islands.CRYSTAL_HOLLOWS))
+ return;
+ if (config.toDisplayConfig.doublePowder.equals(Islands.CRYSTAL_HOLLOWS.getDisplayName()) && packet.island.equals(Islands.DWARVEN_MINES))
+ return;
+ }
+ else if (packet.event.equals(MiningEvents.GONE_WITH_THE_WIND)) {
+ if (config.toDisplayConfig.goneWithTheWind.equals("none")) return;
+ if (config.toDisplayConfig.goneWithTheWind.equals(Islands.DWARVEN_MINES.getDisplayName()) && packet.island.equals(Islands.CRYSTAL_HOLLOWS))
+ return;
+ if (config.toDisplayConfig.goneWithTheWind.equals(Islands.CRYSTAL_HOLLOWS.getDisplayName()) && packet.island.equals(Islands.DWARVEN_MINES))
+ return;
+ }
}
Chat.sendPrivateMessageToSelfImportantInfo(packet.username + "There is a " + packet.event.getDisplayName() + "in the " + packet.island.getDisplayName() + " now/soon.");
}
@@ -521,10 +523,6 @@ public class BBsentialConnection {
return false;
}
- public interface MessageReceivedCallback {
- void onMessageReceived(String message);
- }
-
public boolean isConnected() {
try {
socket.isConnected();
@@ -557,4 +555,8 @@ public class BBsentialConnection {
return false;
}
}
+
+ public interface MessageReceivedCallback {
+ void onMessageReceived(String message);
+ }
} \ No newline at end of file