Skip to content

Commit

Permalink
fix cold snap spell and spell book tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
reoseah committed Oct 30, 2024
1 parent c9f0906 commit a8f7b2a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> to
super.appendTooltip(stack, context, tooltip, type);
var pages = stack.get(PAGES);
if (pages != null && !pages.isEmpty()) {
tooltip.add(Text.translatable("item.magisterium.spell_book.pages", pages.size()).formatted(Formatting.GRAY));
var nonEmptyCount = pages.stream().filter(page -> !page.isEmpty()).count();
tooltip.add(Text.translatable("item.magisterium.spell_book.pages", nonEmptyCount).formatted(Formatting.GRAY));
} else {
tooltip.add(Text.translatable("item.magisterium.spell_book.empty").formatted(Formatting.GRAY));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public ItemStack craft(SpellBookRecipeInput input, RegistryWrapper.WrapperLookup
chance = 0;
}
if (world.random.nextDouble() < chance) {
if (MagisteriumPlaygrounds.trySetBlockState(world, pos, frozen, input.player)) {
if (MagisteriumPlaygrounds.trySetBlockState(world, pos.down(), frozen, input.player)) {
hasFrozen = true;
} else {
hasFailed = true;
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/assets/magisterium/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"item.magisterium.spell_book.pages": "%s Entries",
"item.magisterium.spell_page": "Spell Page",
"item.magisterium.bookmark": "Silk Bookmark",
"tags.item.magisterium.spell_pages": "Spell Pages",
"tags.item.magisterium.spell_book_components": "Spell Book Components",
"tags.item.magisterium.conflagrate_ingredients": "Conflagrate Ingredients",
"container.magisterium.arcane_table": "Arcane Table",
Expand All @@ -25,7 +26,7 @@
"magisterium.gui.no_glyphs_found": "No glyphs were found in range",
"magisterium.gui.invalid_illusion_block": "Cannot create illusion of this block",
"magisterium.gui.no_targets": "Could not find any targets for the spell",
"magisterium.gui.partial_success": "Some blocks could not be modified",
"magisterium.gui.partial_success": "You can't modify some of the targets",
"magisterium.gui.no_success": "You can't modify the world here",
"magisterium.spell.magisterium.awaken_the_flame": "Awaken the Flame",
"magisterium.spell.magisterium.awaken_the_flame.heading": "ᴀᴡᴀᴋᴇɴ ᴛʜᴇ ꜰʟᴀᴍᴇ",
Expand Down

0 comments on commit a8f7b2a

Please sign in to comment.