mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-23 00:29:51 +00:00
clean up unneeded injects
This commit is contained in:
@@ -11,30 +11,20 @@ import com.dfsek.terra.addons.manifest.api.MonadAddonInitializer;
|
||||
import com.dfsek.terra.addons.manifest.api.monad.Do;
|
||||
import com.dfsek.terra.addons.manifest.api.monad.Get;
|
||||
import com.dfsek.terra.addons.manifest.api.monad.Init;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.addon.BaseAddon;
|
||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
||||
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
||||
import com.dfsek.terra.api.inject.annotations.Inject;
|
||||
import com.dfsek.terra.api.util.function.monad.Monad;
|
||||
|
||||
|
||||
public class StructureAddon implements MonadAddonInitializer {
|
||||
@Inject
|
||||
private Platform platform;
|
||||
|
||||
@Inject
|
||||
private BaseAddon addon;
|
||||
|
||||
@Override
|
||||
public Monad<?, Init<?>> initialize() {
|
||||
return Do.with(
|
||||
Get.eventManager().map(eventManager -> eventManager.getHandler(FunctionalEventHandler.class)),
|
||||
Get.addon(),
|
||||
Get.platform(),
|
||||
((handler, base, platform) -> Init.ofPure(
|
||||
handler.register(addon, ConfigPackPreLoadEvent.class)
|
||||
.then(event -> event.getPack().registerConfigType(new StructureConfigType(), addon.key("STRUCTURE"), 2))
|
||||
((handler, base) -> Init.ofPure(
|
||||
handler.register(base, ConfigPackPreLoadEvent.class)
|
||||
.then(event -> event.getPack().registerConfigType(new StructureConfigType(), base.key("STRUCTURE"), 2))
|
||||
.failThrough()))
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user