Skip to content

Commit bb46334

Browse files
committed
Merge remote-tracking branch 'origin/1.19-deeper-down' into 1.19-deeper-down
2 parents 84d7963 + 53f3832 commit bb46334

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/main/java/de/dafuqs/spectrum/cca/OnPrimordialFireComponent.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ public class OnPrimordialFireComponent implements Component, AutoSyncedComponent
2424

2525
public static final float DAMAGE_ON_TICK = 1.0F;
2626

27+
// Delay added to the primordial fire ticking per level of fire resistance on provider
28+
public static final int FIRE_RESISTANCE_TICK_DELAY = 5;
29+
// Delay added to the primordial fire ticking for the highest level of Fire Protection on provider
30+
public static final float FIRE_PROTECTION_TICK_DELAY = 1.0F;
31+
2732
public static final ComponentKey<OnPrimordialFireComponent> ON_PRIMORDIAL_FIRE_COMPONENT = ComponentRegistry.getOrCreate(SpectrumCommon.locate("on_primordial_fire"), OnPrimordialFireComponent.class);
2833

2934
private LivingEntity provider;
@@ -104,10 +109,10 @@ public void serverTick() {
104109
* Primordial fire's DPS ranges from 4 to 1.
105110
*/
106111
public int getDamageTickFrequency(LivingEntity entity) {
107-
float fireProt = EnchantmentHelper.getEquipmentLevel(Enchantments.FIRE_PROTECTION, provider) / 2F;
108-
int fireRes = Optional.ofNullable(provider.getStatusEffect(StatusEffects.FIRE_RESISTANCE)).map(StatusEffectInstance::getAmplifier).orElse(0);
112+
float fireProt = FIRE_PROTECTION_TICK_DELAY * (EnchantmentHelper.getEquipmentLevel(Enchantments.FIRE_PROTECTION, provider) / 2F);
113+
int fireRes = FIRE_RESISTANCE_TICK_DELAY + Optional.ofNullable(provider.getStatusEffect(StatusEffects.FIRE_RESISTANCE)).map(StatusEffectInstance::getAmplifier).orElse(-FIRE_RESISTANCE_TICK_DELAY);
109114
int duration = Math.min(Math.round(5 + fireRes + fireProt), 20);
110-
return entity.isFireImmune() ? duration / 2 : duration;
115+
return entity.isFireImmune() ? duration : duration / 2;
111116
}
112117

113118
@Override

src/main/java/de/dafuqs/spectrum/registries/SpectrumDamageSources.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public SetHealthDamageSource(String name, LivingEntity attacker) {
6868
}
6969
}
7070

71-
public static class PrimordialFireDamageSource extends DamageSource implements DirectDamage {
71+
public static class PrimordialFireDamageSource extends DamageSource {
7272

7373
public PrimordialFireDamageSource(String name) {
7474
super(name);

0 commit comments

Comments
 (0)