WIP: stub ClientConfig + gameasset registries, strip Meshes mobs
Nouveaux stubs core :
- TiedUpAnimationConfig — remplace yesman.epicfight.config.ClientConfig.
Flags animation/rendu, no-op pour combat.
- TiedUpRigRegistry — remplace gameasset.Animations.EMPTY_ANIMATION +
gameasset.Armatures.ArmatureContructor.
Fichiers forkés additionnels (dépendances transitives découvertes) :
- anim/types/DirectStaticAnimation.java (EMPTY_ANIMATION est un DirectStaticAnimation)
- event/InitAnimatorEvent.java (postInit() forge event)
- event/EntityPatchRegistryEvent.java (mod bus event pour register patches)
Strip combat :
- Meshes.java : retiré les 11 mob meshes (CreeperMesh, DragonMesh, VexMesh,
WitherMesh, etc.) + armor + particle + cape. Garde BIPED
et ALEX / BIPED_OLD_TEX / BIPED_OUTLAYER (variants joueur).
- Animator.playDeathAnimation : Animations.BIPED_DEATH (ARR asset) →
EMPTY_ANIMATION fallback.
- AnimationManager.apply : Armatures.reload() stripped (no-op, à rebrancher
Phase 2 sur TiedUpArmatures).
- ClientPlayerPatch.entityPairing : body entier strippé (combat skills
Technician/Adrenaline/Emergency Escape).
sed global : ClientConfig.* → TiedUpAnimationConfig.*
sed global : Animations.EMPTY_ANIMATION → TiedUpRigRegistry.EMPTY_ANIMATION
sed global : Armatures.ArmatureContructor → TiedUpRigRegistry.ArmatureContructor
Résidus yesman.epicfight : 86 → 74 (-12)
Reste : physics (16) + network (13) + world combat (10) + particle (3) +
collider (2) + client misc (2) + skill (2). Tous combat-entangled,
demandent strip méthode par méthode.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Derived from Epic Fight (https://github.com/Epic-Fight/epicfight)
|
||||
* by the Epic Fight Team, licensed under GPLv3.
|
||||
* Modifications © 2026 TiedUp! Remake Contributors, distributed under GPLv3.
|
||||
*/
|
||||
|
||||
package com.tiedup.remake.rig;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Remplace {@code yesman.epicfight.config.ClientConfig} du fork upstream.
|
||||
* Expose uniquement les flags pertinents au pipeline animation/rendu RIG.
|
||||
*
|
||||
* <p><b>Note Phase 0</b> : tous les flags sont des {@code static final} avec
|
||||
* valeurs par défaut hardcodées. À convertir en {@code ForgeConfigSpec} réel
|
||||
* (TOML config file) Phase 2 ou plus tard si on veut permettre la
|
||||
* configuration utilisateur.</p>
|
||||
*
|
||||
* <p>Valeurs combat (autoSwitchCamera, preferenceWork, combatPreferredItems,
|
||||
* miningPreferredItems) = defaults no-op, on ne les utilise pas. Les refs
|
||||
* restantes dans LocalPlayerPatch/ClientPlayerPatch seront strippées en
|
||||
* Phase 2 quand on simplifiera ces classes.</p>
|
||||
*/
|
||||
public final class TiedUpAnimationConfig {
|
||||
|
||||
private TiedUpAnimationConfig() {}
|
||||
|
||||
// Rendu
|
||||
public static final boolean activateComputeShader = false;
|
||||
public static final boolean enableOriginalModel = true; // rendu vanilla model = on par défaut
|
||||
public static final boolean enableAnimatedFirstPersonModel = true;
|
||||
public static final boolean enableCosmetics = true;
|
||||
public static final boolean enablePovAction = false; // POV action combat → off
|
||||
public static final boolean autoSwitchCamera = false; // combat camera switch → off
|
||||
|
||||
// Combat (stubs pour compat refs LocalPlayerPatch Phase 0 — à supprimer
|
||||
// en Phase 2 avec le reste du strip combat)
|
||||
public static final Object preferenceWork = new Object() {
|
||||
public boolean checkHitResult() { return false; }
|
||||
};
|
||||
public static final Set<Object> combatPreferredItems = Set.of();
|
||||
public static final Set<Object> miningPreferredItems = Set.of();
|
||||
}
|
||||
68
src/main/java/com/tiedup/remake/rig/TiedUpRigRegistry.java
Normal file
68
src/main/java/com/tiedup/remake/rig/TiedUpRigRegistry.java
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Derived from Epic Fight (https://github.com/Epic-Fight/epicfight)
|
||||
* by the Epic Fight Team, licensed under GPLv3.
|
||||
* Modifications © 2026 TiedUp! Remake Contributors, distributed under GPLv3.
|
||||
*/
|
||||
|
||||
package com.tiedup.remake.rig;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import com.tiedup.remake.rig.anim.types.DirectStaticAnimation;
|
||||
import com.tiedup.remake.rig.armature.Armature;
|
||||
import com.tiedup.remake.rig.armature.Joint;
|
||||
|
||||
/**
|
||||
* Remplace les registries {@code yesman.epicfight.gameasset.Animations} et
|
||||
* {@code yesman.epicfight.gameasset.Armatures} du fork upstream. TiedUp
|
||||
* n'utilise PAS les animations combat EF (BIPED_IDLE, BIPED_WALK, etc. —
|
||||
* ARR assets) — on authore les nôtres en Phase 4 via addon Blender.
|
||||
*
|
||||
* <p>Ce registry expose juste :</p>
|
||||
* <ul>
|
||||
* <li>{@link #EMPTY_ANIMATION} — animation singleton "ne fait rien", référencée
|
||||
* par LayerOffAnimation et StaticAnimation pour le défaut.</li>
|
||||
* <li>{@link ArmatureContructor} — interface fonctionnelle pour construire
|
||||
* des armatures custom (re-exposée depuis {@code TiedUpRigRegistry.ArmatureContructor}).</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>Les vrais registries TiedUp (TiedUpAnimationRegistry, TiedUpArmatures,
|
||||
* TiedUpMeshRegistry) sont prévus en Phase 2-3 et gèreront le scan resource
|
||||
* pack + lookup par ResourceLocation.</p>
|
||||
*/
|
||||
public final class TiedUpRigRegistry {
|
||||
|
||||
private TiedUpRigRegistry() {}
|
||||
|
||||
/**
|
||||
* Animation singleton "ne fait rien". Utilisée par le runtime comme
|
||||
* fallback quand aucune animation n'est active sur une layer.
|
||||
*
|
||||
* <p>Équivalent de {@code TiedUpRigRegistry.EMPTY_ANIMATION} du fork upstream
|
||||
* (cf. Animations.java:27 EF).</p>
|
||||
*/
|
||||
public static final DirectStaticAnimation EMPTY_ANIMATION = new DirectStaticAnimation() {
|
||||
public static final ResourceLocation EMPTY_ANIMATION_REGISTRY_NAME =
|
||||
ResourceLocation.fromNamespaceAndPath(TiedUpRigConstants.MODID, "empty");
|
||||
|
||||
@Override
|
||||
public void loadAnimation() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation registryName() {
|
||||
return EMPTY_ANIMATION_REGISTRY_NAME;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Interface fonctionnelle de construction d'armature. Re-exposée depuis
|
||||
* {@code TiedUpRigRegistry.ArmatureContructor} upstream pour que les callers
|
||||
* (JsonAssetLoader, etc.) aient accès au même type.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface ArmatureContructor<T extends Armature> {
|
||||
T invoke(String name, int jointNumber, Joint joint, Map<String, Joint> jointMap);
|
||||
}
|
||||
}
|
||||
@@ -60,8 +60,7 @@ import yesman.epicfight.api.data.reloader.SkillManager;
|
||||
import com.tiedup.remake.rig.exception.AssetLoadingException;
|
||||
import com.tiedup.remake.rig.util.InstantiateInvoker;
|
||||
import com.tiedup.remake.rig.util.MutableBoolean;
|
||||
import yesman.epicfight.gameasset.Animations;
|
||||
import yesman.epicfight.gameasset.Armatures;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry;
|
||||
import com.tiedup.remake.rig.TiedUpRigConstants;
|
||||
import yesman.epicfight.network.EpicFightNetworkManager;
|
||||
import yesman.epicfight.network.client.CPCheckAnimationRegistryMatches;
|
||||
@@ -172,7 +171,9 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
|
||||
|
||||
@Override
|
||||
protected void apply(List<ResourceLocation> objects, ResourceManager resourceManager, ProfilerFiller profilerIn) {
|
||||
Armatures.reload(resourceManager);
|
||||
// RIG : Armatures.reload() (EF gameasset registry) retiré.
|
||||
// TiedUpArmatures.reload() sera appelé ici en Phase 2 quand le registry
|
||||
// sera créé. En Phase 0, no-op.
|
||||
|
||||
Set<ResourceLocation> registeredAnimation =
|
||||
this.animationById.values().stream()
|
||||
@@ -318,7 +319,7 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
|
||||
} catch (Exception e) {
|
||||
TiedUpRigConstants.LOGGER.warn("Failed at creating animation from server resource pack");
|
||||
e.printStackTrace();
|
||||
return Animations.EMPTY_ANIMATION;
|
||||
return TiedUpRigRegistry.EMPTY_ANIMATION;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.tiedup.remake.rig.anim.property.AnimationProperty.StaticAnimationProp
|
||||
import com.tiedup.remake.rig.anim.types.DynamicAnimation;
|
||||
import com.tiedup.remake.rig.anim.types.StaticAnimation;
|
||||
import com.tiedup.remake.rig.asset.AssetAccessor;
|
||||
import yesman.epicfight.gameasset.Animations;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry;
|
||||
import com.tiedup.remake.rig.TiedUpRigConstants;
|
||||
import com.tiedup.remake.rig.patch.LivingEntityPatch;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class AnimationPlayer {
|
||||
protected AssetAccessor<? extends DynamicAnimation> play;
|
||||
|
||||
public AnimationPlayer() {
|
||||
this.setPlayAnimation(Animations.EMPTY_ANIMATION);
|
||||
this.setPlayAnimation(TiedUpRigRegistry.EMPTY_ANIMATION);
|
||||
}
|
||||
|
||||
public void tick(LivingEntityPatch<?> entitypatch) {
|
||||
@@ -152,7 +152,7 @@ public class AnimationPlayer {
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return this.play == Animations.EMPTY_ANIMATION;
|
||||
return this.play == TiedUpRigRegistry.EMPTY_ANIMATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.tiedup.remake.rig.asset.AssetAccessor;
|
||||
import com.tiedup.remake.rig.util.ParseUtil;
|
||||
import com.tiedup.remake.rig.util.datastruct.TypeFlexibleHashMap;
|
||||
import com.tiedup.remake.rig.util.datastruct.TypeFlexibleHashMap.TypeKey;
|
||||
import yesman.epicfight.gameasset.Animations;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry;
|
||||
import yesman.epicfight.network.common.AnimationVariablePacket;
|
||||
|
||||
public class AnimationVariables {
|
||||
@@ -111,7 +111,7 @@ public class AnimationVariables {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Deprecated // Avoid direct use
|
||||
public <T> void put(IndependentAnimationVariableKey<T> key, AssetAccessor<? extends StaticAnimation> animation, T value, boolean synchronize) {
|
||||
if (animation == Animations.EMPTY_ANIMATION) {
|
||||
if (animation == TiedUpRigRegistry.EMPTY_ANIMATION) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class AnimationVariables {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void removeAll(AnimationAccessor<? extends StaticAnimation> animation) {
|
||||
if (animation == Animations.EMPTY_ANIMATION) {
|
||||
if (animation == TiedUpRigRegistry.EMPTY_ANIMATION) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public class AnimationVariables {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Deprecated // Avoid direct use
|
||||
public void remove(IndependentAnimationVariableKey<?> key, AssetAccessor<? extends StaticAnimation> animation, boolean synchronize) {
|
||||
if (animation == Animations.EMPTY_ANIMATION) {
|
||||
if (animation == TiedUpRigRegistry.EMPTY_ANIMATION) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.tiedup.remake.rig.anim.types.EntityState;
|
||||
import com.tiedup.remake.rig.anim.types.StaticAnimation;
|
||||
import com.tiedup.remake.rig.asset.AssetAccessor;
|
||||
import com.tiedup.remake.rig.event.InitAnimatorEvent;
|
||||
import yesman.epicfight.gameasset.Animations;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry;
|
||||
import com.tiedup.remake.rig.TiedUpRigConstants;
|
||||
import com.tiedup.remake.rig.patch.LivingEntityPatch;
|
||||
|
||||
@@ -111,7 +111,10 @@ public abstract class Animator {
|
||||
}
|
||||
|
||||
public void playDeathAnimation() {
|
||||
this.playAnimation(this.livingAnimations.getOrDefault(LivingMotions.DEATH, Animations.BIPED_DEATH), 0);
|
||||
// RIG : Animations.BIPED_DEATH (EF combat asset ARR) retiré.
|
||||
// Fallback sur EMPTY_ANIMATION — TiedUp authored ses propres
|
||||
// anims de mort Phase 4 et les binde via addLivingAnimation(DEATH, ...).
|
||||
this.playAnimation(this.livingAnimations.getOrDefault(LivingMotions.DEATH, TiedUpRigRegistry.EMPTY_ANIMATION), 0);
|
||||
}
|
||||
|
||||
public void addLivingAnimation(LivingMotion livingMotion, AssetAccessor<? extends StaticAnimation> animation) {
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.tiedup.remake.rig.anim.types.EntityState;
|
||||
import com.tiedup.remake.rig.anim.types.LinkAnimation;
|
||||
import com.tiedup.remake.rig.anim.types.StaticAnimation;
|
||||
import com.tiedup.remake.rig.asset.AssetAccessor;
|
||||
import yesman.epicfight.gameasset.Animations;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry;
|
||||
import com.tiedup.remake.rig.patch.LivingEntityPatch;
|
||||
|
||||
public class ServerAnimator extends Animator {
|
||||
@@ -103,7 +103,7 @@ public class ServerAnimator extends Animator {
|
||||
|
||||
if (this.animationPlayer.isEnd()) {
|
||||
if (this.nextAnimation == null) {
|
||||
Animations.EMPTY_ANIMATION.putOnPlayer(this.animationPlayer, this.entitypatch);
|
||||
TiedUpRigRegistry.EMPTY_ANIMATION.putOnPlayer(this.animationPlayer, this.entitypatch);
|
||||
this.softPaused = true;
|
||||
} else {
|
||||
if (!this.animationPlayer.getAnimation().get().isLinkAnimation() && !this.nextAnimation.get().isLinkAnimation()) {
|
||||
|
||||
@@ -44,7 +44,7 @@ import com.tiedup.remake.rig.anim.client.property.JointMask.BindModifier;
|
||||
import com.tiedup.remake.rig.anim.client.property.JointMask.JointMaskSet;
|
||||
import com.tiedup.remake.rig.anim.client.property.JointMaskEntry;
|
||||
import com.tiedup.remake.rig.util.datastruct.TypeFlexibleHashMap;
|
||||
import yesman.epicfight.gameasset.Animations;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry;
|
||||
import com.tiedup.remake.rig.TiedUpRigConstants;
|
||||
import yesman.epicfight.network.common.AnimatorControlPacket;
|
||||
import com.tiedup.remake.rig.patch.LivingEntityPatch;
|
||||
@@ -267,7 +267,7 @@ public class ClientAnimator extends Animator {
|
||||
@Override
|
||||
public void playDeathAnimation() {
|
||||
if (!this.getPlayerFor(null).getAnimation().get().getProperty(ActionAnimationProperty.IS_DEATH_ANIMATION).orElse(false)) {
|
||||
this.playAnimation(this.livingAnimations.getOrDefault(LivingMotions.DEATH, Animations.EMPTY_ANIMATION), 0.0F);
|
||||
this.playAnimation(this.livingAnimations.getOrDefault(LivingMotions.DEATH, TiedUpRigRegistry.EMPTY_ANIMATION), 0.0F);
|
||||
this.currentMotion = LivingMotions.DEATH;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.tiedup.remake.rig.anim.types.LayerOffAnimation;
|
||||
import com.tiedup.remake.rig.anim.types.LinkAnimation;
|
||||
import com.tiedup.remake.rig.anim.types.StaticAnimation;
|
||||
import com.tiedup.remake.rig.asset.AssetAccessor;
|
||||
import yesman.epicfight.gameasset.Animations;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry;
|
||||
import com.tiedup.remake.rig.patch.LivingEntityPatch;
|
||||
|
||||
public class Layer {
|
||||
@@ -132,7 +132,7 @@ public class Layer {
|
||||
this.nextAnimation = null;
|
||||
} else {
|
||||
if (this.animationPlayer.getAnimation() instanceof LayerOffAnimation) {
|
||||
this.animationPlayer.getAnimation().get().end(entitypatch, Animations.EMPTY_ANIMATION, true);
|
||||
this.animationPlayer.getAnimation().get().end(entitypatch, TiedUpRigRegistry.EMPTY_ANIMATION, true);
|
||||
} else {
|
||||
this.off(entitypatch);
|
||||
}
|
||||
@@ -207,7 +207,7 @@ public class Layer {
|
||||
|
||||
public void disableLayer() {
|
||||
this.disabled = true;
|
||||
this.animationPlayer.setPlayAnimation(Animations.EMPTY_ANIMATION);
|
||||
this.animationPlayer.setPlayAnimation(TiedUpRigRegistry.EMPTY_ANIMATION);
|
||||
}
|
||||
|
||||
public static void setLayerOffAnimation(AssetAccessor<? extends DynamicAnimation> currentAnimation, Pose currentPose, LayerOffAnimation offAnimation, float transitionTimeModifier) {
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Derived from Epic Fight (https://github.com/Epic-Fight/epicfight)
|
||||
* by the Epic Fight Team, licensed under GPLv3.
|
||||
* Modifications © 2026 TiedUp! Remake Contributors, distributed under GPLv3.
|
||||
*/
|
||||
|
||||
package com.tiedup.remake.rig.anim.types;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import com.tiedup.remake.rig.anim.AnimationManager.AnimationAccessor;
|
||||
import com.tiedup.remake.rig.asset.AssetAccessor;
|
||||
import com.tiedup.remake.rig.armature.Armature;
|
||||
|
||||
public class DirectStaticAnimation extends StaticAnimation implements AnimationAccessor<DirectStaticAnimation> {
|
||||
private ResourceLocation registryName;
|
||||
|
||||
public DirectStaticAnimation() {
|
||||
this.accessor = this;
|
||||
}
|
||||
|
||||
public DirectStaticAnimation(float transitionTime, boolean isRepeat, ResourceLocation registryName, AssetAccessor<? extends Armature> armature) {
|
||||
super(transitionTime, isRepeat, registryName.toString(), armature);
|
||||
|
||||
this.registryName = registryName;
|
||||
this.accessor = this;
|
||||
}
|
||||
|
||||
/* Multilayer, Pov animation Constructor */
|
||||
@ApiStatus.Internal
|
||||
public DirectStaticAnimation(ResourceLocation baseAnimPath, float transitionTime, boolean repeatPlay, String registryName, AssetAccessor<? extends Armature> armature) {
|
||||
super(baseAnimPath, transitionTime, repeatPlay, registryName, armature);
|
||||
|
||||
this.registryName = ResourceLocation.parse(registryName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectStaticAnimation get() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <A extends DynamicAnimation> AnimationAccessor<A> getAccessor() {
|
||||
return (AnimationAccessor<A>)this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation registryName() {
|
||||
return this.registryName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPresent() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int id() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inRegistry() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ import com.tiedup.remake.rig.anim.property.AnimationProperty;
|
||||
import com.tiedup.remake.rig.asset.AssetAccessor;
|
||||
import com.tiedup.remake.rig.anim.client.Layer.Priority;
|
||||
import com.tiedup.remake.rig.anim.client.property.JointMaskEntry;
|
||||
import yesman.epicfight.gameasset.Animations;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry;
|
||||
import com.tiedup.remake.rig.patch.LivingEntityPatch;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -74,7 +74,7 @@ public class LayerOffAnimation extends DynamicAnimation implements AnimationAcce
|
||||
|
||||
@Override
|
||||
public AssetAccessor<? extends StaticAnimation> getRealAnimation() {
|
||||
return Animations.EMPTY_ANIMATION;
|
||||
return TiedUpRigRegistry.EMPTY_ANIMATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -64,7 +64,7 @@ import yesman.epicfight.client.ClientEngine;
|
||||
import com.tiedup.remake.rig.render.TiedUpRenderTypes;
|
||||
import yesman.epicfight.client.renderer.RenderingTool;
|
||||
import com.tiedup.remake.rig.render.item.RenderItemBase;
|
||||
import yesman.epicfight.gameasset.Animations;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry;
|
||||
import com.tiedup.remake.rig.TiedUpRigConstants;
|
||||
import com.tiedup.remake.rig.patch.LivingEntityPatch;
|
||||
import com.tiedup.remake.rig.patch.PlayerPatch;
|
||||
@@ -179,7 +179,7 @@ public class StaticAnimation extends DynamicAnimation implements InverseKinemati
|
||||
|
||||
public void setLinkAnimation(final AssetAccessor<? extends DynamicAnimation> fromAnimation, Pose startPose, boolean isOnSameLayer, float transitionTimeModifier, LivingEntityPatch<?> entitypatch, LinkAnimation dest) {
|
||||
if (!entitypatch.isLogicalClient()) {
|
||||
startPose = Animations.EMPTY_ANIMATION.getPoseByTime(entitypatch, 0.0F, 1.0F);
|
||||
startPose = TiedUpRigRegistry.EMPTY_ANIMATION.getPoseByTime(entitypatch, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
dest.resetNextStartTime();
|
||||
|
||||
@@ -70,7 +70,7 @@ import com.tiedup.remake.rig.math.MathUtils;
|
||||
import com.tiedup.remake.rig.math.OpenMatrix4f;
|
||||
import com.tiedup.remake.rig.math.Vec3f;
|
||||
import com.tiedup.remake.rig.math.Vec4f;
|
||||
import yesman.epicfight.gameasset.Armatures.ArmatureContructor;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry.ArmatureContructor;
|
||||
import com.tiedup.remake.rig.TiedUpRigConstants;
|
||||
|
||||
public class JsonAssetLoader {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Derived from Epic Fight (https://github.com/Epic-Fight/epicfight)
|
||||
* by the Epic Fight Team, licensed under GPLv3.
|
||||
* Modifications © 2026 TiedUp! Remake Contributors, distributed under GPLv3.
|
||||
*/
|
||||
|
||||
package com.tiedup.remake.rig.event;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.fml.event.IModBusEvent;
|
||||
import com.tiedup.remake.rig.patch.EntityPatch;
|
||||
|
||||
public class EntityPatchRegistryEvent extends Event implements IModBusEvent {
|
||||
private final Map<EntityType<?>, Function<Entity, Supplier<EntityPatch<?>>>> typeEntry;
|
||||
|
||||
public EntityPatchRegistryEvent(Map<EntityType<?>, Function<Entity, Supplier<EntityPatch<?>>>> typeEntry) {
|
||||
this.typeEntry = typeEntry;
|
||||
}
|
||||
|
||||
public Map<EntityType<?>, Function<Entity, Supplier<EntityPatch<?>>>> getTypeEntry() {
|
||||
return this.typeEntry;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Derived from Epic Fight (https://github.com/Epic-Fight/epicfight)
|
||||
* by the Epic Fight Team, licensed under GPLv3.
|
||||
* Modifications © 2026 TiedUp! Remake Contributors, distributed under GPLv3.
|
||||
*/
|
||||
|
||||
package com.tiedup.remake.rig.event;
|
||||
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import com.tiedup.remake.rig.anim.Animator;
|
||||
import com.tiedup.remake.rig.patch.LivingEntityPatch;
|
||||
|
||||
public class InitAnimatorEvent extends Event {
|
||||
private final LivingEntityPatch<?> entitypatch;
|
||||
private final Animator animator;
|
||||
|
||||
public InitAnimatorEvent(LivingEntityPatch<?> entitypatch, Animator animator) {
|
||||
this.entitypatch = entitypatch;
|
||||
this.animator = animator;
|
||||
}
|
||||
|
||||
public LivingEntityPatch<?> getEntityPatch() {
|
||||
return this.entitypatch;
|
||||
}
|
||||
|
||||
public Animator getAnimator() {
|
||||
return this.animator;
|
||||
}
|
||||
}
|
||||
@@ -28,121 +28,81 @@ import com.tiedup.remake.rig.mesh.Mesh.RenderProperties;
|
||||
import com.tiedup.remake.rig.cloth.ClothSimulatable;
|
||||
import com.tiedup.remake.rig.cloth.ClothSimulator.ClothObject;
|
||||
import com.tiedup.remake.rig.cloth.ClothSimulator.ClothObjectBuilder;
|
||||
import com.tiedup.remake.rig.mesh.CreeperMesh;
|
||||
import com.tiedup.remake.rig.mesh.DragonMesh;
|
||||
import com.tiedup.remake.rig.mesh.EndermanMesh;
|
||||
import com.tiedup.remake.rig.mesh.HoglinMesh;
|
||||
import com.tiedup.remake.rig.mesh.HumanoidMesh;
|
||||
import com.tiedup.remake.rig.mesh.IronGolemMesh;
|
||||
import com.tiedup.remake.rig.mesh.PiglinMesh;
|
||||
import com.tiedup.remake.rig.mesh.RavagerMesh;
|
||||
import com.tiedup.remake.rig.mesh.SpiderMesh;
|
||||
import com.tiedup.remake.rig.mesh.VexMesh;
|
||||
import com.tiedup.remake.rig.mesh.VillagerMesh;
|
||||
import com.tiedup.remake.rig.mesh.WitherMesh;
|
||||
import com.tiedup.remake.rig.TiedUpRigConstants;
|
||||
|
||||
public class Meshes implements PreparableReloadListener {
|
||||
private static final Map<ResourceLocation, MeshAccessor<? extends Mesh>> ACCESSORS = Maps.newHashMap();
|
||||
private static final Map<MeshAccessor<? extends Mesh>, Mesh> MESHES = Maps.newHashMap();
|
||||
private static ResourceManager resourceManager = null;
|
||||
|
||||
|
||||
//For resource reloader
|
||||
public static final Meshes INSTANCE = new Meshes();
|
||||
|
||||
// Entities
|
||||
|
||||
// RIG : on garde uniquement les meshes humanoïdes (joueur + NPCs bondage).
|
||||
// Les mob meshes combat EF (Creeper/Dragon/Spider/etc.) et armor/particle/cape
|
||||
// ont été retirés du fork — hors scope bondage.
|
||||
public static final MeshAccessor<HumanoidMesh> ALEX = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/biped_slim_arm", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(HumanoidMesh::new));
|
||||
public static final MeshAccessor<HumanoidMesh> BIPED = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/biped", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(HumanoidMesh::new));
|
||||
public static final MeshAccessor<HumanoidMesh> BIPED_OLD_TEX = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/biped_old_texture", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(HumanoidMesh::new));
|
||||
public static final MeshAccessor<HumanoidMesh> BIPED_OUTLAYER = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/biped_outlayer", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(HumanoidMesh::new));
|
||||
public static final MeshAccessor<VillagerMesh> VILLAGER_ZOMBIE = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/zombie_villager", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(VillagerMesh::new));
|
||||
public static final MeshAccessor<CreeperMesh> CREEPER = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/creeper", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(CreeperMesh::new));
|
||||
public static final MeshAccessor<EndermanMesh> ENDERMAN = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/enderman", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(EndermanMesh::new));
|
||||
public static final MeshAccessor<HumanoidMesh> SKELETON = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/skeleton", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(HumanoidMesh::new));
|
||||
public static final MeshAccessor<SpiderMesh> SPIDER = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/spider", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(SpiderMesh::new));
|
||||
public static final MeshAccessor<IronGolemMesh> IRON_GOLEM = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/iron_golem", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(IronGolemMesh::new));
|
||||
public static final MeshAccessor<HumanoidMesh> ILLAGER = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/illager", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(VillagerMesh::new));
|
||||
public static final MeshAccessor<VillagerMesh> WITCH = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/witch", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(VillagerMesh::new));
|
||||
public static final MeshAccessor<RavagerMesh> RAVAGER = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/ravager",(jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(RavagerMesh::new));
|
||||
public static final MeshAccessor<VexMesh> VEX = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/vex", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(VexMesh::new));
|
||||
public static final MeshAccessor<PiglinMesh> PIGLIN = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/piglin", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(PiglinMesh::new));
|
||||
public static final MeshAccessor<HoglinMesh> HOGLIN = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/hoglin", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(HoglinMesh::new));
|
||||
public static final MeshAccessor<DragonMesh> DRAGON = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/dragon", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(DragonMesh::new));
|
||||
public static final MeshAccessor<WitherMesh> WITHER = MeshAccessor.create(TiedUpRigConstants.MODID, "entity/wither", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(WitherMesh::new));
|
||||
|
||||
// Armors
|
||||
public static final MeshAccessor<SkinnedMesh> HELMET = MeshAccessor.create(TiedUpRigConstants.MODID, "armor/helmet", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(SkinnedMesh::new));
|
||||
public static final MeshAccessor<SkinnedMesh> HELMET_PIGLIN = MeshAccessor.create(TiedUpRigConstants.MODID, "armor/piglin_helmet", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(SkinnedMesh::new));
|
||||
public static final MeshAccessor<SkinnedMesh> HELMET_VILLAGER = MeshAccessor.create(TiedUpRigConstants.MODID, "armor/villager_helmet", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(SkinnedMesh::new));
|
||||
public static final MeshAccessor<SkinnedMesh> CHESTPLATE = MeshAccessor.create(TiedUpRigConstants.MODID, "armor/chestplate", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(SkinnedMesh::new));
|
||||
public static final MeshAccessor<SkinnedMesh> LEGGINS = MeshAccessor.create(TiedUpRigConstants.MODID, "armor/leggins", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(SkinnedMesh::new));
|
||||
public static final MeshAccessor<SkinnedMesh> BOOTS = MeshAccessor.create(TiedUpRigConstants.MODID, "armor/boots", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(SkinnedMesh::new));
|
||||
|
||||
// Particles
|
||||
public static final MeshAccessor<ClassicMesh> AIR_BURST = MeshAccessor.create(TiedUpRigConstants.MODID, "particle/air_burst", (jsonModelLoader) -> jsonModelLoader.loadClassicMesh(ClassicMesh::new));
|
||||
public static final MeshAccessor<ClassicMesh> FORCE_FIELD = MeshAccessor.create(TiedUpRigConstants.MODID, "particle/force_field", (jsonModelLoader) -> jsonModelLoader.loadClassicMesh(ClassicMesh::new));
|
||||
public static final MeshAccessor<ClassicMesh> LASER = MeshAccessor.create(TiedUpRigConstants.MODID, "particle/laser", (jsonModelLoader) -> jsonModelLoader.loadClassicMesh(ClassicMesh::new));
|
||||
|
||||
// Layers
|
||||
public static final MeshAccessor<SkinnedMesh> CAPE_DEFAULT = MeshAccessor.create(TiedUpRigConstants.MODID, "layer/default_cape", (jsonModelLoader) -> jsonModelLoader.loadSkinnedMesh(SkinnedMesh::new));
|
||||
|
||||
|
||||
public static void reload(ResourceManager resourceManager) {
|
||||
Meshes.resourceManager = resourceManager;
|
||||
|
||||
|
||||
ACCESSORS.entrySet().removeIf(entry -> !entry.getValue().inRegistry);
|
||||
|
||||
|
||||
MESHES.values().forEach((mesh) -> {
|
||||
if (mesh instanceof SkinnedMesh skinnedMesh) {
|
||||
skinnedMesh.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
MESHES.clear();
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
public static <M extends Mesh> AssetAccessor<M> get(ResourceLocation id) {
|
||||
return (AssetAccessor<M>) ACCESSORS.get(id);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <M extends Mesh> AssetAccessor<M> getOrCreate(ResourceLocation id, Function<JsonAssetLoader, M> jsonLoader) {
|
||||
return ACCESSORS.containsKey(id) ? (AssetAccessor<M>)ACCESSORS.get(id) : MeshAccessor.create(id, jsonLoader, false);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <M extends Mesh> Set<AssetAccessor<M>> entry(Class<? extends Mesh> filter) {
|
||||
return ACCESSORS.values().stream().filter((accessor) -> filter.isAssignableFrom(accessor.get().getClass())).map((accessor) -> (AssetAccessor<M>)accessor).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
|
||||
public static ResourceLocation wrapLocation(ResourceLocation rl) {
|
||||
return rl.getPath().matches("animmodels/.*\\.json") ? rl : ResourceLocation.fromNamespaceAndPath(rl.getNamespace(), "animmodels/" + rl.getPath() + ".json");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier stage, ResourceManager resourceManager, ProfilerFiller preparationsProfiler, ProfilerFiller reloadProfiler, Executor backgroundExecutor, Executor gameExecutor) {
|
||||
return CompletableFuture.runAsync(() -> {
|
||||
Meshes.reload(resourceManager);
|
||||
}, gameExecutor).thenCompose(stage::wait);
|
||||
}
|
||||
|
||||
|
||||
@FunctionalInterface
|
||||
public interface MeshContructor<P extends MeshPart, V extends VertexBuilder, M extends StaticMesh<P>> {
|
||||
M invoke(Map<String, Number[]> arrayMap, Map<MeshPartDefinition, List<V>> parts, M parent, RenderProperties properties);
|
||||
}
|
||||
|
||||
|
||||
public static record MeshAccessor<M extends Mesh> (ResourceLocation registryName, Function<JsonAssetLoader, M> jsonLoader, boolean inRegistry) implements AssetAccessor<M>, SoftBodyTranslatable {
|
||||
public static <M extends Mesh> MeshAccessor<M> create(String namespaceId, String path, Function<JsonAssetLoader, M> jsonLoader) {
|
||||
return create(ResourceLocation.fromNamespaceAndPath(namespaceId, path), jsonLoader, true);
|
||||
}
|
||||
|
||||
|
||||
private static <M extends Mesh> MeshAccessor<M> create(ResourceLocation id, Function<JsonAssetLoader, M> jsonLoader, boolean inRegistry) {
|
||||
MeshAccessor<M> accessor = new MeshAccessor<M> (id, jsonLoader, inRegistry);
|
||||
ACCESSORS.put(id, accessor);
|
||||
return accessor;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public M get() {
|
||||
@@ -150,18 +110,18 @@ public class Meshes implements PreparableReloadListener {
|
||||
JsonAssetLoader jsonModelLoader = new JsonAssetLoader(resourceManager, wrapLocation(this.registryName));
|
||||
MESHES.put(this, this.jsonLoader.apply(jsonModelLoader));
|
||||
}
|
||||
|
||||
|
||||
return (M)MESHES.get(this);
|
||||
}
|
||||
|
||||
|
||||
public String toString() {
|
||||
return this.registryName.toString();
|
||||
}
|
||||
|
||||
|
||||
public int hashCode() {
|
||||
return this.registryName.hashCode();
|
||||
}
|
||||
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
@@ -175,37 +135,37 @@ public class Meshes implements PreparableReloadListener {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canStartSoftBodySimulation() {
|
||||
Mesh mesh = this.get();
|
||||
|
||||
|
||||
if (mesh instanceof StaticMesh<?> staticMesh) {
|
||||
return staticMesh.canStartSoftBodySimulation();
|
||||
} else if (mesh instanceof CompositeMesh compositeMesh) {
|
||||
return compositeMesh.canStartSoftBodySimulation();
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ClothObject createSimulationData(SoftBodyTranslatable provider, ClothSimulatable simOwner, ClothObjectBuilder simBuilder) {
|
||||
Mesh mesh = this.get();
|
||||
|
||||
|
||||
if (mesh instanceof StaticMesh<?> staticMesh) {
|
||||
return staticMesh.createSimulationData(provider, simOwner, simBuilder);
|
||||
} else if (mesh instanceof CompositeMesh compositeMesh) {
|
||||
return compositeMesh.createSimulationData(provider, simOwner, simBuilder);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putSoftBodySimulationInfo(Map<String, ClothSimulationInfo> sofyBodySimulationInfo) {
|
||||
Mesh mesh = this.get();
|
||||
|
||||
|
||||
if (mesh instanceof SoftBodyTranslatable softBodyTranslatable) {
|
||||
softBodyTranslatable.putSoftBodySimulationInfo(sofyBodySimulationInfo);
|
||||
}
|
||||
@@ -214,7 +174,7 @@ public class Meshes implements PreparableReloadListener {
|
||||
@Override
|
||||
public Map<String, ClothSimulationInfo> getSoftBodySimulationInfo() {
|
||||
Mesh mesh = this.get();
|
||||
|
||||
|
||||
if (mesh instanceof SoftBodyTranslatable softBodyTranslatable) {
|
||||
return softBodyTranslatable.getSoftBodySimulationInfo();
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.tiedup.remake.rig.math.Vec4f;
|
||||
import com.tiedup.remake.rig.render.TiedUpRenderTypes;
|
||||
import yesman.epicfight.client.renderer.shader.compute.ComputeShaderSetup;
|
||||
import yesman.epicfight.client.renderer.shader.compute.loader.ComputeShaderProvider;
|
||||
import yesman.epicfight.config.ClientConfig;
|
||||
import com.tiedup.remake.rig.TiedUpAnimationConfig;
|
||||
import com.tiedup.remake.rig.TiedUpRigConstants;
|
||||
|
||||
public class SkinnedMesh extends StaticMesh<SkinnedMeshPart> {
|
||||
@@ -246,7 +246,7 @@ public class SkinnedMesh extends StaticMesh<SkinnedMeshPart> {
|
||||
|
||||
@Override
|
||||
public void draw(PoseStack poseStack, MultiBufferSource bufferSources, RenderType renderType, Mesh.DrawingFunction drawingFunction, int packedLight, float r, float g, float b, float a, int overlay, @Nullable Armature armature, OpenMatrix4f[] poses) {
|
||||
if (ClientConfig.activateComputeShader && this.computerShaderSetup != null) {
|
||||
if (TiedUpAnimationConfig.activateComputeShader && this.computerShaderSetup != null) {
|
||||
this.computerShaderSetup.drawWithShader(this, poseStack, bufferSources, TiedUpRenderTypes.getTriangulated(renderType), packedLight, r, g, b, a, overlay, armature, poses);
|
||||
} else {
|
||||
this.drawPosed(poseStack, bufferSources.getBuffer(TiedUpRenderTypes.getTriangulated(renderType)), drawingFunction, packedLight, r, g, b, a, overlay, armature, poses);
|
||||
|
||||
@@ -47,7 +47,7 @@ import com.tiedup.remake.rig.util.EntitySnapshot;
|
||||
import com.tiedup.remake.rig.math.MathUtils;
|
||||
import com.tiedup.remake.rig.math.OpenMatrix4f;
|
||||
import com.tiedup.remake.rig.math.Vec3f;
|
||||
import yesman.epicfight.config.ClientConfig;
|
||||
import com.tiedup.remake.rig.TiedUpAnimationConfig;
|
||||
import yesman.epicfight.gameasset.EpicFightSounds;
|
||||
import yesman.epicfight.network.EntityPairingPacketTypes;
|
||||
import yesman.epicfight.network.server.SPEntityPairingPacket;
|
||||
@@ -237,54 +237,14 @@ public class AbstractClientPlayerPatch<T extends AbstractClientPlayer> extends P
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entityPairing(SPEntityPairingPacket packet) {
|
||||
super.entityPairing(packet);
|
||||
|
||||
if (packet.getPairingPacketType().is(EntityPairingPacketTypes.class)) {
|
||||
switch (packet.getPairingPacketType().toEnum(EntityPairingPacketTypes.class)) {
|
||||
case TECHNICIAN_ACTIVATED -> {
|
||||
this.original.level().addParticle(EpicFightParticles.WHITE_AFTERIMAGE.get(), this.original.getX(), this.original.getY(), this.original.getZ(), Double.longBitsToDouble(this.original.getId()), 0, 0);
|
||||
}
|
||||
case ADRENALINE_ACTIVATED -> {
|
||||
if (this.original.isLocalPlayer()) {
|
||||
Minecraft.getInstance().getSoundManager().play(SimpleSoundInstance.forUI(EpicFightSounds.ADRENALINE.get(), 1.0F, 1.0F));
|
||||
} else {
|
||||
this.original.playSound(EpicFightSounds.ADRENALINE.get());
|
||||
}
|
||||
|
||||
this.original.level().addParticle(EpicFightParticles.ADRENALINE_PLAYER_BEATING.get(), this.original.getX(), this.original.getY(), this.original.getZ(), Double.longBitsToDouble(this.original.getId()), 0, 0);
|
||||
}
|
||||
case EMERGENCY_ESCAPE_ACTIVATED -> {
|
||||
float yRot = packet.getBuffer().readFloat();
|
||||
this.original.level().addParticle(EpicFightParticles.AIR_BURST.get(), this.original.getX(), this.original.getY() + this.original.getBbHeight() * 0.5F, this.original.getZ(), 90.0F, yRot, 0);
|
||||
|
||||
this.entityDecorations.addColorModifier(EntityDecorations.EMERGENCY_ESCAPE_TRANSPARENCY_MODIFIER, new RenderAttributeModifier<> () {
|
||||
private int tickCount;
|
||||
|
||||
@Override
|
||||
public void modifyValue(Vector4f val, float partialTick) {
|
||||
val.w = (float)Math.pow((this.tickCount + partialTick) / 6.0D, 2.0D) - 0.4F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRemove() {
|
||||
return this.tickCount > 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
++this.tickCount;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// RIG : entityPairing() EF = hook combat skills (Technician, Adrenaline,
|
||||
// Emergency Escape). Strippé intégralement — ces skills n'existent pas
|
||||
// en TiedUp. Le super.entityPairing() de base reste disponible si jamais
|
||||
// une extension TiedUp veut hooker des paires custom.
|
||||
|
||||
@Override
|
||||
public boolean overrideRender() {
|
||||
RenderEpicFightPlayerEvent renderepicfightplayerevent = new RenderEpicFightPlayerEvent(this, !ClientConfig.enableOriginalModel || this.isEpicFightMode());
|
||||
RenderEpicFightPlayerEvent renderepicfightplayerevent = new RenderEpicFightPlayerEvent(this, !TiedUpAnimationConfig.enableOriginalModel || this.isEpicFightMode());
|
||||
MinecraftForge.EVENT_BUS.post(renderepicfightplayerevent);
|
||||
return renderepicfightplayerevent.getShouldRender();
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ import com.tiedup.remake.rig.math.MathUtils;
|
||||
import yesman.epicfight.client.ClientEngine;
|
||||
import yesman.epicfight.client.events.engine.RenderEngine;
|
||||
import yesman.epicfight.client.gui.screen.SkillBookScreen;
|
||||
import yesman.epicfight.config.ClientConfig;
|
||||
import yesman.epicfight.gameasset.Animations;
|
||||
import com.tiedup.remake.rig.TiedUpAnimationConfig;
|
||||
import com.tiedup.remake.rig.TiedUpRigRegistry;
|
||||
import com.tiedup.remake.rig.TiedUpRigConstants;
|
||||
import yesman.epicfight.network.EpicFightNetworkManager;
|
||||
import yesman.epicfight.network.client.CPAnimatorControl;
|
||||
@@ -134,13 +134,13 @@ public class LocalPlayerPatch extends AbstractClientPlayerPatch<LocalPlayer> {
|
||||
return !optPovAnimation.isPresent();
|
||||
});
|
||||
|
||||
if (noPovAnimation && !currentPlaying.equals(Animations.EMPTY_ANIMATION)) {
|
||||
if (noPovAnimation && !currentPlaying.equals(TiedUpRigRegistry.EMPTY_ANIMATION)) {
|
||||
this.firstPersonLayer.off();
|
||||
}
|
||||
|
||||
this.firstPersonLayer.update(this);
|
||||
|
||||
if (this.firstPersonLayer.animationPlayer.getAnimation().equals(Animations.EMPTY_ANIMATION)) {
|
||||
if (this.firstPersonLayer.animationPlayer.getAnimation().equals(TiedUpRigRegistry.EMPTY_ANIMATION)) {
|
||||
this.povSettings = null;
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ public class LocalPlayerPatch extends AbstractClientPlayerPatch<LocalPlayer> {
|
||||
public boolean overrideRender() {
|
||||
// Disable rendering the player when animated first person model disabled
|
||||
if (this.original.is(this.minecraft.player)) {
|
||||
if (this.minecraft.options.getCameraType().isFirstPerson() && !ClientConfig.enableAnimatedFirstPersonModel) {
|
||||
if (this.minecraft.options.getCameraType().isFirstPerson() && !TiedUpAnimationConfig.enableAnimatedFirstPersonModel) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ public class LocalPlayerPatch extends AbstractClientPlayerPatch<LocalPlayer> {
|
||||
if (this.playerMode != PlayerMode.VANILLA) {
|
||||
ClientEngine.getInstance().renderEngine.downSlideSkillUI();
|
||||
|
||||
if (ClientConfig.autoSwitchCamera) {
|
||||
if (TiedUpAnimationConfig.autoSwitchCamera) {
|
||||
this.minecraft.options.setCameraType(CameraType.FIRST_PERSON);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class LocalPlayerPatch extends AbstractClientPlayerPatch<LocalPlayer> {
|
||||
if (this.playerMode != PlayerMode.EPICFIGHT) {
|
||||
ClientEngine.getInstance().renderEngine.upSlideSkillUI();
|
||||
|
||||
if (ClientConfig.autoSwitchCamera) {
|
||||
if (TiedUpAnimationConfig.autoSwitchCamera) {
|
||||
this.minecraft.options.setCameraType(CameraType.THIRD_PERSON_BACK);
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ public class LocalPlayerPatch extends AbstractClientPlayerPatch<LocalPlayer> {
|
||||
return xRot;
|
||||
}
|
||||
|
||||
if (ClientConfig.enablePovAction && this.minecraft.options.getCameraType().isFirstPerson() && this.isEpicFightMode() && !this.getFirstPersonLayer().isOff()) {
|
||||
if (TiedUpAnimationConfig.enablePovAction && this.minecraft.options.getCameraType().isFirstPerson() && this.isEpicFightMode() && !this.getFirstPersonLayer().isOff()) {
|
||||
ViewLimit viewLimit = this.getPovSettings().viewLimit();
|
||||
|
||||
if (viewLimit != null) {
|
||||
@@ -299,7 +299,7 @@ public class LocalPlayerPatch extends AbstractClientPlayerPatch<LocalPlayer> {
|
||||
return yRot;
|
||||
}
|
||||
|
||||
if (ClientConfig.enablePovAction && this.minecraft.options.getCameraType().isFirstPerson() && this.isEpicFightMode() && !this.getFirstPersonLayer().isOff()) {
|
||||
if (TiedUpAnimationConfig.enablePovAction && this.minecraft.options.getCameraType().isFirstPerson() && this.isEpicFightMode() && !this.getFirstPersonLayer().isOff()) {
|
||||
ViewLimit viewLimit = this.getPovSettings().viewLimit();
|
||||
|
||||
if (viewLimit != null) {
|
||||
@@ -438,10 +438,10 @@ public class LocalPlayerPatch extends AbstractClientPlayerPatch<LocalPlayer> {
|
||||
public void updateHeldItem(CapabilityItem mainHandCap, CapabilityItem offHandCap) {
|
||||
super.updateHeldItem(mainHandCap, offHandCap);
|
||||
|
||||
if (!ClientConfig.preferenceWork.checkHitResult()) {
|
||||
if (ClientConfig.combatPreferredItems.contains(this.original.getMainHandItem().getItem())) {
|
||||
if (!TiedUpAnimationConfig.preferenceWork.checkHitResult()) {
|
||||
if (TiedUpAnimationConfig.combatPreferredItems.contains(this.original.getMainHandItem().getItem())) {
|
||||
this.toEpicFightMode(true);
|
||||
} else if (ClientConfig.miningPreferredItems.contains(this.original.getMainHandItem().getItem())) {
|
||||
} else if (TiedUpAnimationConfig.miningPreferredItems.contains(this.original.getMainHandItem().getItem())) {
|
||||
this.toVanillaMode(true);
|
||||
}
|
||||
}
|
||||
@@ -480,8 +480,8 @@ public class LocalPlayerPatch extends AbstractClientPlayerPatch<LocalPlayer> {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ClientConfig.preferenceWork.checkHitResult()) {
|
||||
if (ClientConfig.combatPreferredItems.contains(this.original.getMainHandItem().getItem())) {
|
||||
if (TiedUpAnimationConfig.preferenceWork.checkHitResult()) {
|
||||
if (TiedUpAnimationConfig.combatPreferredItems.contains(this.original.getMainHandItem().getItem())) {
|
||||
BlockHitResult blockHitResult = RenderEngine.asBlockHitResult(this.minecraft.hitResult);
|
||||
|
||||
if (blockHitResult != null && this.minecraft.level != null) {
|
||||
|
||||
Reference in New Issue
Block a user