mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 08:25:31 +00:00
functional events in FloraAddon
This commit is contained in:
parent
36ce88af0a
commit
502d2b5814
@ -7,25 +7,23 @@ 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;
|
||||||
import com.dfsek.terra.api.registry.exception.DuplicateEntryException;
|
|
||||||
|
|
||||||
@Addon("config-flora")
|
@Addon("config-flora")
|
||||||
@Author("Terra")
|
@Author("Terra")
|
||||||
@Version("0.1.0")
|
@Version("0.1.0")
|
||||||
public class FloraAddon extends TerraAddon implements EventListener {
|
public class FloraAddon 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 -> {
|
||||||
public void onPackLoad(ConfigPackPreLoadEvent event) throws DuplicateEntryException {
|
event.getPack().registerConfigType(new FloraConfigType(), "FLORA", 2);
|
||||||
event.getPack().registerConfigType(new FloraConfigType(), "FLORA", 2);
|
event.getPack().applyLoader(BlockLayer.class, BlockLayerTemplate::new);
|
||||||
event.getPack().applyLoader(BlockLayer.class, BlockLayerTemplate::new);
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user