-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
75 additions
and
31 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/client/java/dev/hybridlabs/aquatic/fog/ThalassophobiaFogModifier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package dev.hybridlabs.aquatic.fog; | ||
|
||
import dev.hybridlabs.aquatic.effect.HybridAquaticStatusEffects; | ||
import net.minecraft.client.render.BackgroundRenderer; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.effect.StatusEffect; | ||
import net.minecraft.entity.effect.StatusEffectInstance; | ||
import net.minecraft.util.math.MathHelper; | ||
|
||
public class ThalassophobiaFogModifier implements BackgroundRenderer.StatusEffectFogModifier { | ||
@Override | ||
public StatusEffect getStatusEffect() { | ||
return HybridAquaticStatusEffects.INSTANCE.getTHALASSOPHOBIA(); | ||
} | ||
|
||
@Override | ||
public void applyStartEndModifier(BackgroundRenderer.FogData fogData, LivingEntity entity, StatusEffectInstance effect, float viewDistance, float tickDelta) { | ||
float f = effect.isInfinite() ? 5.0F : MathHelper.lerp(Math.min(1.0F, (float)effect.getDuration() / 20.0F), viewDistance, 5.0F); | ||
if (fogData.fogType == BackgroundRenderer.FogType.FOG_SKY) { | ||
fogData.fogStart = 0.0F; | ||
fogData.fogEnd = f * 0.8F; | ||
} else { | ||
fogData.fogStart = f * 0.25F; | ||
fogData.fogEnd = f; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/main/kotlin/dev/hybridlabs/aquatic/effect/Thalassophobia.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package dev.hybridlabs.aquatic.effect | ||
|
||
import net.minecraft.entity.LivingEntity | ||
import net.minecraft.entity.effect.StatusEffect | ||
import net.minecraft.entity.effect.StatusEffectCategory | ||
import net.minecraft.entity.effect.StatusEffectInstance | ||
|
||
class Thalassophobia : StatusEffect(StatusEffectCategory.HARMFUL, 0x000000) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters