Skip to content

Commit

Permalink
feat: evil whirlwinds
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Dec 22, 2024
1 parent 0499a94 commit f46af89
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public static void registerLayerDefinitions(EntityRenderersEvent.RegisterLayerDe
public static void registerEntityRenderers(EntityRenderersEvent.RegisterRenderers event) {
Redux.BLOCK_SETS.forEach(set -> set.registerRenderers(event));
event.registerEntityRenderer(AetherEntityTypes.WHIRLWIND.get(), ReduxWhirlwindRenderer::new);
event.registerEntityRenderer(AetherEntityTypes.EVIL_WHIRLWIND.get(), ReduxWhirlwindRenderer::new);
}

public static void registerAccessoryRenderers() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraft.client.model.geom.builders.PartDefinition;
import net.minecraft.util.Mth;
import net.zepalesque.zenith.util.EasingUtil;
import net.zepalesque.zenith.util.MathUtil;
import org.jetbrains.annotations.NotNull;

import java.util.Arrays;
Expand Down Expand Up @@ -83,13 +82,13 @@ public void setupAnim(@NotNull T entity, float limbSwing, float limbSwingAmount,
final int total = length + offset * 3;
if (ageInTicks < total) {
for (int i = 0; i < 4; i++) {
float prog = MathUtil.clampedInverp(ageInTicks - 1 - offset * i, 0, length);
float prog = Math.clamp(ageInTicks - 1 - offset * i, 0, length) / length;
int a = (Math.round(255F * EasingUtil.Sinusoidal.inOut(prog)) << 24) | mask;
alpha[i] = a;
}
} else if (entity.deathTime < total && entity.deathTime > 0) {
for (int i = 0; i < 4; i++) {
float prog = 1 - MathUtil.clampedInverp(ageInTicks - 1 - offset * i, 0, length);
float prog = 1F - Math.clamp(entity.deathTime + ageInTicks % 1 - offset * i, 0, length) / length;
int a = (Math.round(255F * EasingUtil.Sinusoidal.inOut(prog)) << 24) | mask;
alpha[i] = a;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f46af89

Please sign in to comment.