Skip to content

Conversation

@Dubledice
Copy link
Owner

No description provided.

Fixed effect consumption logic for certain effects like Overheat.
@Dubledice Dubledice changed the base branch from 1.20-Forge to pr/threshold-decay September 4, 2025 19:57
continue;
}
var extraEff = ExileDB.ExileEffects().get(effId);
if (extraEff != null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to stop code execution early

Suggested change
if (extraEff != null) {
if (extraEff = null) {
continue;
}

}
var extraEff = ExileDB.ExileEffects().get(effId);
if (extraEff != null) {
var unitT = com.robertx22.mine_and_slash.uncommon.datasaving.Load.Unit(target);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use an import

Suggested change
var unitT = com.robertx22.mine_and_slash.uncommon.datasaving.Load.Unit(target);
var unitT = Load.Unit(target);

if (extraEff != null) {
var unitT = com.robertx22.mine_and_slash.uncommon.datasaving.Load.Unit(target);
var storeT = unitT.getStatusEffectsData();
var instT = storeT.getOrCreate(extraEff);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use EffectUtils.applyEffect instead and set other fields after this

instT.caster_uuid = caster.getStringUUID();
try { extraEff.onApply(target); } catch (Exception ignored) {}
unitT.equipmentCache.STATUS.setDirty();
unitT.sync.setDirty();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be done once after the for loop

instT.is_infinite = false;
instT.caster_uuid = caster.getStringUUID();
try { extraEff.onApply(target); } catch (Exception ignored) {}
unitT.equipmentCache.STATUS.setDirty();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happens during onApply function

Suggested change
unitT.equipmentCache.STATUS.setDirty();

Objects.requireNonNull(data);
LivingEntity target = sourceEntity instanceof LivingEntity ? (LivingEntity) sourceEntity : null;
return new SpellCtx(EntityActivation.ON_EXPIRE, sourceEntity, caster, target, data);
SpellCtx ctx = new SpellCtx(EntityActivation.ON_EXPIRE, sourceEntity, caster, target, data);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the wrong activation entity you used here

  1. You should rename EntityActivation.ON_EXPIRE to EntityActivation.ON_ENTITY_EXPIRE.
  2. Create new EntityActivation.ON_EFFECT_EXPIRE
  3. Create new method SpellCtx.onEffectExpire
  4. Replace all usages of SpellCtx.onExpire with SpellCtx.onEffectExpire

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would require massive refactoring. ON_EXPIRE was preexisting and was either made by Mahj or Robert, I think. ComponentPart, ExileEffectAction, onExpireCondition, ExpireAction, SpellBuilder, etc. would all be affected. If any datapack builders reference ON_EXPIRE they are sure to break as well.

How essential is this change?

@Dubledice Dubledice requested a review from SaloEater September 5, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants