Skip to content

Commit

Permalink
Backport to 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AlurienFlame committed Jul 31, 2022
1 parent 913e22e commit 998ac2a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions src/main/java/net/balancedrecall/MagicMirror.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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 {
Expand Down Expand Up @@ -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;
}

Expand Down
11 changes: 6 additions & 5 deletions src/main/java/net/balancedrecall/SleepingMat.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();

Expand Down Expand Up @@ -52,7 +53,7 @@ public TypedActionResult<ItemStack> 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);
Expand Down
11 changes: 4 additions & 7 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "balancedrecall",
"version": "1.0.0",
"version": "1.0.2",

"name": "Balanced Recall",
"description": "Mirrors and a mat",
Expand Down Expand Up @@ -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": "*"
}
}

0 comments on commit 998ac2a

Please sign in to comment.