From 3f59e506a4675bd579edb7fac25446aaaa3e2e2a Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 22 Aug 2020 12:17:00 -0400 Subject: [PATCH] 0.2.2 --- CHANGELOG.md | 3 +++ build.gradle | 3 --- gradle.properties | 9 ++++----- .../block/structure/StructureGeneratorBlock.java | 9 +++++---- .../block/structure/StructureGeneratorPiece.java | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a57c0a..b19a598 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +**Beta 0.2.2** +* Update To Fabric Structure API + **Beta 0.2.1** * Fix Solar Panel Crash diff --git a/build.gradle b/build.gradle index eafc263..2d3d592 100644 --- a/build.gradle +++ b/build.gradle @@ -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}" } diff --git a/gradle.properties b/gradle.properties index da6bf4e..dc2e412 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/structure/StructureGeneratorBlock.java b/src/main/java/com/thebrokenrail/energonrelics/block/structure/StructureGeneratorBlock.java index d2aa8fb..82c8228 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/block/structure/StructureGeneratorBlock.java +++ b/src/main/java/com/thebrokenrail/energonrelics/block/structure/StructureGeneratorBlock.java @@ -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() { diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/structure/StructureGeneratorPiece.java b/src/main/java/com/thebrokenrail/energonrelics/block/structure/StructureGeneratorPiece.java index 9e323a6..17fdec0 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/block/structure/StructureGeneratorPiece.java +++ b/src/main/java/com/thebrokenrail/energonrelics/block/structure/StructureGeneratorPiece.java @@ -50,7 +50,7 @@ class StructureGeneratorPiece extends StructurePiece { ((StructureGeneratorBlockEntity) entity).setSeed(random.nextLong()); } - block.schedule(world.toServerWorld(), pos); + block.schedule(world, pos); return true; } }