Skip to content

Commit

Permalink
feat(tsl): add Twitch Subscription Gift event
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoodie committed Oct 24, 2019
1 parent 6cabf65 commit 500eee4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.daemon=false

mod_id=twitchspawn
mod_group=net.programmer.igoodie
mod_version=1.4.4
mod_version=1.4.5

minecraft_version=1.14.4
forge_version=28.0.83
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public void handleEvent(EventArguments args) {
}

// Queue incoming event arguments
getQueue(args.streamerNickname).queue(() -> eventNode.process(args));
getQueue(args.streamerNickname).queue(() ->
TwitchSpawn.SERVER.execute(() -> eventNode.process(args)));
TwitchSpawn.LOGGER.info("Queued handler for {} event.", eventKeyword);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ protected void notifyPlayer(ServerPlayerEntity player, String title, String subt
SPlaySoundPacket packetSound = new SPlaySoundPacket(soundLocation, category, player.getPositionVec(), volume, pitch);
player.connection.sendPacket(packetSound);

System.out.printf("messageDisplay=%s\n", ConfigManager.PREFERENCES.messageDisplay);

if (ConfigManager.PREFERENCES.messageDisplay == PreferencesConfig.MessageDisplay.DISABLED)
return; // Stop here since message displaying is disabled

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public enum TSLEventKeyword {
new TSLEventPair("subscriber", "twitch"),
new TSLEventPair("resub", "twitch")
),
TWITCH_SUBSCRIPTION_GIFT(
"Twitch Subscription Gift",
new TSLEventPair("subMysteryGift", "twitch")
),
TWITCH_HOST(
"Twitch Host",
new TSLEventPair("host", "twitch")
Expand Down
26 changes: 26 additions & 0 deletions src/main/resources/assets/twitchspawn/default/titles.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,32 @@
"color": "gold"
}
],
"twitch subscription gift": [
{
"text": "${actor}",
"color": "aqua"
},
{
"text": " gifted",
"color": "white"
},
{
"text": " ${amount_i}",
"color": "gold"
},
{
"text": " x ",
"color": "white"
},
{
"text": "Tier ${tier}",
"color": "gold"
},
{
"text": " subs!",
"color": "white"
}
],
"twitch host": [
{
"text": "${actor}",
Expand Down

0 comments on commit 500eee4

Please sign in to comment.