Skip to content

Commit

Permalink
tiny changes
Browse files Browse the repository at this point in the history
  • Loading branch information
juliand665 committed Oct 17, 2021
1 parent e03065b commit 0d23fb7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/dynamicfps/FlawlessFrames.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import java.util.function.Function;

/**
<p>
Implements the FREX Flawless Frames API to allow other mods to request all frames to be processed until requested to
go back to normal operation, such as ReplayMod rendering a video.<p>
go back to normal operation, such as ReplayMod rendering a video.
<p>
See https://github.com/grondag/frex/pull/9
*/
public class FlawlessFrames {
private static final Set<Object> ACTIVE = ConcurrentHashMap.newKeySet();

@SuppressWarnings("unchecked") // Since we ask for Consumer.class, it's unchecked to pass a Consumer<Boolean> to it. But it's guaranteed to ask it by API
static void onClientInitialization() {
Function<String, Consumer<Boolean>> provider = name -> {
Object token = new Object();
Expand All @@ -28,6 +28,7 @@ static void onClientInitialization() {
}
};
};
//noinspection unchecked – Since we can't parameterize Consumer.class, it's unchecked to pass a Consumer<Boolean> as a raw Consumer. The API guarantees we only get what we expect though.
FabricLoader.getInstance()
.getEntrypoints("frex_flawless_frames", Consumer.class)
.forEach(api -> api.accept(provider));
Expand Down

0 comments on commit 0d23fb7

Please sign in to comment.