diff --git a/gradle.properties b/gradle.properties index 05012ae4..251f494a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,11 +2,9 @@ org.gradle.jvmargs=-Xmx2G fabric.loom.multiProjectOptimisation=true maven_group=com.terraformersmc.terraform-api -version=9.0.0-alpha.3 +version=9.0.0-beta.1 -minecraft_version=23w45a -yarn_mappings=23w45a+build.4 -loader_version=0.14.24 -fabric_version=0.90.8+1.20.3 - -mixinextras_version=0.2.0 +minecraft_version=1.20.3 +yarn_mappings=1.20.3+build.1 +loader_version=0.15.1 +fabric_version=0.91.1+1.20.3 diff --git a/terraform-biome-remapper-api-v1/src/main/java/com/terraformersmc/terraform/biomeremapper/api/DataVersions.java b/terraform-biome-remapper-api-v1/src/main/java/com/terraformersmc/terraform/biomeremapper/api/DataVersions.java index 1984c6c1..722e3cd3 100644 --- a/terraform-biome-remapper-api-v1/src/main/java/com/terraformersmc/terraform/biomeremapper/api/DataVersions.java +++ b/terraform-biome-remapper-api-v1/src/main/java/com/terraformersmc/terraform/biomeremapper/api/DataVersions.java @@ -6,7 +6,7 @@ public final class DataVersions { private DataVersions() { return; } - + public static final int V_1_20_4 = 3699; public static final int V_1_20_3 = 3692; public static final int V_1_20_2 = 3572; public static final int V_1_20_1 = 3464; diff --git a/terraform-dirt-api-v1/build.gradle b/terraform-dirt-api-v1/build.gradle index 15f7d466..111b4a0a 100644 --- a/terraform-dirt-api-v1/build.gradle +++ b/terraform-dirt-api-v1/build.gradle @@ -1,5 +1 @@ archivesBaseName = "terraform-dirt-api-v1" - -dependencies { - include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}"))) -} diff --git a/terraform-dirt-api-v1/src/main/resources/fabric.mod.json b/terraform-dirt-api-v1/src/main/resources/fabric.mod.json index a691d8dd..4b856b45 100644 --- a/terraform-dirt-api-v1/src/main/resources/fabric.mod.json +++ b/terraform-dirt-api-v1/src/main/resources/fabric.mod.json @@ -43,6 +43,9 @@ } } }, + "depends": { + "fabricloader": ">=0.15" + }, "breaks": { "moretags": "*" }, diff --git a/terraform-wood-api-v1/build.gradle b/terraform-wood-api-v1/build.gradle index 3c67fc8e..460ab848 100644 --- a/terraform-wood-api-v1/build.gradle +++ b/terraform-wood-api-v1/build.gradle @@ -11,6 +11,4 @@ dependencies { testmodImplementation project(path: ":terraform-wood-api-v1", configuration: "namedElements") modTestmodImplementation fabricApi.module("fabric-command-api-v2", project.fabric_version) modTestmodImplementation fabricApi.module("fabric-item-group-api-v1", project.fabric_version) - - include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}"))) } diff --git a/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/leaves/ComposterRecipes.java b/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/leaves/ComposterRecipes.java index c2fd411b..3c95ce0f 100644 --- a/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/leaves/ComposterRecipes.java +++ b/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/leaves/ComposterRecipes.java @@ -1,29 +1,57 @@ package com.terraformersmc.terraform.leaves; -import com.terraformersmc.terraform.leaves.block.ExtendedLeavesBlock; import com.terraformersmc.terraform.leaves.block.LeafPileBlock; -import net.minecraft.block.Block; -import net.minecraft.block.ComposterBlock; -import net.minecraft.block.FernBlock; -import net.minecraft.block.FlowerBlock; -import net.minecraft.block.LeavesBlock; -import net.minecraft.block.SaplingBlock; -import net.minecraft.block.SeagrassBlock; +import net.minecraft.block.*; import net.minecraft.item.ItemConvertible; import net.minecraft.item.Items; +import java.util.Objects; + +/** + * @deprecated This class is deprecated in favor of using Fabric's CompostingChanceRegistry. + * + *

For example:
+ *

{@code
+ *     LeavesBlock leavesBlock = new LeavesBlock(...);
+ *     BlockItem leavesItem = new BlockItem(leavesBlock, new Item.Settings());
+ *     CompostingChanceRegistry.INSTANCE.add(leavesItem, chance);
+ * }
+ *

+ */ +@Deprecated(since = "9.0.0", forRemoval = true) public class ComposterRecipes { + /** + * @deprecated Use {@code CompostingChanceRegistry.INSTANCE.add(item, chance) } instead. + * + * @param item A compostable item + * @param chance The compostable item's composter fill chance + */ + @Deprecated private static void registerCompostableItem(ItemConvertible item, float chance) { if (item.asItem() != Items.AIR) { ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.put(item.asItem(), chance); } } + /** + * @deprecated Use {@code CompostingChanceRegistry.INSTANCE.add(item, chance) } instead. + * + *


+ * Blocks this method is capable of registering: + *

  • Fern and Large Fern
  • + *
  • Extenders of: FlowerBlock, LeafPileBlock, LeavesBlock, SaplingBlock, SeagrassBlock
  • + *

    + * + * @param block A block with a compostable item + */ + @Deprecated public static void registerCompostableBlock(Block block) { - if (block instanceof ExtendedLeavesBlock || block instanceof LeavesBlock || block instanceof LeafPileBlock || block instanceof SaplingBlock || block instanceof SeagrassBlock) { + Objects.requireNonNull(block); + + if (block instanceof LeavesBlock || block instanceof LeafPileBlock || block instanceof SaplingBlock || block instanceof SeagrassBlock) { registerCompostableItem(block, 0.3F); - } else if (block instanceof FernBlock || block instanceof FlowerBlock) { + } else if (block.equals(Blocks.FERN) || block.equals(Blocks.LARGE_FERN) || block instanceof FlowerBlock) { registerCompostableItem(block, 0.65F); } } diff --git a/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/wood/block/StrippableLogBlock.java b/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/wood/block/StrippableLogBlock.java deleted file mode 100644 index 118de3d0..00000000 --- a/terraform-wood-api-v1/src/main/java/com/terraformersmc/terraform/wood/block/StrippableLogBlock.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.terraformersmc.terraform.wood.block; - -import java.util.function.Supplier; - -import net.fabricmc.fabric.api.registry.StrippableBlockRegistry; -import net.minecraft.block.AbstractBlock; -import net.minecraft.block.Block; -import net.minecraft.block.MapColor; -import net.minecraft.block.PillarBlock; -import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.util.math.Direction; - -/** - *

    This class is deprecated in favor of using PillarBlock and Fabric's StrippableBlockRegistry. - * However, we are providing factory methods in PillarLogHelper until Mojang makes map colors easier.

    - * - *
    {@code
    - *     PillarBlock logBlock = PillarLogHelper.of(woodColor, barkColor);
    - *     PillarBlock strippedBlock = PillarLogHelper.of(woodColor);
    - *     StrippableBlockRegistry.register(logBlock, strippedBlock);
    - * }
    - */ -@Deprecated(forRemoval = true, since = "6.1.0") -public class StrippableLogBlock extends PillarBlock { - /** - *

    This class is deprecated in favor of using PillarBlock and Fabric's StrippableBlockRegistry. - * However, we are providing factory methods in PillarLogHelper until Mojang makes map colors easier.

    - * - *
    {@code
    -	 *     PillarBlock logBlock = PillarLogHelper.of(woodColor, barkColor);
    -	 *     PillarBlock strippedBlock = PillarLogHelper.of(woodColor);
    -	 *     StrippableBlockRegistry.register(logBlock, strippedBlock);
    -	 * }
    - * - * @param stripped Supplier of default BlockState for stripped variant - * @param top Ignored (not implemented) - * @param settings Block Settings for log - */ - public StrippableLogBlock(Supplier stripped, MapColor top, Settings settings) { - super(settings); - - if (stripped != null) { - StrippableBlockRegistry.register(this, stripped.get()); - } - } - - /** - * Use {@code PillarLogHelper.of(color) } instead. - * - * @param color Map color for all faces of log - * @return New PillarBlock - */ - public static PillarBlock of(MapColor color) { - return new PillarBlock(AbstractBlock.Settings.create() - .mapColor(color) - .strength(2.0F) - .sounds(BlockSoundGroup.WOOD) - .burnable() - ); - } - - /** - * Use {@code PillarLogHelper.of(woodColor, barkColor) } instead. - * - * @param wood Map color for non-bark faces of log (ends) - * @param bark Map color for bark faces of log (sides) - * @return New PillarBlock - */ - public static PillarBlock of(MapColor wood, MapColor bark) { - return new PillarBlock(AbstractBlock.Settings.create() - .mapColor((state) -> Direction.Axis.Y.equals(state.get(PillarBlock.AXIS)) ? wood : bark) - .strength(2.0F) - .sounds(BlockSoundGroup.WOOD) - .burnable() - ); - } -} diff --git a/terraform-wood-api-v1/src/testmod/resources/fabric.mod.json b/terraform-wood-api-v1/src/testmod/resources/fabric.mod.json index fd8cf012..401ebccf 100644 --- a/terraform-wood-api-v1/src/testmod/resources/fabric.mod.json +++ b/terraform-wood-api-v1/src/testmod/resources/fabric.mod.json @@ -10,5 +10,8 @@ "client": [ "com.terraformersmc.terraform.wood.test.TerraformWoodTestClient" ] + }, + "depends": { + "fabricloader": ">=0.15" } }