mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 14:21:08 +00:00
create StructureGenerationAddon
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
|||||||
|
package com.dfsek.terra.addons.generation.structure;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
||||||
|
import com.dfsek.terra.api.Platform;
|
||||||
|
import com.dfsek.terra.api.addon.BaseAddon;
|
||||||
|
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
||||||
|
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
||||||
|
import com.dfsek.terra.api.inject.annotations.Inject;
|
||||||
|
import com.dfsek.terra.api.world.generator.GenerationStageProvider;
|
||||||
|
|
||||||
|
|
||||||
|
public class StructureGenerationAddon implements AddonInitializer {
|
||||||
|
@Inject
|
||||||
|
private Platform platform;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private BaseAddon addon;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
platform.getEventManager()
|
||||||
|
.getHandler(FunctionalEventHandler.class)
|
||||||
|
.register(addon, ConfigPackPreLoadEvent.class)
|
||||||
|
.then(event -> event.getPack()
|
||||||
|
.getOrCreateRegistry(GenerationStageProvider.class)
|
||||||
|
.register("STRUCTURE", pack -> new StructureGenerationStage(platform)))
|
||||||
|
.failThrough();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
package com.dfsek.terra.addons.generation.structure;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.Platform;
|
||||||
|
import com.dfsek.terra.api.world.Chunk;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
import com.dfsek.terra.api.world.generator.GenerationStage;
|
||||||
|
|
||||||
|
|
||||||
|
public class StructureGenerationStage implements GenerationStage {
|
||||||
|
private final Platform platform;
|
||||||
|
|
||||||
|
public StructureGenerationStage(Platform platform) { this.platform = platform; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void populate(World world, Chunk chunk) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,8 @@ contributors:
|
|||||||
- Terra contributors
|
- Terra contributors
|
||||||
id: generation-stage-structure
|
id: generation-stage-structure
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
entrypoints: []
|
entrypoints:
|
||||||
|
- "com.dfsek.terra.addons.generation.structure.StructureGenerationAddon"
|
||||||
website:
|
website:
|
||||||
issues: https://github.com/PolyhedralDev/Terra-generation-stage-structure/issues
|
issues: https://github.com/PolyhedralDev/Terra-generation-stage-structure/issues
|
||||||
source: https://github.com/PolyhedralDev/Terra-generation-stage-structure
|
source: https://github.com/PolyhedralDev/Terra-generation-stage-structure
|
||||||
|
|||||||
Reference in New Issue
Block a user