WIP: create TiedUpRigConstants, replace EpicFightMod/SharedConstants refs

- Nouveau TiedUpRigConstants.java : centralise MODID/LOGGER/identifier/prefix,
  constantes runtime (IS_DEV_ENV, A_TICK, GENERAL_ANIMATION_TRANSITION_TIME,
  MAX_JOINTS), factory ANIMATOR_PROVIDER (client/server split) + helpers
  stacktraceIfDevSide/logAndStacktraceIfDevSide.

- sed global : EpicFightMod.* → TiedUpRigConstants.*
- sed global : EpicFightSharedConstants.* → TiedUpRigConstants.*
- sed global : EpicFightRenderTypes → TiedUpRenderTypes (class rename upstream)
- Fix package declarations : Armature.java + TiedUpRenderTypes.java

Résidus yesman.epicfight : 115 → 86 (-29)
Reste : gameasset/physics/network/world/config/skill (combat deps à strip) +
combat mode refs dans patch/LocalPlayerPatch + ClientPlayerPatch (Phase 2).
This commit is contained in:
notevil
2026-04-22 00:33:39 +02:00
parent cbf61906e0
commit 324e7fb984
70 changed files with 320 additions and 213 deletions

View File

@@ -62,8 +62,7 @@ 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 yesman.epicfight.main.EpicFightMod;
import yesman.epicfight.main.EpicFightSharedConstants;
import com.tiedup.remake.rig.TiedUpRigConstants;
import yesman.epicfight.network.EpicFightNetworkManager;
import yesman.epicfight.network.client.CPCheckAnimationRegistryMatches;
import yesman.epicfight.network.server.SPDatapackSync;
@@ -87,9 +86,9 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
public static boolean checkNull(AssetAccessor<? extends StaticAnimation> animation) {
if (animation == null || animation.isEmpty()) {
if (animation != null) {
EpicFightMod.stacktraceIfDevSide("Empty animation accessor: " + animation.registryName(), NoSuchElementException::new);
TiedUpRigConstants.stacktraceIfDevSide("Empty animation accessor: " + animation.registryName(), NoSuchElementException::new);
} else {
EpicFightMod.stacktraceIfDevSide("Null animation accessor", NoSuchElementException::new);
TiedUpRigConstants.stacktraceIfDevSide("Null animation accessor", NoSuchElementException::new);
}
return true;
@@ -151,7 +150,7 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
@Override
protected List<ResourceLocation> prepare(ResourceManager resourceManager, ProfilerFiller profilerIn) {
if (!EpicFightSharedConstants.isPhysicalClient() && serverResourceManager == null) {
if (!TiedUpRigConstants.isPhysicalClient() && serverResourceManager == null) {
serverResourceManager = resourceManager;
}
@@ -206,9 +205,9 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
JsonElement jsonelement = GsonHelper.fromJson(GSON, reader, JsonElement.class);
this.readResourcepackAnimation(animId, jsonelement.getAsJsonObject());
} catch (IOException | JsonParseException | IllegalArgumentException resourceReadException) {
EpicFightMod.LOGGER.error("Couldn't parse animation data from {}", animId, resourceReadException);
TiedUpRigConstants.LOGGER.error("Couldn't parse animation data from {}", animId, resourceReadException);
} catch (Exception e) {
EpicFightMod.LOGGER.error("Failed at constructing {}", animId, e);
TiedUpRigConstants.LOGGER.error("Failed at constructing {}", animId, e);
}
});
@@ -221,13 +220,13 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
MutableBoolean init = new MutableBoolean(true);
if (entry.getValue() == null || entry.getValue().getAccessor() == null) {
EpicFightMod.logAndStacktraceIfDevSide(Logger::error, "Invalid animation implementation: " + entry.getKey(), AssetLoadingException::new);
TiedUpRigConstants.logAndStacktraceIfDevSide(Logger::error, "Invalid animation implementation: " + entry.getKey(), AssetLoadingException::new);
init.set(false);
}
entry.getValue().getSubAnimations().forEach((subAnimation) -> {
if (subAnimation == null || subAnimation.get() == null) {
EpicFightMod.logAndStacktraceIfDevSide(Logger::error, "Invalid sub animation implementation: " + entry.getKey(), AssetLoadingException::new);
TiedUpRigConstants.logAndStacktraceIfDevSide(Logger::error, "Invalid sub animation implementation: " + entry.getKey(), AssetLoadingException::new);
init.set(false);
}
});
@@ -247,7 +246,7 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
.forEach(accessor -> {
accessor.doOrThrow(StaticAnimation::postInit);
if (EpicFightSharedConstants.isPhysicalClient()) {
if (TiedUpRigConstants.isPhysicalClient()) {
AnimationManager.readAnimationProperties(accessor.get());
}
});
@@ -278,7 +277,7 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
}
public static ResourceManager getAnimationResourceManager() {
return EpicFightSharedConstants.isPhysicalClient() ? Minecraft.getInstance().getResourceManager() : serverResourceManager;
return TiedUpRigConstants.isPhysicalClient() ? Minecraft.getInstance().getResourceManager() : serverResourceManager;
}
public int getResourcepackAnimationCount() {
@@ -317,7 +316,7 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
try {
return InstantiateInvoker.invoke(invocationCommand, StaticAnimation.class).getResult();
} catch (Exception e) {
EpicFightMod.LOGGER.warn("Failed at creating animation from server resource pack");
TiedUpRigConstants.LOGGER.warn("Failed at creating animation from server resource pack");
e.printStackTrace();
return Animations.EMPTY_ANIMATION;
}
@@ -401,7 +400,7 @@ public class AnimationManager extends SimplePreparableReloadListener<List<Resour
if (NO_WARNING_MODID.contains(rl.getNamespace())) {
return;
} else {
EpicFightMod.logAndStacktraceIfDevSide(
TiedUpRigConstants.logAndStacktraceIfDevSide(
Logger::error
, "Datapack animation reading failed: No constructor information has provided: " + rl
, IllegalStateException::new