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:
notevil
2026-04-22 00:53:42 +02:00
parent 324e7fb984
commit f0d8408384
19 changed files with 324 additions and 157 deletions

View File

@@ -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 {

View File

@@ -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);