mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 02:20:57 +00:00
Better handling of internal addon
This commit is contained in:
@@ -53,13 +53,6 @@ public class NMSPlatform extends PlatformImpl {
|
||||
public NMSPlatform(TerraBukkitPlugin plugin) {
|
||||
super(plugin);
|
||||
|
||||
// TODO: Check if there is a better way to handle InternalAddon
|
||||
this.getEventManager().getHandler(FunctionalEventHandler.class)
|
||||
.register(new InternalAddon(), PlatformInitializationEvent.class)
|
||||
.priority(1)
|
||||
.then(event -> AwfulBukkitHacks.registerBiomes(this.getRawConfigRegistry()))
|
||||
.global();
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(new NMSInjectListener(), plugin);
|
||||
}
|
||||
|
||||
@@ -95,6 +88,19 @@ public class NMSPlatform extends PlatformImpl {
|
||||
.registerLoader(VillagerType.class, VillagerTypeTemplate::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InternalAddon load() {
|
||||
InternalAddon internalAddon = super.load();
|
||||
|
||||
this.getEventManager().getHandler(FunctionalEventHandler.class)
|
||||
.register(internalAddon, PlatformInitializationEvent.class)
|
||||
.priority(1)
|
||||
.then(event -> AwfulBukkitHacks.registerBiomes(this.getRawConfigRegistry()))
|
||||
.global();
|
||||
|
||||
return internalAddon;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterable<BaseAddon> platformAddon() {
|
||||
return List.of(new NMSAddon(this));
|
||||
|
||||
Reference in New Issue
Block a user