diff --git a/.gitignore b/.gitignore index 09cd281..3b25af4 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ bin/ # fabric run/ +remappedSrc/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9effe49..eac800b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,10 @@ plugins { - id 'fabric-loom' version '0.9-SNAPSHOT' + id 'fabric-loom' version '0.10-SNAPSHOT' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_16 -targetCompatibility = JavaVersion.VERSION_16 +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 archivesBaseName = project.archives_base_name version = project.mod_version + "-" + project.minecraft_version @@ -72,7 +72,7 @@ processResources { // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html tasks.withType(JavaCompile).configureEach { it.options.encoding = "UTF-8" - it.options.release = 16 + it.options.release = 17 } // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task diff --git a/gradle.properties b/gradle.properties index 9ebe14c..ad96b57 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.17.1 - yarn_mappings=1.17.1+build.59 - loader_version=0.11.6 + minecraft_version=1.18.1 + yarn_mappings=1.18.1+build.5 + loader_version=0.12.12 # Mod Properties mod_version = 1.2 @@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx1G # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.40.0+1.17 - modmenu_version=2.0.10 - cca_version=3.1.1 - cloth_version=5.0.38 \ No newline at end of file + fabric_version=0.44.0+1.18 + modmenu_version=3.0.1 + cca_version=4.0.1 + cloth_version=6.1.48 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a2..e750102 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/dev/agatharose/asbestos/AsbestosRegistry.java b/src/main/java/dev/agatharose/asbestos/AsbestosRegistry.java index 190fc22..656eba4 100644 --- a/src/main/java/dev/agatharose/asbestos/AsbestosRegistry.java +++ b/src/main/java/dev/agatharose/asbestos/AsbestosRegistry.java @@ -9,7 +9,6 @@ import net.fabricmc.fabric.api.biome.v1.BiomeModifications; import net.fabricmc.fabric.api.biome.v1.BiomeSelectors; import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.minecraft.block.Material; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.effect.StatusEffectInstance; @@ -28,13 +27,15 @@ import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.RegistryKey; import net.minecraft.world.gen.GenerationStep; import net.minecraft.world.gen.YOffset; -import net.minecraft.world.gen.decorator.RangeDecoratorConfig; +import net.minecraft.world.gen.decorator.CountPlacementModifier; +import net.minecraft.world.gen.decorator.HeightRangePlacementModifier; +import net.minecraft.world.gen.decorator.SquarePlacementModifier; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.OreConfiguredFeatures; import net.minecraft.world.gen.feature.OreFeatureConfig; -import net.minecraft.world.gen.heightprovider.UniformHeightProvider; +import net.minecraft.world.gen.feature.PlacedFeature; -@SuppressWarnings("deprecation") public class AsbestosRegistry { // block/item definitions public static final Item ASBESTOS_FIBERS = new Item(new FabricItemSettings().group(ItemGroup.MATERIALS) @@ -47,10 +48,10 @@ public class AsbestosRegistry { FabricBlockSettings.of(Material.WOOL).hardness(1.0f).sounds(BlockSoundGroup.WOOL), 40); public static final CarcinogenicBlock SERPENTINITE_BLOCK = new CarcinogenicBlock(FabricBlockSettings - .of(Material.STONE).hardness(3.0f).breakByTool(FabricToolTags.PICKAXES).requiresTool(), 20); + .of(Material.STONE).hardness(3.0f).requiresTool(), 20); public static final CarcinogenicBlock POPCORN_CEILING_BLOCK = new CarcinogenicBlock(FabricBlockSettings - .of(Material.WOOD).hardness(2.0f).breakByTool(FabricToolTags.AXES).sounds(BlockSoundGroup.WOOD), + .of(Material.WOOD).hardness(2.0f).sounds(BlockSoundGroup.WOOD), 20); public static final CarcinogenicBlock ASBESTOS_TILE_BLOCK = new CarcinogenicBlock( @@ -78,11 +79,13 @@ public class AsbestosRegistry { // serpentinite worldgen private static ConfiguredFeature SERPENTINITE_OVERWORLD = Feature.ORE - .configure(new OreFeatureConfig(OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, - SERPENTINITE_BLOCK.getDefaultState(), 5)) - .range(new RangeDecoratorConfig( - UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.fixed(32)))) - .spreadHorizontally().repeat(10); + .configure(new OreFeatureConfig(OreConfiguredFeatures.DEEPSLATE_ORE_REPLACEABLES, + SERPENTINITE_BLOCK.getDefaultState(), 5)); + + public static PlacedFeature SERPENTINITE_PLACED_FEATURE = SERPENTINITE_OVERWORLD.withPlacement( + CountPlacementModifier.of(20), + SquarePlacementModifier.of(), + HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(0))); public static void register() { // asbestos fibers item @@ -118,11 +121,13 @@ public class AsbestosRegistry { ASBESTOS_ROOF_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS))); // serpentinite worldgen - RegistryKey> serpentiniteOverworld = RegistryKey.of( - Registry.CONFIGURED_FEATURE_KEY, new Identifier("asbestos", "serpentinite_overworld")); + RegistryKey serpentiniteOverworld = RegistryKey.of( + Registry.PLACED_FEATURE_KEY, new Identifier("asbestos", "serpentinite_overworld")); Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, serpentiniteOverworld.getValue(), SERPENTINITE_OVERWORLD); + Registry.register(BuiltinRegistries.PLACED_FEATURE, serpentiniteOverworld.getValue(), + SERPENTINITE_PLACED_FEATURE); BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, serpentiniteOverworld); diff --git a/src/main/java/dev/agatharose/asbestos/config/AsbestosConfig.java b/src/main/java/dev/agatharose/asbestos/config/AsbestosConfig.java index 0b157fd..a16232d 100644 --- a/src/main/java/dev/agatharose/asbestos/config/AsbestosConfig.java +++ b/src/main/java/dev/agatharose/asbestos/config/AsbestosConfig.java @@ -1,7 +1,6 @@ package dev.agatharose.asbestos.config; import me.shedaniel.autoconfig.ConfigData; -import me.shedaniel.autoconfig.annotation.Config; import me.shedaniel.autoconfig.annotation.*; @Config(name = "asbestos") diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json new file mode 100644 index 0000000..c9ad066 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "asbestos:popcorn_ceiling_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json new file mode 100644 index 0000000..5759561 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "asbestos:serpentinite_block", + "asbestos:asbestos_roof_block" + ] +} \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 2ff3430..78fd4a2 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -31,10 +31,10 @@ ] }, "depends": { - "fabricloader": ">=0.11.3", + "fabricloader": ">=0.12.0", "fabric": "*", - "minecraft": "1.17.x", - "java": ">=16" + "minecraft": "1.18.x", + "java": ">=17" }, "suggests": { "modmenu": "*"