Update dependencies, enhance fortitude health handling and lifecycle logic, and update changelog
This commit is contained in:
@@ -2,6 +2,17 @@
|
|||||||
|
|
||||||
This changelog covers all recorded changes after `1.0.0`, grouped by release version from the git history.
|
This changelog covers all recorded changes after `1.0.0`, grouped by release version from the git history.
|
||||||
|
|
||||||
|
## 2.4.3
|
||||||
|
|
||||||
|
- Updated Forge to `47.4.22`, Iron's Spellbooks to `3.16.2`, GeckoLib to `4.8.4`, Curios to `5.14.1`, and Caelus to `3.2.0`.
|
||||||
|
- Updated Mind & Motion and the Skill Engine development runtime addon to `1.4.5`.
|
||||||
|
- Centralized the Mind & Motion and Skill Engine versions in `gradle.properties`.
|
||||||
|
|
||||||
|
## 2.4.2
|
||||||
|
|
||||||
|
- Persisted fortitude max-health modifiers so saved current health above the vanilla 20 HP limit is retained when players rejoin.
|
||||||
|
- Restored full modified health again on the first server tick after login or death respawn to prevent later lifecycle initialization from reverting it to 20 HP.
|
||||||
|
|
||||||
## 2.4.1
|
## 2.4.1
|
||||||
|
|
||||||
- Fixed rejoining players with fortitude bonus health being left at the vanilla 20 HP after their increased maximum health was restored.
|
- Fixed rejoining players with fortitude bonus health being left at the vanilla 20 HP after their increased maximum health was restored.
|
||||||
|
|||||||
+5
-1
@@ -135,7 +135,11 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||||
|
|
||||||
implementation fg.deobf("net.fretux.mindmotion:mindmotion:1.4.2")
|
implementation fg.deobf("net.fretux.mindmotion:mindmotion:${mindmotion_version}")
|
||||||
|
|
||||||
|
// Skill Engine is an Ascend addon, so include it in development runs without
|
||||||
|
// creating a circular mandatory dependency from Ascend back to Skill Engine.
|
||||||
|
runtimeOnly fg.deobf("net.fretux.skillengine:SkillEngine:${skillengine_version}")
|
||||||
|
|
||||||
// Iron's Spellbooks API only
|
// Iron's Spellbooks API only
|
||||||
compileOnly fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${irons_spells_version}:api")
|
compileOnly fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${irons_spells_version}:api")
|
||||||
|
|||||||
+8
-6
@@ -13,7 +13,7 @@ minecraft_version=1.20.1
|
|||||||
# as they do not follow standard versioning conventions.
|
# as they do not follow standard versioning conventions.
|
||||||
minecraft_version_range=[1.20.1]
|
minecraft_version_range=[1.20.1]
|
||||||
# The Forge version must agree with the Minecraft version to get a valid artifact
|
# The Forge version must agree with the Minecraft version to get a valid artifact
|
||||||
forge_version=47.4.0
|
forge_version=47.4.22
|
||||||
# The Forge version range can use any version of Forge as bounds or match the loader version range
|
# The Forge version range can use any version of Forge as bounds or match the loader version range
|
||||||
forge_version_range=[47,)
|
forge_version_range=[47,)
|
||||||
# The loader version range can only use the major version of Forge/FML as bounds
|
# The loader version range can only use the major version of Forge/FML as bounds
|
||||||
@@ -22,10 +22,12 @@ loader_version_range=[47,)
|
|||||||
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
|
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
|
||||||
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
|
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
|
||||||
#
|
#
|
||||||
irons_spells_version=1.20.1-3.4.0.11
|
mindmotion_version=1.4.5
|
||||||
caelus_version=3.1.0+1.20
|
skillengine_version=1.4.5
|
||||||
curios_version=5.4.7+1.20.1
|
irons_spells_version=1.20.1-3.16.2
|
||||||
geckolib_version=1.20.1:4.7.1.1
|
caelus_version=3.2.0+1.20.1
|
||||||
|
curios_version=5.14.1+1.20.1
|
||||||
|
geckolib_version=1.20.1:4.8.4
|
||||||
player_animator_version=1.0.2-rc1+1.20
|
player_animator_version=1.0.2-rc1+1.20
|
||||||
# | Channel | Version | |
|
# | Channel | Version | |
|
||||||
# |-----------|----------------------|--------------------------------------------------------------------------------|
|
# |-----------|----------------------|--------------------------------------------------------------------------------|
|
||||||
@@ -53,7 +55,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.4.1
|
mod_version=2.4.3
|
||||||
# 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
|
||||||
|
|||||||
@@ -6,16 +6,22 @@ import net.fretux.ascend.player.StatEffects;
|
|||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraftforge.event.TickEvent;
|
||||||
import net.minecraftforge.event.AttachCapabilitiesEvent;
|
import net.minecraftforge.event.AttachCapabilitiesEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Mod.EventBusSubscriber(modid = AscendMod.MODID)
|
@Mod.EventBusSubscriber(modid = AscendMod.MODID)
|
||||||
public class PlayerEvents {
|
public class PlayerEvents {
|
||||||
|
|
||||||
private static final ResourceLocation PLAYER_STATS_ID =
|
private static final ResourceLocation PLAYER_STATS_ID =
|
||||||
ResourceLocation.fromNamespaceAndPath(AscendMod.MODID, "player_stats");
|
ResourceLocation.fromNamespaceAndPath(AscendMod.MODID, "player_stats");
|
||||||
|
private static final Set<UUID> PENDING_FULL_HEALTH_RESTORE = new HashSet<>();
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onAttachCapabilities(AttachCapabilitiesEvent<Entity> event) {
|
public static void onAttachCapabilities(AttachCapabilitiesEvent<Entity> event) {
|
||||||
@@ -37,6 +43,7 @@ public class PlayerEvents {
|
|||||||
StatEffects.applyAll(event.getEntity());
|
StatEffects.applyAll(event.getEntity());
|
||||||
if (event.isWasDeath()) {
|
if (event.isWasDeath()) {
|
||||||
event.getEntity().setHealth(event.getEntity().getMaxHealth());
|
event.getEntity().setHealth(event.getEntity().getMaxHealth());
|
||||||
|
PENDING_FULL_HEALTH_RESTORE.add(event.getEntity().getUUID());
|
||||||
}
|
}
|
||||||
PlayerStatsProvider.sync(event.getEntity());
|
PlayerStatsProvider.sync(event.getEntity());
|
||||||
}
|
}
|
||||||
@@ -50,8 +57,22 @@ public class PlayerEvents {
|
|||||||
if (Math.abs(healthBeforeFortitude - 20.0F) < 0.001F
|
if (Math.abs(healthBeforeFortitude - 20.0F) < 0.001F
|
||||||
&& event.getEntity().getMaxHealth() > healthBeforeFortitude) {
|
&& event.getEntity().getMaxHealth() > healthBeforeFortitude) {
|
||||||
event.getEntity().setHealth(event.getEntity().getMaxHealth());
|
event.getEntity().setHealth(event.getEntity().getMaxHealth());
|
||||||
|
PENDING_FULL_HEALTH_RESTORE.add(event.getEntity().getUUID());
|
||||||
}
|
}
|
||||||
PlayerStatsProvider.sync(event.getEntity());
|
PlayerStatsProvider.sync(event.getEntity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||||
|
Player player = event.player;
|
||||||
|
if (player.level().isClientSide
|
||||||
|
|| event.phase != TickEvent.Phase.END
|
||||||
|
|| !PENDING_FULL_HEALTH_RESTORE.remove(player.getUUID())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
StatEffects.applyAll(player);
|
||||||
|
player.setHealth(player.getMaxHealth());
|
||||||
|
PlayerStatsProvider.sync(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,9 @@ public final class StatEffects {
|
|||||||
hp.removeModifier(FORTITUDE_HEALTH_UUID);
|
hp.removeModifier(FORTITUDE_HEALTH_UUID);
|
||||||
if (fortitudeLevel > 0) {
|
if (fortitudeLevel > 0) {
|
||||||
double healthBonus = Math.min(fortitudeLevel * 0.18d * getScaling(), 18.0d);
|
double healthBonus = Math.min(fortitudeLevel * 0.18d * getScaling(), 18.0d);
|
||||||
hp.addTransientModifier(new AttributeModifier(
|
// Max health must be present while Minecraft loads the player's saved Health
|
||||||
|
// value, otherwise values above the vanilla 20 HP are clamped before login.
|
||||||
|
hp.addPermanentModifier(new AttributeModifier(
|
||||||
FORTITUDE_HEALTH_UUID,
|
FORTITUDE_HEALTH_UUID,
|
||||||
"Ascend Fortitude health bonus",
|
"Ascend Fortitude health bonus",
|
||||||
healthBonus,
|
healthBonus,
|
||||||
|
|||||||
Reference in New Issue
Block a user