Small fix to remembrance essence
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ mod_name=Ascend: SbA
|
|||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=All Rights Reserved
|
mod_license=All Rights Reserved
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=2.0.0
|
mod_version=2.0.1
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
|||||||
@@ -26,8 +26,7 @@ public class RemembranceEssenceItem extends Item {
|
|||||||
}
|
}
|
||||||
return InteractionResultHolder.sidedSuccess(stack, level.isClientSide());
|
return InteractionResultHolder.sidedSuccess(stack, level.isClientSide());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Essence is consumed after the action is performed
|
|
||||||
public static void consume(Player player) {
|
public static void consume(Player player) {
|
||||||
for (InteractionHand hand : InteractionHand.values()) {
|
for (InteractionHand hand : InteractionHand.values()) {
|
||||||
ItemStack item = player.getItemInHand(hand);
|
ItemStack item = player.getItemInHand(hand);
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package net.fretux.ascend.network;
|
package net.fretux.ascend.network;
|
||||||
|
|
||||||
|
import net.fretux.ascend.compat.AscendMMCompat;
|
||||||
|
import net.fretux.ascend.item.RemembranceEssenceItem;
|
||||||
import net.fretux.ascend.player.PlayerStatsProvider;
|
import net.fretux.ascend.player.PlayerStatsProvider;
|
||||||
|
import net.fretux.mindmotion.player.PlayerCapabilityProvider;
|
||||||
import net.minecraft.network.FriendlyByteBuf;
|
import net.minecraft.network.FriendlyByteBuf;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
@@ -36,6 +39,7 @@ public class ServerboundShrineChoicePacket {
|
|||||||
stats.addKnowledge(-15);
|
stats.addKnowledge(-15);
|
||||||
stats.refundAllPoints();
|
stats.refundAllPoints();
|
||||||
player.sendSystemMessage(Component.literal("YOU ARE A BLANK SLATE. EMPTY. FORGOTTEN."));
|
player.sendSystemMessage(Component.literal("YOU ARE A BLANK SLATE. EMPTY. FORGOTTEN."));
|
||||||
|
RemembranceEssenceItem.consume(player);
|
||||||
} else {
|
} else {
|
||||||
player.sendSystemMessage(Component.literal("YOUR MIND IS TOO EMPTY TO BE WORTH MY TOUCH."));
|
player.sendSystemMessage(Component.literal("YOUR MIND IS TOO EMPTY TO BE WORTH MY TOUCH."));
|
||||||
player.hurt(player.level().damageSources().magic(), 4.0F);
|
player.hurt(player.level().damageSources().magic(), 4.0F);
|
||||||
@@ -45,46 +49,35 @@ public class ServerboundShrineChoicePacket {
|
|||||||
}
|
}
|
||||||
PlayerStatsProvider.sync(player);
|
PlayerStatsProvider.sync(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
case "understand" -> {
|
case "understand" -> {
|
||||||
if (!net.fretux.ascend.compat.AscendMMCompat.isMindMotionPresent())
|
if (!AscendMMCompat.isMindMotionPresent()) return;
|
||||||
return;
|
player.getCapability(PlayerCapabilityProvider.SANITY).ifPresent(sanity -> {
|
||||||
|
|
||||||
player.getCapability(net.fretux.mindmotion.player.PlayerCapabilityProvider.SANITY).ifPresent(sanity -> {
|
|
||||||
|
|
||||||
float sanityPercent = sanity.getSanity() / sanity.getMaxSanity();
|
float sanityPercent = sanity.getSanity() / sanity.getMaxSanity();
|
||||||
|
|
||||||
if (sanityPercent >= 0.90f) {
|
if (sanityPercent >= 0.90f) {
|
||||||
stats.addKnowledge(5);
|
stats.addKnowledge(5);
|
||||||
sanity.setSanity(0);
|
sanity.setSanity(0);
|
||||||
sanity.setInsanity(0);
|
sanity.setInsanity(0);
|
||||||
|
|
||||||
player.sendSystemMessage(Component.literal("YOUR MIND EXPANDS AS IT BREAKS."));
|
player.sendSystemMessage(Component.literal("YOUR MIND EXPANDS AS IT BREAKS."));
|
||||||
|
RemembranceEssenceItem.consume(player);
|
||||||
} else {
|
} else {
|
||||||
player.sendSystemMessage(Component.literal("YOUR MIND IS NOT YET CLEAR ENOUGH."));
|
player.sendSystemMessage(Component.literal("YOUR MIND IS NOT YET CLEAR ENOUGH."));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
PlayerStatsProvider.sync(player);
|
PlayerStatsProvider.sync(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
case "rest" -> {
|
case "rest" -> {
|
||||||
if (!net.fretux.ascend.compat.AscendMMCompat.isMindMotionPresent())
|
if (!AscendMMCompat.isMindMotionPresent()) return;
|
||||||
return;
|
|
||||||
|
|
||||||
if (stats.getKnowledge() >= 10) {
|
if (stats.getKnowledge() >= 10) {
|
||||||
stats.addKnowledge(-10);
|
stats.addKnowledge(-10);
|
||||||
|
player.getCapability(PlayerCapabilityProvider.SANITY).ifPresent(sanity -> {
|
||||||
player.getCapability(net.fretux.mindmotion.player.PlayerCapabilityProvider.SANITY).ifPresent(sanity -> {
|
|
||||||
sanity.setSanity(sanity.getMaxSanity());
|
sanity.setSanity(sanity.getMaxSanity());
|
||||||
sanity.setInsanity(0);
|
sanity.setInsanity(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
player.sendSystemMessage(Component.literal("THE SHRINE RESTORES YOUR FRACTURED MIND."));
|
player.sendSystemMessage(Component.literal("THE SHRINE RESTORES YOUR FRACTURED MIND."));
|
||||||
|
RemembranceEssenceItem.consume(player);
|
||||||
} else {
|
} else {
|
||||||
player.sendSystemMessage(Component.literal("YOU LACK THE KNOWLEDGE TO REST."));
|
player.sendSystemMessage(Component.literal("YOU LACK THE KNOWLEDGE TO REST."));
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerStatsProvider.sync(player);
|
PlayerStatsProvider.sync(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
"item.ascend.moonseye_tome.used": "You gained %s Knowledge from the Moonseye Tome!",
|
"item.ascend.moonseye_tome.used": "You gained %s Knowledge from the Moonseye Tome!",
|
||||||
"itemGroup.ascend": "Ascend",
|
"itemGroup.ascend": "Ascend",
|
||||||
"ascend.attribute.display": "%s: %s",
|
"ascend.attribute.display": "%s: %s",
|
||||||
"ascend.stats.knowledge": "Knowledge: %s"
|
"ascend.stats.knowledge": "Knowledge: %s",
|
||||||
|
"item.ascend.remembrance_essence": "Remembrance Essence"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user