mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-17 10:03:15 +00:00
Merge remote-tracking branch 'origin/master' into dev/7.0-2
This commit is contained in:
commit
b9187248c3
@ -151,7 +151,7 @@ public abstract class AbstractPlatform implements Platform {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
protected void load() {
|
||||
protected InternalAddon load() {
|
||||
if(LOADED.get()) {
|
||||
throw new IllegalStateException(
|
||||
"Someone tried to initialize Terra, but Terra has already initialized. This is most likely due to a broken platform " +
|
||||
@ -200,6 +200,8 @@ public abstract class AbstractPlatform implements Platform {
|
||||
|
||||
logger.info("Terra addons successfully loaded.");
|
||||
logger.info("Finished initialization.");
|
||||
|
||||
return internalAddon;
|
||||
}
|
||||
|
||||
protected boolean loadConfigPacks() {
|
||||
|
@ -2,6 +2,8 @@ package com.dfsek.terra.bukkit.nms.v1_21_7;
|
||||
|
||||
import com.dfsek.tectonic.api.TypeRegistry;
|
||||
import com.dfsek.tectonic.api.exception.LoadException;
|
||||
|
||||
import com.dfsek.terra.addon.InternalAddon;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.sounds.Music;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -41,7 +43,7 @@ public class NMSPlatform extends PlatformImpl {
|
||||
|
||||
public NMSPlatform(TerraBukkitPlugin plugin) {
|
||||
super(plugin);
|
||||
AwfulBukkitHacks.registerBiomes(this.getRawConfigRegistry());
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(new NMSInjectListener(), plugin);
|
||||
}
|
||||
|
||||
@ -77,6 +79,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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user