Skip to content

Commit

Permalink
i dont remember
Browse files Browse the repository at this point in the history
  • Loading branch information
Duzos committed Jan 17, 2025
1 parent a256f2f commit 260fcce
Show file tree
Hide file tree
Showing 15 changed files with 2,293 additions and 56 deletions.
Binary file modified libs/animator-sources.jar
Binary file not shown.
Binary file modified libs/animator.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions src/main/java/mc/duzo/timeless/client/TimelessClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import mc.duzo.timeless.suit.client.animation.impl.ironman.mk5.MarkFiveAnimations;
import mc.duzo.timeless.suit.client.animation.impl.ironman.mk5.MarkFiveCaseAnimation;
import mc.duzo.timeless.suit.client.animation.impl.ironman.mk5.MarkFiveMaskAnimation;
import mc.duzo.timeless.suit.ironman.client.sentry.SentryAnimation;

public class TimelessClient implements ClientModInitializer {
@Override
Expand Down Expand Up @@ -68,6 +69,8 @@ public static void init() {
public static class IronMan {
public static final Supplier<MarkFiveMaskAnimation> MASK_OPEN = AnimationRegistry.instance().register(() -> new SuitAnimationHolder(new Identifier(Timeless.MOD_ID, "ironman_generic_mask_open"), GenericIronManAnimations.MASK_OPEN, new AnimationInfo(AnimationInfo.RenderType.TORSO_HEAD, null, AnimationInfo.Movement.ALLOW, AnimationInfo.Transform.TARGETED), false));
public static final Supplier<MarkFiveMaskAnimation> MASK_CLOSE = AnimationRegistry.instance().register(() -> new SuitAnimationHolder(new Identifier(Timeless.MOD_ID, "ironman_generic_mask_close"), GenericIronManAnimations.MASK_CLOSE, new AnimationInfo(AnimationInfo.RenderType.TORSO_HEAD, null, AnimationInfo.Movement.ALLOW, AnimationInfo.Transform.TARGETED), false));
public static final Supplier<SuitAnimationHolder> BACK_OPEN = AnimationRegistry.instance().register(() -> new SuitAnimationHolder(new Identifier(Timeless.MOD_ID, "ironman_generic_back_open"), SentryAnimation.SUIT_OPEN, new AnimationInfo(AnimationInfo.RenderType.ALL, AnimationInfo.Perspective.THIRD_PERSON_BACK, AnimationInfo.Movement.DISABLE, AnimationInfo.Transform.ALL), false));
public static final Supplier<SuitAnimationHolder> BACK_CLOSE = AnimationRegistry.instance().register(() -> new SuitAnimationHolder(new Identifier(Timeless.MOD_ID, "ironman_generic_back_close"), SentryAnimation.SUIT_OPEN2, new AnimationInfo(AnimationInfo.RenderType.ALL, AnimationInfo.Perspective.THIRD_PERSON_BACK, AnimationInfo.Movement.DISABLE, AnimationInfo.Transform.ALL), false));

public static void init() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import mc.duzo.animation.generic.AnimationHolder;
import mc.duzo.animation.generic.AnimationInfo;

import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.render.entity.animation.Animation;
import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Identifier;

import mc.duzo.timeless.suit.client.render.SuitModel;
Expand All @@ -20,7 +20,7 @@ public SuitAnimationHolder(Identifier id, Animation anim, AnimationInfo info, bo
}

@Override
public void update(EntityModel<?> model, float progress, AbstractClientPlayerEntity player) {
public void update(EntityModel<?> model, float progress, LivingEntity player) {
SuitAnimationHelper.updateAnimation(this.state, this.animation, progress, 1.0f, (SuitModel) model);
this.model = (SuitModel) model;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,17 @@
package mc.duzo.timeless.suit.client.animation;

import java.util.HashMap;
import java.util.UUID;

import mc.duzo.animation.generic.AnimationTracker;

import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.util.Identifier;

import mc.duzo.timeless.Timeless;
import mc.duzo.timeless.registry.Register;

public class SuitAnimationTracker extends AnimationTracker<SuitAnimationHolder> {
private static final HashMap<UUID, SuitAnimationHolder> ANIMATIONS = new HashMap<>();

public SuitAnimationTracker() {
super(new Identifier(Timeless.MOD_ID, "suit"));
}

public static SuitAnimationHolder getAnimation(AbstractClientPlayerEntity entity) {
UUID uuid = entity.getUuid();

SuitAnimationHolder anim = ANIMATIONS.get(uuid);

if (anim != null && anim.isFinished(entity)) {
ANIMATIONS.remove(uuid);
}

return anim;
}
public static void addAnimation(UUID uuid, SuitAnimationHolder animation) {
ANIMATIONS.put(uuid, animation);
}
public static void clearAnimation(UUID uuid) {
ANIMATIONS.remove(uuid);
}

public static SuitAnimationTracker getInstance() {
return Register.Trackers.SUIT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import mc.duzo.animation.generic.AnimationInfo;

import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Identifier;

import mc.duzo.timeless.Timeless;
Expand All @@ -14,15 +14,15 @@ public MarkFiveCaseAnimation(boolean isPuttingOn) {
}

@Override
protected void onStart(AbstractClientPlayerEntity player) {
protected void onStart(LivingEntity player) {
super.onStart(player);

if (this.getModel() == null) return;
this.getModel().getChild("case").orElseThrow().visible = true;
}

@Override
protected void onFinished(AbstractClientPlayerEntity player) {
protected void onFinished(LivingEntity player) {
super.onFinished(player);

if (this.getModel() == null) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import mc.duzo.animation.generic.AnimationInfo;

import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Identifier;

import mc.duzo.timeless.Timeless;
Expand All @@ -14,10 +14,9 @@ public MarkFiveMaskAnimation(boolean isPuttingOn) {
}

@Override
protected void onFinished(AbstractClientPlayerEntity player) {
protected void onFinished(LivingEntity player) {
super.onFinished(player);

if (this.getModel() == null) return;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void tryApply() {
}
}

private Optional<PlayerEntity> findNearbyPlayer(float range) {
public Optional<PlayerEntity> findNearbyPlayer(float range) {
EntityHitResult ray = ProjectileUtil.getEntityCollision(this.getWorld(), this, this.getPos(), this.getPos().offset(this.getMovementDirection().getOpposite(), range).add(0, 1.5, 0), this.getBoundingBox().stretch(this.getVelocity()).expand(1.0), (entity -> (entity instanceof PlayerEntity)));;
if (ray == null) return Optional.empty();
return Optional.of((PlayerEntity) ray.getEntity());
Expand Down
Loading

0 comments on commit 260fcce

Please sign in to comment.