mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
create ConfigurationLoadEvent
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.dfsek.terra.api.event.events.config;
|
||||
|
||||
import com.dfsek.tectonic.config.Configuration;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.config.Loader;
|
||||
import com.dfsek.terra.api.event.events.PackEvent;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class ConfigurationLoadEvent implements PackEvent {
|
||||
private final ConfigPack pack;
|
||||
private final Loader loader;
|
||||
|
||||
private final Consumer<Configuration> consumer;
|
||||
|
||||
public ConfigurationLoadEvent(ConfigPack pack, Loader loader, Consumer<Configuration> consumer) {
|
||||
this.pack = pack;
|
||||
this.loader = loader;
|
||||
this.consumer = consumer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigPack getPack() {
|
||||
return pack;
|
||||
}
|
||||
|
||||
public Loader getLoader() {
|
||||
return loader;
|
||||
}
|
||||
|
||||
public void register(Configuration config) {
|
||||
consumer.accept(config);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user