Skip to content

Commit

Permalink
allow Cold Snap consume Breeze Rods/Wind Charges
Browse files Browse the repository at this point in the history
  • Loading branch information
reoseah committed Nov 2, 2024
1 parent 7f4f612 commit 35c6c6b
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void randomDisplayTick(BlockState state, World world, BlockPos pos, Rando
protected void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
var velocity = entity.getVelocity();
if (entity.isDescending()) {
double velocityY = Math.max(velocity.y, -0.1);
double velocityY = Math.max(velocity.y, -0.15);
entity.setVelocity(velocity.x, velocityY, velocity.z);
} else {
double velocityY = MathHelper.clamp(velocity.y + 0.03, 0.25, 0.75);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.reoseah.magisterium.recipe;

import io.github.reoseah.magisterium.data.ItemValuesLoader;
import io.github.reoseah.magisterium.world.MagisteriumPlaygrounds;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
Expand Down Expand Up @@ -29,7 +30,21 @@ public boolean matches(SpellBookRecipeInput input, World world) {

@Override
public ItemStack craft(SpellBookRecipeInput input, RegistryWrapper.WrapperLookup lookup) {
final int fullFreezeRadius = 11, maxRadius = 15;
int totalValue = 0;
for (int i = 0; i < input.getSize(); i++) {
var stack = input.getStackInSlot(i);
if (!stack.isEmpty()) {
int value = ItemValuesLoader.getValue(stack);
totalValue += value;

stack.decrement(1);
input.inventory.setStack(i, stack);
}
}

int fullFreezeRadius = 3 + totalValue;
int maxRadius = 7 + totalValue;

final var map = new HashMap<BlockState, BlockState>();
map.put(Blocks.WATER.getDefaultState(), Blocks.ICE.getDefaultState());
map.put(Blocks.LAVA.getDefaultState(), Blocks.OBSIDIAN.getDefaultState());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public boolean matches(SpellBookRecipeInput input, World world) {

@Override
public ItemStack craft(SpellBookRecipeInput input, RegistryWrapper.WrapperLookup lookup) {
// TODO: extract this to a helper method, reuse in other recipes
int totalValue = 0;
for (int i = 0; i < input.getSize(); i++) {
var stack = input.getStackInSlot(i);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/magisterium/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"tag.item.magisterium.spell_pages": "Spell Pages",
"tag.item.magisterium.spell_book_components": "Spell Book Components",
"tag.item.magisterium.conflagrate_ingredients": "Conflagrate Ingredients",
"tag.item.magisterium.cold_snap_ingredients": "Cold Snap Ingredients",
"container.magisterium.arcane_table": "Arcane Table",
"subtitles.magisterium.chant": "Chanting",
"subtitles.magisterium.magic_hum": "Magic hums",
Expand Down
12 changes: 12 additions & 0 deletions src/main/resources/assets/magisterium/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"tag.item.magisterium.spell_pages": "Страницы заклинаний",
"tag.item.magisterium.spell_book_components": "Части книги заклинаний",
"tag.item.magisterium.conflagrate_ingredients": "Ингредиенты для заклинания конфлаграция",
"tag.item.magisterium.cold_snap_ingredients": "Ингредиенты для заклинания холодный взрыв",
"container.magisterium.arcane_table": "Мистический стол",
"subtitles.magisterium.chant": "Чтение заклинаний",
"subtitles.magisterium.magic_hum": "Магическое жужжание",
"magisterium.gui.untitled_section": "Без названия",
"magisterium.gui.untitled_section.description": "Переименуйте закладкy, чтобы дать разделу название.",
"magisterium.gui.only_first_seven_bookmarks_will_show": "Отображаются только первые семь закладок",
Expand Down Expand Up @@ -43,4 +46,13 @@
"magisterium.spell.magisterium.illusory_wall.heading": "ɪʟʟᴜsᴏʀɪᴀ ᴍᴜʀᴜs",
"magisterium.spell.magisterium.illusory_wall.components": "Компоненты: материал, из которого должна быть сделана стена, линия мистических глифов на земле",
"magisterium.spell.magisterium.illusory_wall.description": "Создает иллюзорную стену, которая кажется твердой, но может быть пройдена.",
"magisterium.spell.magisterium.arcane_lift": "Волшебный подъем",
"magisterium.spell.magisterium.arcane_lift.heading": "ᴀʀᴄᴀɴᴜᴍ ʟᴇᴠᴀʀᴇ",
"magisterium.spell.magisterium.arcane_lift.components": "Компоненты: круг из восьми мистических глифов, бутыль жидкой магии",
"magisterium.spell.magisterium.arcane_lift.description": "Вызывает поток восходящей мистической энергии, поднимающий существ и объекты в воздух.",
"magisterium.spell.magisterium.arcane_lift.utterance": "Aʀᴄᴀɴᴜᴍ ʟᴇᴠᴀʀᴇ, ᴀᴇᴛʜᴇʀᴀ ᴛᴀɴɢᴀᴍᴜs!\n\nCᴏʀᴘᴏʀᴀ ᴇᴛ ᴍᴇɴs sᴜʀɢᴀɴᴛ, ɪɴ ᴀʟᴛᴜᴍ ᴇʟᴇᴠᴇɴᴛᴜʀ!",
"magisterium.spell.magisterium.dispel_magic": "Рассеять магию",
"magisterium.spell.magisterium.dispel_magic.heading": "ᴅɪssᴏʟᴠᴀᴛɪᴏ ᴍᴀɢɪᴀᴇ",
"magisterium.spell.magisterium.dispel_magic.description": "Заканчивает действие ближайшего заклинания или магического эффекта.",
"magisterium.spell.magisterium.dispel_magic.utterance": "Mᴀɢɪᴀ ᴅɪssᴏʟᴠᴀᴛᴜʀ, ᴠɪɴᴄᴜʟᴀ ᴀʀᴄᴀɴᴀ ʀᴜᴍᴘᴀɴᴛᴜʀ!\n\nNɪʜɪʟ ᴍᴀɴᴇᴀᴛ, ᴀʀs ɪʟʟᴀ ᴇxsᴛɪɴɢᴜᴀᴛᴜʀ!"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"minecraft:breeze_rod",
"minecraft:wind_charge"
]
}

0 comments on commit 35c6c6b

Please sign in to comment.