-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f4b1f0
commit 9d58ccc
Showing
8 changed files
with
95 additions
and
20 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.client.render.FogShape; | ||
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 fogDistanceMultiplier = 0.5f; | ||
|
||
float f = effect.isInfinite() ? 5.0F : MathHelper.lerp(Math.min(1.0F, (float) effect.getDuration() / 20.0F), viewDistance, 5.0F); | ||
fogData.fogStart = f * 2.0F * fogDistanceMultiplier; | ||
fogData.fogEnd = f * 4.0F * fogDistanceMultiplier; | ||
fogData.fogShape = FogShape.SPHERE; | ||
} | ||
} |
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
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
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
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
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
11 changes: 11 additions & 0 deletions
11
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package dev.hybridlabs.aquatic.effect | ||
|
||
import net.minecraft.entity.effect.StatusEffect | ||
import net.minecraft.entity.effect.StatusEffectCategory | ||
|
||
class Thalassophobia : StatusEffect(StatusEffectCategory.HARMFUL, 0x606060) { | ||
|
||
override fun canApplyUpdateEffect(duration: Int, amplifier: Int): Boolean { | ||
return duration % 40 == 0 | ||
} | ||
} |
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