|
|
|
@ -5,8 +5,8 @@ import com.thebrokenrail.energonrelics.block.entity.structure.StructureGenerator
|
|
|
|
|
import com.thebrokenrail.energonrelics.api.block.SimpleBlockWithEntity;
|
|
|
|
|
import com.thebrokenrail.energonrelics.structure.researchcomplex.ResearchComplexStartPart;
|
|
|
|
|
import com.thebrokenrail.energonrelics.structure.researchcomplex.ResearchComplexState;
|
|
|
|
|
import net.earthcomputer.libstructure.LibStructure;
|
|
|
|
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|
|
|
|
import net.fabricmc.fabric.api.structure.v1.FabricStructureBuilder;
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
|
import net.minecraft.block.Blocks;
|
|
|
|
@ -23,6 +23,7 @@ import net.minecraft.util.Identifier;
|
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
|
import net.minecraft.util.math.Direction;
|
|
|
|
|
import net.minecraft.util.registry.Registry;
|
|
|
|
|
import net.minecraft.world.StructureWorldAccess;
|
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
import net.minecraft.world.biome.Biome;
|
|
|
|
|
import net.minecraft.world.gen.GenerationStep;
|
|
|
|
@ -100,11 +101,11 @@ public class StructureGeneratorBlock extends SimpleBlockWithEntity {
|
|
|
|
|
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) {
|
|
|
|
|
super.onBlockAdded(state, world, pos, oldState, notify);
|
|
|
|
|
if (world instanceof ServerWorld) {
|
|
|
|
|
schedule(world, pos);
|
|
|
|
|
schedule((ServerWorld) world, pos);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void schedule(World world, BlockPos pos) {
|
|
|
|
|
public void schedule(StructureWorldAccess world, BlockPos pos) {
|
|
|
|
|
world.getBlockTickScheduler().schedule(pos, this, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -119,7 +120,7 @@ public class StructureGeneratorBlock extends SimpleBlockWithEntity {
|
|
|
|
|
blocks.put(name, block);
|
|
|
|
|
|
|
|
|
|
Registry.register(Registry.STRUCTURE_PIECE, new Identifier(EnergonRelics.NAMESPACE, name + "_piece"), block.piece);
|
|
|
|
|
LibStructure.registerStructure(new Identifier(EnergonRelics.NAMESPACE, name), block.feature, GenerationStep.Feature.UNDERGROUND_STRUCTURES, block.structureConfig, block.feature.configure(FeatureConfig.DEFAULT));
|
|
|
|
|
FabricStructureBuilder.create(new Identifier(EnergonRelics.NAMESPACE, name), block.feature).step(GenerationStep.Feature.UNDERGROUND_STRUCTURES).defaultConfig(block.structureConfig).superflatFeature(block.feature.configure(FeatureConfig.DEFAULT)).register();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void registerBlocks() {
|
|
|
|
|