WIP: fork patch/collider/codec stubs, 464->135 compile errors

Phase 0 compile progress (70% reduction). Core data model compile :

Refs yesman.epicfight strippées (hors 4 javadocs) :
- AnimationProperty : combat properties EXTRA_DAMAGE, STUN_TYPE, PARTICLE
- ClientAnimator : playAnimationAt(..., AnimatorControlPacket.Layer, Priority)
- ClothSimulator : OBBCollider -> fork geometry-only dans rig/collider/
- InstantiateInvoker : Collider, ColliderPreset, Armatures, DatapackEditScreen
- MoveCoordFunctions : GrapplingAttackAnimation
- SimulationTypes : InverseKinematicsSimulator (path rewrite)

Stubs patch/ :
- EntityPatch<T> abstract — getOriginal, isLogicalClient, getMatrix, getAngleTo
- LivingEntityPatch<T> abstract — getAnimator, getArmature, getTarget, getYRot*
- MobPatch<T extends Mob> — instanceof check only
- item/CapabilityItem — type marker

Forks utilitaires :
- rig/collider/OBBCollider — geometry only (strip Entity collision, drawInternal)
- anim/types/StateSpectrum — identique EF, imports rewrités
- util/PacketBufferCodec — StreamCodec backport
- util/TimePairList — identique EF
- util/HitEntityList — shell pour Priority enum uniquement
- util/ExtendableEnum + ExtendableEnumManager — register/assign enum

Fix package declarations :
- armature/Joint.java + JointTransform.java : package rig.anim -> rig.armature
- Imports JointTransform ajoutés dans anim/{Pose,Keyframe,TransformSheet}

Residu 135 errors = cluster rendering (Phase 2) :
- render/TiedUpRenderTypes (17) : CompositeState package-private MC
- event/PatchedRenderersEvent (11) : missing PatchedEntityRenderer
- mesh/SkinnedMesh (13) : VanillaMeshPartDefinition, compute shader fields
- asset/JsonAssetLoader (6), anim/LivingMotion (5)
This commit is contained in:
NotEvil
2026-04-22 02:45:18 +02:00
parent 06678199be
commit b034184f8a
46 changed files with 1574 additions and 2260 deletions

View File

@@ -56,15 +56,11 @@ import com.tiedup.remake.rig.anim.types.StaticAnimation;
import com.tiedup.remake.rig.asset.AssetAccessor;
import com.tiedup.remake.rig.asset.JsonAssetLoader;
import com.tiedup.remake.rig.anim.client.AnimationSubFileReader;
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 com.tiedup.remake.rig.TiedUpRigRegistry;
import com.tiedup.remake.rig.TiedUpRigConstants;
import yesman.epicfight.network.EpicFightNetworkManager;
import yesman.epicfight.network.client.CPCheckAnimationRegistryMatches;
import yesman.epicfight.network.server.SPDatapackSync;
@SuppressWarnings("unchecked")
public class AnimationManager extends SimplePreparableReloadListener<List<ResourceLocation>> {
@@ -212,7 +208,7 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
}
});
SkillManager.reloadAllSkillsAnimations();
// RIG : SkillManager.reloadAllSkillsAnimations() strippé (combat skills).
this.animations.entrySet().stream()
.reduce(
@@ -301,88 +297,13 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
* custom weapon types & mob capabilities won't be created because they won't be able to find the animations from the server
* dummy animations will be automatically removed right after reloading resourced as the server forces using resource pack
*/
@OnlyIn(Dist.CLIENT)
public void processServerPacket(SPDatapackSync packet, boolean mandatoryPack) {
if (mandatoryPack) {
for (CompoundTag tag : packet.getTags()) {
String invocationCommand = tag.getString("invoke_command");
ResourceLocation registryName = ResourceLocation.parse(tag.getString("registry_name"));
int id = tag.getInt("id");
if (this.animationByName.containsKey(registryName)) {
continue;
}
AnimationAccessor<? extends StaticAnimation> accessor = AnimationAccessorImpl.create(registryName, getResourcepackAnimationCount(), false, (accessor$2) -> {
try {
return InstantiateInvoker.invoke(invocationCommand, StaticAnimation.class).getResult();
} catch (Exception e) {
TiedUpRigConstants.LOGGER.warn("Failed at creating animation from server resource pack");
e.printStackTrace();
return TiedUpRigRegistry.EMPTY_ANIMATION;
}
});
this.animationById.put(id, accessor);
this.animationByName.put(registryName, accessor);
}
}
int animationCount = this.animations.size();
String[] registryNames = new String[animationCount];
for (int i = 0; i < animationCount; i++) {
String registryName = this.animationById.get(i + 1).registryName().toString();
registryNames[i] = registryName;
}
CPCheckAnimationRegistryMatches registrySyncPacket = new CPCheckAnimationRegistryMatches(animationCount, registryNames);
EpicFightNetworkManager.sendToServer(registrySyncPacket);
}
public void validateClientAnimationRegistry(CPCheckAnimationRegistryMatches msg, ServerGamePacketListenerImpl connection) {
StringBuilder messageBuilder = new StringBuilder();
int count = 0;
Set<String> clientAnimationRegistry = new HashSet<> (Set.of(msg.registryNames));
for (String registryName : this.animations.keySet().stream().map((rl) -> rl.toString()).toList()) {
if (!clientAnimationRegistry.contains(registryName)) {
// Animations that don't exist in client
if (count < 10) {
messageBuilder.append(registryName);
messageBuilder.append("\n");
}
count++;
} else {
clientAnimationRegistry.remove(registryName);
}
}
// Animations that don't exist in server
for (String registryName : clientAnimationRegistry) {
if (registryName.equals("empty")) {
continue;
}
if (count < 10) {
messageBuilder.append(registryName);
messageBuilder.append("\n");
}
count++;
}
if (count >= 10) {
messageBuilder.append(Component.translatable("gui.epicfight.warn.animation_unsync.etc", (count - 9)).getString());
messageBuilder.append("\n");
}
if (!messageBuilder.isEmpty()) {
connection.disconnect(Component.translatable("gui.epicfight.warn.animation_unsync", messageBuilder.toString()));
}
}
// RIG : processServerPacket + validateClientAnimationRegistry strippés.
// C'était le protocole datapack-sync EF pour valider que le client a les
// mêmes animations que le serveur au login (important pour les animations
// combat stockées en data/). TiedUp utilise resource pack uniquement
// (assets/) côté client, pas de sync datapack nécessaire.
// Ré-introduire Phase 2+ si on veut un warning quand un pack d'animations
// custom diverge.
private static final Set<String> NO_WARNING_MODID = Sets.newHashSet();