This commit is contained in:
parent
6382869176
commit
3f59e506a4
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
**Beta 0.2.2**
|
||||
* Update To Fabric Structure API
|
||||
|
||||
**Beta 0.2.1**
|
||||
* Fix Solar Panel Crash
|
||||
|
||||
|
@ -45,9 +45,6 @@ dependencies {
|
||||
modImplementation "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
|
||||
include "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
|
||||
|
||||
modImplementation "net.earthcomputer:libstructure:${project.libstructure_version}"
|
||||
include "net.earthcomputer:libstructure:${project.libstructure_version}"
|
||||
|
||||
compileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}"
|
||||
}
|
||||
|
||||
|
@ -6,19 +6,18 @@ org.gradle.jvmargs = -Xmx1G
|
||||
minecraft_version = 1.16.2
|
||||
curseforge_id = 398250
|
||||
simple_minecraft_version = 1.16.2
|
||||
yarn_build = 6
|
||||
fabric_loader_version = 0.9.0+build.204
|
||||
yarn_build = 21
|
||||
fabric_loader_version = 0.9.2+build.206
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 0.2.1
|
||||
mod_version = 0.2.2
|
||||
maven_group = com.thebrokenrail
|
||||
|
||||
# Dependencies
|
||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
fabric_api_version = 0.17.2+build.396-1.16
|
||||
fabric_api_version = 0.19.0+build.398-1.16
|
||||
modmenu_version = 1.14.6+build.31
|
||||
cloth_config_version = 4.7.0-unstable
|
||||
autoconfig_version = 3.2.0-unstable
|
||||
libstructure_version = 1.5
|
||||
roughlyenoughitems_version = 5.2.3
|
||||
jetbrains_annotations_version = 19.0.0
|
||||
|
@ -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() {
|
||||
|
@ -50,7 +50,7 @@ class StructureGeneratorPiece extends StructurePiece {
|
||||
((StructureGeneratorBlockEntity) entity).setSeed(random.nextLong());
|
||||
}
|
||||
|
||||
block.schedule(world.toServerWorld(), pos);
|
||||
block.schedule(world, pos);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user