From fdbe730ca6149b39d57eaa5b0f69b42679e15525 Mon Sep 17 00:00:00 2001 From: Agatha Rose Date: Wed, 8 Sep 2021 22:02:02 +0300 Subject: [PATCH] Update to 1.17.x --- build.gradle | 38 +++++-------------- gradle.properties | 14 +++---- gradle/wrapper/gradle-wrapper.properties | 2 +- .../dev/agatharose/asbestos/Asbestos.java | 2 +- .../agatharose/asbestos/AsbestosRegistry.java | 11 +++--- .../asbestos/MesotheliomaStatusEffect.java | 4 +- .../asbestos/block/AsbestosRoofBlock.java | 24 +++++++----- .../PlayerMesotheliomaComponent.java | 6 +-- .../agatharose/asbestos/item/ScraperItem.java | 3 +- src/main/resources/fabric.mod.json | 5 ++- 10 files changed, 48 insertions(+), 61 deletions(-) diff --git a/build.gradle b/build.gradle index e4f3205..9effe49 100644 --- a/build.gradle +++ b/build.gradle @@ -1,18 +1,18 @@ plugins { - id 'fabric-loom' version '0.5-SNAPSHOT' + id 'fabric-loom' version '0.9-SNAPSHOT' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = JavaVersion.VERSION_16 +targetCompatibility = JavaVersion.VERSION_16 archivesBaseName = project.archives_base_name -version = project.mod_version +version = project.mod_version + "-" + project.minecraft_version group = project.maven_group repositories { maven { - url "http://maven.terraformersmc.com/releases/" + url "https://maven.terraformersmc.com/releases/" } maven { name = 'Ladysnake Mods' @@ -70,8 +70,9 @@ processResources { // ensure that the encoding is set to UTF-8, no matter what the system default is // this fixes some edge cases with special characters not displaying correctly // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html -tasks.withType(JavaCompile) { - options.encoding = "UTF-8" +tasks.withType(JavaCompile).configureEach { + it.options.encoding = "UTF-8" + it.options.release = 16 } // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task @@ -84,25 +85,4 @@ task sourcesJar(type: Jar, dependsOn: classes) { jar { from "LICENSE" -} - -// configure the maven publication -publishing { - publications { - mavenJava(MavenPublication) { - // add all the jars that should be included when publishing to maven - artifact(remapJar) { - builtBy remapJar - } - artifact(sourcesJar) { - builtBy remapSourcesJar - } - } - } - - // select the repositories you want to publish to - repositories { - // uncomment to publish to the local maven - // mavenLocal() - } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 67724ef..a74a079 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.16.5 - yarn_mappings=1.16.5+build.9 - loader_version=0.11.3 + minecraft_version=1.17.1 + yarn_mappings=1.17.1+build.59 + loader_version=0.11.6 # Mod Properties mod_version = 1.1 @@ -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.34.2+1.16 - modmenu_version=1.16.9 - cca_version=2.8.3 - cloth_version=4.11.26 \ No newline at end of file + 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 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 12d38de..ffed3a2 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-6.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/dev/agatharose/asbestos/Asbestos.java b/src/main/java/dev/agatharose/asbestos/Asbestos.java index 54ef4b1..12c44a3 100644 --- a/src/main/java/dev/agatharose/asbestos/Asbestos.java +++ b/src/main/java/dev/agatharose/asbestos/Asbestos.java @@ -14,7 +14,7 @@ import dev.onyxstudios.cca.api.v3.entity.EntityComponentFactoryRegistry; import dev.onyxstudios.cca.api.v3.entity.EntityComponentInitializer; import me.shedaniel.autoconfig.AutoConfig; import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer; -import nerdhub.cardinal.components.api.util.RespawnCopyStrategy; +import dev.onyxstudios.cca.api.v3.entity.RespawnCopyStrategy; import net.fabricmc.api.ModInitializer; import net.minecraft.block.Block; import net.minecraft.entity.damage.DamageSource; diff --git a/src/main/java/dev/agatharose/asbestos/AsbestosRegistry.java b/src/main/java/dev/agatharose/asbestos/AsbestosRegistry.java index 3da9df4..190fc22 100644 --- a/src/main/java/dev/agatharose/asbestos/AsbestosRegistry.java +++ b/src/main/java/dev/agatharose/asbestos/AsbestosRegistry.java @@ -27,11 +27,12 @@ import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.RegistryKey; import net.minecraft.world.gen.GenerationStep; -import net.minecraft.world.gen.decorator.Decorator; +import net.minecraft.world.gen.YOffset; import net.minecraft.world.gen.decorator.RangeDecoratorConfig; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.OreFeatureConfig; +import net.minecraft.world.gen.heightprovider.UniformHeightProvider; @SuppressWarnings("deprecation") public class AsbestosRegistry { @@ -79,8 +80,9 @@ public class AsbestosRegistry { private static ConfiguredFeature SERPENTINITE_OVERWORLD = Feature.ORE .configure(new OreFeatureConfig(OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, SERPENTINITE_BLOCK.getDefaultState(), 5)) - .decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(0, 0, 32))).spreadHorizontally() - .repeat(10); + .range(new RangeDecoratorConfig( + UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.fixed(32)))) + .spreadHorizontally().repeat(10); public static void register() { // asbestos fibers item @@ -117,8 +119,7 @@ public class AsbestosRegistry { // serpentinite worldgen RegistryKey> serpentiniteOverworld = RegistryKey.of( - Registry.CONFIGURED_FEATURE_WORLDGEN, - new Identifier("asbestos", "serpentinite_overworld")); + Registry.CONFIGURED_FEATURE_KEY, new Identifier("asbestos", "serpentinite_overworld")); Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, serpentiniteOverworld.getValue(), SERPENTINITE_OVERWORLD); diff --git a/src/main/java/dev/agatharose/asbestos/MesotheliomaStatusEffect.java b/src/main/java/dev/agatharose/asbestos/MesotheliomaStatusEffect.java index d908563..c08a095 100644 --- a/src/main/java/dev/agatharose/asbestos/MesotheliomaStatusEffect.java +++ b/src/main/java/dev/agatharose/asbestos/MesotheliomaStatusEffect.java @@ -5,13 +5,13 @@ import me.shedaniel.autoconfig.AutoConfig; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; -import net.minecraft.entity.effect.StatusEffectType; +import net.minecraft.entity.effect.StatusEffectCategory; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.player.PlayerEntity; public class MesotheliomaStatusEffect extends StatusEffect { public MesotheliomaStatusEffect() { - super(StatusEffectType.HARMFUL, 0x302412); + super(StatusEffectCategory.HARMFUL, 0x302412); } @Override diff --git a/src/main/java/dev/agatharose/asbestos/block/AsbestosRoofBlock.java b/src/main/java/dev/agatharose/asbestos/block/AsbestosRoofBlock.java index b8009e4..77b5652 100644 --- a/src/main/java/dev/agatharose/asbestos/block/AsbestosRoofBlock.java +++ b/src/main/java/dev/agatharose/asbestos/block/AsbestosRoofBlock.java @@ -37,16 +37,20 @@ public class AsbestosRoofBlock extends CarcinogenicBlock { public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { Direction dir = state.get(Properties.HORIZONTAL_FACING); switch (dir) { - case NORTH: - return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), VoxelShapes.cuboid(1, 0.5, 1, 0, 1, 0.5)); - case SOUTH: - return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), VoxelShapes.cuboid(0, 0.5, 0, 1, 1, 0.5)); - case EAST: - return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), VoxelShapes.cuboid(0, 0.5, 0, 0.5, 1, 1)); - case WEST: - return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), VoxelShapes.cuboid(1, 0.5, 0, 0.5, 1, 1)); - default: - return VoxelShapes.fullCube(); + case NORTH: + return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), + VoxelShapes.cuboid(0, 0.5, 0.5, 1, 1, 1)); + case SOUTH: + return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), + VoxelShapes.cuboid(0, 0.5, 0, 1, 1, 0.5)); + case EAST: + return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), + VoxelShapes.cuboid(0, 0.5, 0, 0.5, 1, 1)); + case WEST: + return VoxelShapes.union(VoxelShapes.cuboid(0, 0, 0, 1, 0.5, 1), + VoxelShapes.cuboid(0.5, 0.5, 0, 1, 1, 1)); + default: + return VoxelShapes.fullCube(); } } diff --git a/src/main/java/dev/agatharose/asbestos/component/PlayerMesotheliomaComponent.java b/src/main/java/dev/agatharose/asbestos/component/PlayerMesotheliomaComponent.java index a386d29..5dca924 100644 --- a/src/main/java/dev/agatharose/asbestos/component/PlayerMesotheliomaComponent.java +++ b/src/main/java/dev/agatharose/asbestos/component/PlayerMesotheliomaComponent.java @@ -3,7 +3,7 @@ package dev.agatharose.asbestos.component; import dev.agatharose.asbestos.Asbestos; import dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtCompound; public class PlayerMesotheliomaComponent implements MesotheliomaComponent, AutoSyncedComponent { private PlayerEntity player; @@ -26,12 +26,12 @@ public class PlayerMesotheliomaComponent implements MesotheliomaComponent, AutoS } @Override - public void readFromNbt(CompoundTag tag) { + public void readFromNbt(NbtCompound tag) { this.mesothelioma = tag.getInt("mesothelioma"); } @Override - public void writeToNbt(CompoundTag tag) { + public void writeToNbt(NbtCompound tag) { tag.putInt("mesothelioma", this.mesothelioma); } } diff --git a/src/main/java/dev/agatharose/asbestos/item/ScraperItem.java b/src/main/java/dev/agatharose/asbestos/item/ScraperItem.java index b490969..a6983ed 100644 --- a/src/main/java/dev/agatharose/asbestos/item/ScraperItem.java +++ b/src/main/java/dev/agatharose/asbestos/item/ScraperItem.java @@ -8,6 +8,7 @@ import static dev.agatharose.asbestos.AsbestosRegistry.*; import net.minecraft.block.Block; import net.minecraft.item.MiningToolItem; import net.minecraft.item.ToolMaterial; +import net.minecraft.tag.Tag; public class ScraperItem extends MiningToolItem { @@ -15,6 +16,6 @@ public class ScraperItem extends MiningToolItem { Arrays.asList(ASBESTOS_BLOCK, POPCORN_CEILING_BLOCK, ASBESTOS_TILE_BLOCK)); public ScraperItem(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) { - super(attackDamage, attackSpeed, material, affectedBlocks, settings); + super(attackDamage, attackSpeed, material, Tag.of(affectedBlocks), settings); } } \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index ce1eb79..2ff3430 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -31,9 +31,10 @@ ] }, "depends": { - "fabricloader": ">=0.7.4", + "fabricloader": ">=0.11.3", "fabric": "*", - "minecraft": "1.16.x" + "minecraft": "1.17.x", + "java": ">=16" }, "suggests": { "modmenu": "*"