mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
functional events in FeatureAddon
This commit is contained in:
parent
3f42b9ab3e
commit
36ce88af0a
@ -5,23 +5,20 @@ import com.dfsek.terra.api.addon.TerraAddon;
|
|||||||
import com.dfsek.terra.api.addon.annotations.Addon;
|
import com.dfsek.terra.api.addon.annotations.Addon;
|
||||||
import com.dfsek.terra.api.addon.annotations.Author;
|
import com.dfsek.terra.api.addon.annotations.Author;
|
||||||
import com.dfsek.terra.api.addon.annotations.Version;
|
import com.dfsek.terra.api.addon.annotations.Version;
|
||||||
import com.dfsek.terra.api.event.EventListener;
|
|
||||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
||||||
import com.dfsek.terra.api.injection.annotations.Inject;
|
import com.dfsek.terra.api.injection.annotations.Inject;
|
||||||
|
|
||||||
@Addon("config-feature")
|
@Addon("config-feature")
|
||||||
@Version("1.0.0")
|
@Version("1.0.0")
|
||||||
@Author("Terra")
|
@Author("Terra")
|
||||||
public class FeatureAddon extends TerraAddon implements EventListener {
|
public class FeatureAddon extends TerraAddon {
|
||||||
@Inject
|
@Inject
|
||||||
private TerraPlugin main;
|
private TerraPlugin main;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
main.getEventManager().registerListener(this, this);
|
main.getEventManager()
|
||||||
}
|
.register(ConfigPackPreLoadEvent.class)
|
||||||
|
.then(event -> event.getPack().registerConfigType(new FeatureConfigType(), "FEATURE", 2));
|
||||||
public void onPackLoad(ConfigPackPreLoadEvent event) {
|
|
||||||
event.getPack().registerConfigType(new FeatureConfigType(), "FEATURE", 2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user