From d672d8217e81f7e32e438f9fcef6c874f1cd03bc Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Tue, 10 Mar 2020 09:26:04 +0100 Subject: [PATCH] project: Merge upstream --- discord/discord.gradle.kts | 2 +- .../client/plugins/discord/DiscordGameEventType.java | 12 ++++++++++++ .../client/plugins/discord/DiscordState.java | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/discord/discord.gradle.kts b/discord/discord.gradle.kts index 54325e9272..0dec9dca39 100644 --- a/discord/discord.gradle.kts +++ b/discord/discord.gradle.kts @@ -25,7 +25,7 @@ import ProjectVersions.rlVersion * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -version = "0.0.5" +version = "0.0.6" project.extra["PluginName"] = "Discord" project.extra["PluginDescription"] = "Show your status and activity in the Discord user panel" diff --git a/discord/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java b/discord/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java index 981b83b154..b1b32b2f0d 100644 --- a/discord/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java +++ b/discord/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java @@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableMap; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; @@ -286,15 +287,26 @@ enum DiscordGameEventType FROM_VARBITS = fromVarbitsBuilder.build(); } + @Nullable private String imageKey; + + @Nullable private String state; + + @Nullable private String details; + private int priority; private boolean shouldClear; private boolean shouldTimeout; + @Nullable private DiscordAreaType discordAreaType; + + @Nullable private Varbits varbits; + + @Nullable private int[] regionIds; DiscordGameEventType(Skill skill) diff --git a/discord/src/main/java/net/runelite/client/plugins/discord/DiscordState.java b/discord/src/main/java/net/runelite/client/plugins/discord/DiscordState.java index d69eca663c..68212f65fe 100644 --- a/discord/src/main/java/net/runelite/client/plugins/discord/DiscordState.java +++ b/discord/src/main/java/net/runelite/client/plugins/discord/DiscordState.java @@ -212,7 +212,8 @@ void checkForTimeout() events.removeIf(event -> event.getType().isShouldTimeout() && now.isAfter(event.getUpdated().plus(actionTimeout))); - if (eventWithTime.getType().getState().equals(DiscordGameEventType.IN_MENU.getState()) && now.isAfter(eventWithTime.getStart().plus(actionTimeout))) + assert DiscordGameEventType.IN_MENU.getState() != null; + if (DiscordGameEventType.IN_MENU.getState().equals(eventWithTime.getType().getState()) && now.isAfter(eventWithTime.getStart().plus(actionTimeout))) { final DiscordPresence presence = lastPresence .toBuilder()