mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
remove YAML addon from main repo
This commit is contained in:
parent
c3487f95ec
commit
f4fa8c861e
@ -1,3 +0,0 @@
|
|||||||
# language-yaml
|
|
||||||
|
|
||||||
Allows `*.yml` files to be loaded as Terra configurations.
|
|
@ -1,3 +0,0 @@
|
|||||||
dependencies {
|
|
||||||
"shadedImplementation"("com.dfsek.tectonic:yaml:2.1.2")
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.yaml;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.yaml.YamlConfiguration;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.Platform;
|
|
||||||
import com.dfsek.terra.api.addon.TerraAddon;
|
|
||||||
import com.dfsek.terra.api.addon.annotations.Addon;
|
|
||||||
import com.dfsek.terra.api.addon.annotations.Author;
|
|
||||||
import com.dfsek.terra.api.addon.annotations.Version;
|
|
||||||
import com.dfsek.terra.api.event.events.config.ConfigurationDiscoveryEvent;
|
|
||||||
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
|
||||||
import com.dfsek.terra.api.inject.annotations.Inject;
|
|
||||||
|
|
||||||
|
|
||||||
@Addon("language-yaml")
|
|
||||||
@Version("1.0.0")
|
|
||||||
@Author("Terra")
|
|
||||||
public class YamlAddon extends TerraAddon {
|
|
||||||
@Inject
|
|
||||||
private Platform platform;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize() {
|
|
||||||
platform.getEventManager()
|
|
||||||
.getHandler(FunctionalEventHandler.class)
|
|
||||||
.register(this, ConfigurationDiscoveryEvent.class)
|
|
||||||
.then(event -> event.getLoader().open("", ".yml").thenEntries(entries -> entries.forEach(entry -> {
|
|
||||||
platform.getDebugLogger().info("Discovered config " + entry.getKey());
|
|
||||||
event.register(entry.getKey(), new YamlConfiguration(entry.getValue(), entry.getKey()));
|
|
||||||
})))
|
|
||||||
.failThrough();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user