mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-04 14:56:28 +00:00
remove unneeded RegistrationEvent
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
package com.dfsek.terra.api.event.events.config;
|
||||
|
||||
import com.dfsek.tectonic.loading.TypeLoader;
|
||||
import com.dfsek.tectonic.loading.object.ObjectTemplate;
|
||||
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.config.ConfigType;
|
||||
import com.dfsek.terra.api.event.events.PackEvent;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
||||
public class RegistrationEvent implements PackEvent {
|
||||
private final ConfigPack pack;
|
||||
|
||||
public RegistrationEvent(ConfigPack pack) {
|
||||
this.pack = pack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigPack getPack() {
|
||||
return pack;
|
||||
}
|
||||
|
||||
public RegistrationEvent registerConfigType(ConfigType<?, ?> type, String id, int priority) {
|
||||
pack.registerConfigType(type, id, priority);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <T> RegistrationEvent applyLoader(Type type, Supplier<ObjectTemplate<T>> loader) {
|
||||
pack.applyLoader(type, loader);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <T> RegistrationEvent applyLoader(Type type, TypeLoader<T> loader) {
|
||||
pack.applyLoader(type, loader);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,6 @@ import com.dfsek.terra.api.config.Loader;
|
||||
import com.dfsek.terra.api.config.meta.Meta;
|
||||
import com.dfsek.terra.api.event.events.config.ConfigurationDiscoveryEvent;
|
||||
import com.dfsek.terra.api.event.events.config.ConfigurationLoadEvent;
|
||||
import com.dfsek.terra.api.event.events.config.RegistrationEvent;
|
||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPostLoadEvent;
|
||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
||||
import com.dfsek.terra.api.event.events.config.type.ConfigTypePostLoadEvent;
|
||||
@@ -162,8 +161,6 @@ public class ConfigPackImpl implements ConfigPack {
|
||||
register(abstractConfigLoader);
|
||||
platform.register(abstractConfigLoader);
|
||||
|
||||
platform.getEventManager().callEvent(new RegistrationEvent(this));
|
||||
|
||||
ConfigPackAddonsTemplate addonsTemplate = new ConfigPackAddonsTemplate();
|
||||
selfLoader.load(addonsTemplate, packManifest);
|
||||
this.addons = addonsTemplate.getAddons();
|
||||
|
||||
Reference in New Issue
Block a user