From 998ac2a904bc3f9e70868386125e12427ec722b9 Mon Sep 17 00:00:00 2001 From: Lucien Lasseau <62194841+AlurienFlame@users.noreply.github.com> Date: Sun, 31 Jul 2022 16:28:58 +1200 Subject: [PATCH] Backport to 1.18.2 --- .github/workflows/build_and_publish.yml | 2 +- gradle.properties | 8 ++++---- src/main/java/net/balancedrecall/MagicMirror.java | 8 ++++---- src/main/java/net/balancedrecall/SleepingMat.java | 11 ++++++----- src/main/resources/fabric.mod.json | 11 ++++------- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index 1176d9c..9db550f 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -33,6 +33,6 @@ jobs: github-token: ${{ secrets.GH_TOKEN }} # Determines the way automatic game-versions resolvement works - version-resolver: all + version-resolver: releases java: 17 diff --git a/gradle.properties b/gradle.properties index 31fefb4..6b1de82 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/versions.html - minecraft_version=1.19 - yarn_mappings=1.19+build.4 + minecraft_version=1.18.2 + yarn_mappings=1.18.2+build.4 loader_version=0.14.8 # Mod Properties - mod_version = 1.0.1 + mod_version = 1.0.2 maven_group = net.balancedrecall archives_base_name = balancedrecall # Dependencies - fabric_version=0.58.0+1.19 + fabric_version=0.58.0+1.18.2 diff --git a/src/main/java/net/balancedrecall/MagicMirror.java b/src/main/java/net/balancedrecall/MagicMirror.java index 367afa9..4f89d08 100644 --- a/src/main/java/net/balancedrecall/MagicMirror.java +++ b/src/main/java/net/balancedrecall/MagicMirror.java @@ -17,7 +17,7 @@ import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.stat.Stats; -import net.minecraft.text.Text; +import net.minecraft.text.TranslatableText; import net.minecraft.util.Hand; import net.minecraft.util.TypedActionResult; import net.minecraft.util.UseAction; @@ -98,7 +98,7 @@ public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) { if ( !isInterdimensional && serverPlayer.getWorld() != targetWorld) { // This mirror is too weak to cross the veil between worlds! Maybe a rare nether metal could help... - player.sendMessage(Text.translatable("balancedrecall.fail_cross_dimension"), false); + player.sendMessage(new TranslatableText("balancedrecall.fail_cross_dimension"), false); return stack; } @@ -108,7 +108,7 @@ public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) { } else { // You have no home bed or charged respawn anchor, or it was obstructed. - player.sendMessage(Text.translatable("block.minecraft.spawn.not_valid"), false); + player.sendMessage(new TranslatableText("block.minecraft.spawn.not_valid"), false); teleportToWorldSpawn(player, serverPlayer); } } else { @@ -139,7 +139,7 @@ public int getMaxUseTime(ItemStack stack) { private void teleportToWorldSpawn(PlayerEntity player, ServerPlayerEntity serverPlayer) { if (!isInterdimensional && serverPlayer.getWorld().getRegistryKey() != ServerWorld.OVERWORLD) { // This mirror is too weak to cross the veil between worlds! Maybe a rare nether metal could help... - player.sendMessage(Text.translatable("balancedrecall.fail_cross_dimension"), false); + player.sendMessage(new TranslatableText("balancedrecall.fail_cross_dimension"), false); return; } diff --git a/src/main/java/net/balancedrecall/SleepingMat.java b/src/main/java/net/balancedrecall/SleepingMat.java index 525b9a7..d575ebc 100644 --- a/src/main/java/net/balancedrecall/SleepingMat.java +++ b/src/main/java/net/balancedrecall/SleepingMat.java @@ -11,6 +11,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.text.MutableText; import net.minecraft.text.Text; +import net.minecraft.text.TranslatableText; import net.minecraft.util.Hand; import net.minecraft.util.TypedActionResult; import net.minecraft.util.math.Box; @@ -21,10 +22,10 @@ import net.minecraft.stat.Stats; public class SleepingMat extends Item { - public static final MutableText USER_DEAD = Text.translatable("item.balancedrecall.sleeping_mat.user_dead"); - public static final MutableText ALREADY_ASLEEP = Text.translatable("item.balancedrecall.sleeping_mat.already_asleep"); - public static final MutableText WRONG_DIMENSION = Text.translatable("item.balancedrecall.sleeping_mat.wrong_dimension"); - public static final MutableText NOT_POSSIBLE = Text.translatable("sleep.not_possible"); + public static final MutableText USER_DEAD = new TranslatableText("item.balancedrecall.sleeping_mat.user_dead"); + public static final MutableText ALREADY_ASLEEP = new TranslatableText("item.balancedrecall.sleeping_mat.already_asleep"); + public static final MutableText WRONG_DIMENSION = new TranslatableText("item.balancedrecall.sleeping_mat.wrong_dimension"); + public static final MutableText NOT_POSSIBLE = new TranslatableText("sleep.not_possible"); public static final Text NOT_POSSIBLE_NOW = PlayerEntity.SleepFailureReason.NOT_POSSIBLE_NOW.getMessage(); public static final Text NOT_SAFE = PlayerEntity.SleepFailureReason.NOT_SAFE.getMessage(); @@ -52,7 +53,7 @@ public TypedActionResult use(World world, PlayerEntity user, Hand han user.sendMessage(ALREADY_ASLEEP, false); return TypedActionResult.pass(stack); - } else if (!world.getDimension().natural()) { + } else if (!world.getDimension().isNatural()) { // Wrong dimension user.sendMessage(WRONG_DIMENSION, false); return TypedActionResult.pass(stack); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 9847906..5be2a72 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "balancedrecall", - "version": "1.0.0", + "version": "1.0.2", "name": "Balanced Recall", "description": "Mirrors and a mat", @@ -30,12 +30,9 @@ ], "depends": { - "fabricloader": ">=0.11.3", - "fabric": "*", - "minecraft": "1.19.*", + "fabricloader": ">=0.14.8", + "fabric": ">=0.58.0", + "minecraft": "1.18.*", "java": ">=17" - }, - "suggests": { - "another-mod": "*" } }