chore: Inject ConfigManager into SmoothChunks

This commit is contained in:
TopchetoEU 2022-09-21 10:11:06 +03:00
parent abcc10ff35
commit 5dc6372222
No known key found for this signature in database
GPG Key ID: 0F2543CA49C81E3A

View File

@ -1,5 +1,7 @@
package me.topchetoeu.smoothchunks; package me.topchetoeu.smoothchunks;
import java.io.File;
import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi; import com.terraformersmc.modmenu.api.ModMenuApi;
@ -38,9 +40,16 @@ public final class SmoothChunks implements ClientModInitializer, ModMenuApi {
public final Event<RegisterEvent<Animation>> ANIMATIONS_REGISTERING = Manager.createEvent(); public final Event<RegisterEvent<Animation>> ANIMATIONS_REGISTERING = Manager.createEvent();
private ProgressManager progress; private ProgressManager progress;
private ConfigManager config;
private Manager<Ease> ease; private Manager<Ease> ease;
private Manager<Animation> animation; private Manager<Animation> animation;
/**
* Gets the config manager
*/
public ConfigManager getConfigManager() {
return config;
}
/** /**
* Gets the chunk progress manager * Gets the chunk progress manager
*/ */
@ -125,6 +134,8 @@ public final class SmoothChunks implements ClientModInitializer, ModMenuApi {
registerEases(ease); registerEases(ease);
registerAnimations(animation); registerAnimations(animation);
config = new ConfigManager(new File("config/smooth-chunks.dat"), animation, ease);
EASES_REGISTERING.invoker().register(ease); EASES_REGISTERING.invoker().register(ease);
ANIMATIONS_REGISTERING.invoker().register(animation); ANIMATIONS_REGISTERING.invoker().register(animation);