Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SammySemicolon committed Nov 25, 2023
1 parent 079007d commit c63be26
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 12 deletions.
14 changes: 7 additions & 7 deletions src/generated/resources/assets/malum/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,26 +226,26 @@
"death.attack.scythe_sweep.player": "%s was sliced in twain by %s",
"death.attack.voodoo": "%s's soul shattered",
"death.attack.voodoo.player": "%s's soul was shattered by %s",
"effect.malum.aethers_charm": "Aether'''s Charm",
"effect.malum.aethers_charm": "Aether's Charm",
"effect.malum.aethers_charm.description": "The heavens call for you, increasing jump height and decreasing gravity.",
"effect.malum.anglers_lure": "Angler'''s Lure",
"effect.malum.anglers_lure": "Angler's Lure",
"effect.malum.anglers_lure.description": "Let any fish who meets my gaze learn the true meaning of fear; for I am the harbinger of death. The bane of creatures sub-aqueous, my rod is true and unwavering as I cast into the aquatic abyss. A man, scorned by this uncaring Earth, finds solace in the sea. My only friend, the worm upon my hook. Wriggling, writhing, struggling to surmount the mortal pointlessness that permeates this barren world. I am alone. I am empty. And yet, I fish.",
"effect.malum.cancerous_growth": "Cancerou'''s Growth",
"effect.malum.cancerous_growth": "Cancerous Growth",
"effect.malum.earthen_might": "Earthen Might",
"effect.malum.earthen_might.description": "Your fists and tools are reinforced with earth, increasing your overall damage.",
"effect.malum.gaian_bulwark": "Gaian Bulwark",
"effect.malum.gaian_bulwark.description": "You are protected by an earthen bulwark, increasing your armor.",
"effect.malum.gluttony": "Gluttony",
"effect.malum.gluttony.description": "You feed on the vulnerable, increasing scythe proficiency and gradually restoring lost hunger.",
"effect.malum.ifrits_embrace": "Ifrit'''s Embrace",
"effect.malum.ifrits_embrace": "Ifrit's Embrace",
"effect.malum.ifrits_embrace.description": "The warm embrace of fire coats your soul, mending your seared scars.",
"effect.malum.miners_rage": "Miner'''s Rage",
"effect.malum.miners_rage": "Miner's Rage",
"effect.malum.miners_rage.description": "Your tools are bolstered with radiance, increasing your mining and attack speed.",
"effect.malum.poseidons_grasp": "Poseidon'''s Grasp",
"effect.malum.poseidons_grasp": "Poseidon's Grasp",
"effect.malum.poseidons_grasp.description": "You reach out for further power, increasing your reach and item pickup distance.",
"effect.malum.rejected": "Rejected",
"effect.malum.wicked_intent": "Wicked Intent",
"effect.malum.zephyrs_courage": "Zephyr'''s Courage",
"effect.malum.zephyrs_courage": "Zephyr's Courage",
"effect.malum.zephyrs_courage.description": "The zephyr propels you forward, increasing your movement speed.",
"enchantment.malum.haunted": "Haunted",
"enchantment.malum.haunted.desc": "Deals extra magic damage.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ protected AbstractMalumScreen(Component pTitle) {
public abstract Supplier<SoundEvent> getSweetenerSound();

public void playPageFlipSound(Supplier<SoundEvent> soundEvent, float pitch) {
playSound(soundEvent, 1, Math.max(1, pitch * 0.8f));
playSound(soundEvent, 0.5f, Math.max(1, pitch * 0.8f));
playSound(getSweetenerSound(), 0.2f, pitch);
}

public void playSweetenedSound(Supplier<SoundEvent> soundEvent, float sweetenerPitch) {
playSound(soundEvent, 1, 1);
playSound(getSweetenerSound(), 0.2f, sweetenerPitch);
playSound(soundEvent, 0.5f, 1);
playSound(getSweetenerSound(), 0.1f, sweetenerPitch);
}

public void playSound(Supplier<SoundEvent> soundEvent, float volume, float pitch) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sammy.malum.common.block.curiosities.spirit_crucible;

import com.sammy.malum.common.block.*;
import com.sammy.malum.common.block.storage.*;
import com.sammy.malum.common.item.impetus.*;
import com.sammy.malum.common.item.spirit.*;
import com.sammy.malum.common.packets.particle.curiosities.altar.*;
Expand Down Expand Up @@ -197,6 +198,35 @@ public void tick() {
}
float speed = acceleratorData == null ? 0 : acceleratorData.speedIncrease;
if (level instanceof ServerLevel) {
if (level.getBlockEntity(worldPosition.above(2)) instanceof MalumItemHolderBlockEntity itemHolderBlockEntity) {
ItemStack repairStack = itemHolderBlockEntity.inventory.getStackInSlot(0);
if (!repairStack.isEmpty()) {
final ItemStack repairedStack = inventory.getStackInSlot(0);
SpiritRepairRecipe repairRecipe = SpiritRepairRecipe.getRecipe(level, repairedStack, repairStack, spiritInventory.nonEmptyItemStacks);
if (repairRecipe != null) {
if (repairedStack.isDamaged()) {
float repaired = repairedStack.getMaxDamage() * repairRecipe.durabilityPercentage;
int newDurability = (int) Math.min(0, repairedStack.getDamageValue() - repaired);
repairedStack.setDamageValue(newDurability);
}
if (repairedStack.getItem() instanceof CrackedImpetusItem crackedImpetusItem) {
inventory.setStackInSlot(0, new ItemStack(crackedImpetusItem.impetus));
}
repairStack.shrink(repairRecipe.repairMaterial.count);
for (SpiritWithCount spirit : repairRecipe.spirits) {
for (int i = 0; i < spiritInventory.slotCount; i++) {
ItemStack spiritStack = spiritInventory.getStackInSlot(i);
if (spirit.matches(spiritStack)) {
spiritStack.shrink(spirit.count);
break;
}
}
}
BlockHelper.updateAndNotifyState(level, worldPosition);
BlockHelper.updateAndNotifyState(level, worldPosition.above(2));
}
}
}
if (recipe != null) {
if (acceleratorData != null) {
boolean needsRecalibration = !acceleratorData.accelerators.stream().allMatch(ICrucibleAccelerator::canContinueAccelerating);
Expand All @@ -212,6 +242,7 @@ public void tick() {
} else {
progress = 0;
}

}
else {
spiritSpin += 1 + speed * 0.1f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class CurioTokenOfGratitude extends MalumCurioItem implements IEventRespo
public static final UUID DELLY = validateForGratitude("7c3a2f88-f6b8-47ff-971d-73544eb5ae62");
public static final UUID LOFI = validateForGratitude("85715c8f-4f71-4ebd-9f3a-96dfd8e8e390");
public static final UUID CREECHURE = validateForGratitude("9acb0ed8-a6a3-46bc-a6ff-23c176e5ec3d");
public static final UUID SALT = validateForGratitude("3585541f-8289-45a9-b8d7-6729bb1d95da");

static {
addTransScarf(validateForGratitude("72155db3-d5e4-47fa-8200-c85bf7f87370")); //copilot says it's 'Snake'
Expand All @@ -52,7 +53,7 @@ public CurioTokenOfGratitude(Properties builder) {
@Override
public void curioTick(SlotContext slotContext, ItemStack stack) {
if (slotContext.entity() instanceof Player player) {
if (player.getUUID().equals(SAMMY) || player.getUUID().equals(LOFI) || player.getUUID().equals(CREECHURE)) {
if (player.getUUID().equals(SAMMY) || player.getUUID().equals(LOFI) || player.getUUID().equals(CREECHURE) || player.getUUID().equals(SALT)) {
int interval = player.isCrouching() ? 10 : 4000;
if (player.level().getGameTime() % interval == 0) {
SoundEvent soundEvent = player.getRandom().nextInt(8) == 0 ? SoundEvents.CAT_PURREOW : SoundEvents.CAT_PURR;
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/sammy/malum/data/MalumLang.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ protected void addTranslations() {
String[] replacements = new String[]{"ns_", "rs_", "ts_"};
String alteredPath = e.getId().getPath();
for (String replacement : replacements) {
alteredPath = alteredPath.replaceFirst("s_", "'s_");
int index = alteredPath.indexOf(replacement);
if (index != -1) {
alteredPath = alteredPath.replaceFirst("s_", "'s_");
break;
}
}
String name = DataHelper.toTitleCase(alteredPath, "_");
add("effect.malum." + ForgeRegistries.MOB_EFFECTS.getKey(e.get()).getPath(), name);
Expand Down

0 comments on commit c63be26

Please sign in to comment.