generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ot/mcemote/client/font/impl/FFZEmote.java → ...ot/mcemote/client/providers/FFZEmote.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/client/java/net/vinrobot/mcemote/client/providers/FFZGlobalEmoteProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package net.vinrobot.mcemote.client.providers; | ||
|
||
import net.vinrobot.mcemote.api.FrankerFaceZService; | ||
import net.vinrobot.mcemote.api.ffz.GlobalEmoteSets; | ||
import net.vinrobot.mcemote.config.Configuration; | ||
|
||
import java.util.Arrays; | ||
|
||
public class FFZGlobalEmoteProvider implements IEmoteProvider { | ||
@Override | ||
public int priority() { | ||
return 10; | ||
} | ||
|
||
@Override | ||
public void registerEmotes(final Configuration config, final IEmoteRegistry registry) throws Exception { | ||
final FrankerFaceZService service = new FrankerFaceZService(); | ||
|
||
final GlobalEmoteSets emoteSets = service.fetchGlobalEmoteSet(); | ||
|
||
Arrays.stream(emoteSets.default_sets()) | ||
.mapToObj(Integer::toString) | ||
.map(emoteSets.sets()::get) | ||
.flatMap((emoteSet) -> emoteSet.emoticons().stream()) | ||
.map(FFZEmote::new) | ||
.forEach(registry::registerEmote); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/client/java/net/vinrobot/mcemote/client/providers/STVGlobalEmoteProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...cemote/client/font/impl/SevenTVEmote.java → ...cemote/client/providers/SevenTVEmote.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/client/resources/META-INF/services/net.vinrobot.mcemote.client.providers.IEmoteProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
net.vinrobot.mcemote.client.providers.STVGlobalEmoteProvider | ||
net.vinrobot.mcemote.client.providers.STVUserEmoteProvider | ||
net.vinrobot.mcemote.client.providers.FFZGlobalEmoteProvider | ||
net.vinrobot.mcemote.client.providers.FFZRoomEmoteProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/main/java/net/vinrobot/mcemote/api/ffz/GlobalEmoteSets.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package net.vinrobot.mcemote.api.ffz; | ||
|
||
import java.util.Map; | ||
|
||
public record GlobalEmoteSets( | ||
int[] default_sets, | ||
Map<String, EmoteSet> sets | ||
) { | ||
} |