Use own event distribution system instead abusing fabric's one

This commit is contained in:
Jonas Herzig
2019-05-20 10:06:10 +02:00
parent 7cbf7f7c94
commit 0e086d91a6
22 changed files with 75 additions and 101 deletions

View File

@@ -95,12 +95,7 @@ public class PlayerOverview extends EventRegistrations implements Extra {
}
});
ReplayOpenedCallback.EVENT.register(this::onReplayOpen);
ReplayClosedCallback.EVENT.register(this::onReplayClose);
//#if MC>=11400
//#else
//$$ FORGE_BUS.register(this);
//#endif
register();
}
public boolean isHidden(UUID uuid) {
@@ -115,6 +110,7 @@ public class PlayerOverview extends EventRegistrations implements Extra {
}
}
{ on(ReplayOpenedCallback.EVENT, this::onReplayOpen); }
private void onReplayOpen(ReplayHandler replayHandler) throws IOException {
Optional<Set<UUID>> savedData = replayHandler.getReplayFile().getInvisiblePlayers();
if (savedData.isPresent()) {
@@ -125,6 +121,7 @@ public class PlayerOverview extends EventRegistrations implements Extra {
}
}
{ on(ReplayClosedCallback.EVENT, this::onReplayClose); }
private void onReplayClose(ReplayHandler replayHandler) {
hiddenPlayers.clear();
}