mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-26 05:50:08 +00:00
register stuff with events
This commit is contained in:
1 parent
c120ab76d0
commit
13497a02a4
3 files changed
+3
-30
No files matched your search
@@ -50,16 +50,8 @@ public class ForgeEntryPoint {
|
|||||||
return TERRA_PLUGIN;
|
return TERRA_PLUGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void register() { // register the things
|
|
||||||
Registry.register(Registry.CHUNK_GENERATOR, new Identifier("terra:terra"), Codecs.FABRIC_CHUNK_GENERATOR_WRAPPER);
|
|
||||||
Registry.register(Registry.BIOME_SOURCE, new Identifier("terra:terra"), Codecs.TERRA_BIOME_SOURCE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ForgeEntryPoint() {
|
public ForgeEntryPoint() {
|
||||||
Registry.register(Registry.CHUNK_GENERATOR, new Identifier("terra:terra"), Codecs.FABRIC_CHUNK_GENERATOR_WRAPPER);
|
|
||||||
Registry.register(Registry.BIOME_SOURCE, new Identifier("terra:terra"), Codecs.TERRA_BIOME_SOURCE);
|
|
||||||
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
||||||
|
|
||||||
modEventBus.register(this);
|
modEventBus.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,6 +61,8 @@ public class ForgeEntryPoint {
|
|||||||
logger.info("Loading Terra data...");
|
logger.info("Loading Terra data...");
|
||||||
LifecycleUtil.initialize();
|
LifecycleUtil.initialize();
|
||||||
});
|
});
|
||||||
|
event.register(Registry.CHUNK_GENERATOR_KEY, helper -> helper.register(new Identifier("terra:terra"), Codecs.FABRIC_CHUNK_GENERATOR_WRAPPER));
|
||||||
|
event.register(Registry.BIOME_SOURCE_KEY, helper -> helper.register(new Identifier("terra:terra"), Codecs.TERRA_BIOME_SOURCE));
|
||||||
event.register(Keys.BLOCKS, helper -> logger.debug("Block registration detected."));
|
event.register(Keys.BLOCKS, helper -> logger.debug("Block registration detected."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
package com.dfsek.terra.forge.mixin.lifecycle;
|
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.util.registry.Registry;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
|
|
||||||
import com.dfsek.terra.forge.ForgeEntryPoint;
|
|
||||||
|
|
||||||
|
|
||||||
// Register Terra things to the builtin registries.
|
|
||||||
@Mixin(Registry.class)
|
|
||||||
public class RegistryMixin {
|
|
||||||
@Inject(method = "<clinit>", at = @At("RETURN"))
|
|
||||||
private static void registerTerraGenerators(CallbackInfo ci) {
|
|
||||||
ForgeEntryPoint.register();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -35,8 +35,7 @@
|
|||||||
"implementations.terra.world.ChunkRegionMixin",
|
"implementations.terra.world.ChunkRegionMixin",
|
||||||
"implementations.terra.world.ServerWorldMixin",
|
"implementations.terra.world.ServerWorldMixin",
|
||||||
"lifecycle.DataPackContentsMixin",
|
"lifecycle.DataPackContentsMixin",
|
||||||
"lifecycle.NoiseConfigMixin",
|
"lifecycle.NoiseConfigMixin"
|
||||||
"lifecycle.RegistryMixin"
|
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in new issue
Block a user