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> {
M invoke(Map arrayMap, Map> parts, M parent, RenderProperties properties);
}
-
+
public static record MeshAccessor (ResourceLocation registryName, Function jsonLoader, boolean inRegistry) implements AssetAccessor, SoftBodyTranslatable {
public static MeshAccessor create(String namespaceId, String path, Function jsonLoader) {
return create(ResourceLocation.fromNamespaceAndPath(namespaceId, path), jsonLoader, true);
}
-
+
private static MeshAccessor create(ResourceLocation id, Function jsonLoader, boolean inRegistry) {
MeshAccessor accessor = new MeshAccessor (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 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 getSoftBodySimulationInfo() {
Mesh mesh = this.get();
-
+
if (mesh instanceof SoftBodyTranslatable softBodyTranslatable) {
return softBodyTranslatable.getSoftBodySimulationInfo();
} else {
diff --git a/src/main/java/com/tiedup/remake/rig/mesh/SkinnedMesh.java b/src/main/java/com/tiedup/remake/rig/mesh/SkinnedMesh.java
index 27fe633..e15c5bb 100644
--- a/src/main/java/com/tiedup/remake/rig/mesh/SkinnedMesh.java
+++ b/src/main/java/com/tiedup/remake/rig/mesh/SkinnedMesh.java
@@ -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 {
@@ -246,7 +246,7 @@ public class SkinnedMesh extends StaticMesh {
@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);
diff --git a/src/main/java/com/tiedup/remake/rig/patch/ClientPlayerPatch.java b/src/main/java/com/tiedup/remake/rig/patch/ClientPlayerPatch.java
index c093232..c63772f 100644
--- a/src/main/java/com/tiedup/remake/rig/patch/ClientPlayerPatch.java
+++ b/src/main/java/com/tiedup/remake/rig/patch/ClientPlayerPatch.java
@@ -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 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();
}
diff --git a/src/main/java/com/tiedup/remake/rig/patch/LocalPlayerPatch.java b/src/main/java/com/tiedup/remake/rig/patch/LocalPlayerPatch.java
index d09b780..a4c5f29 100644
--- a/src/main/java/com/tiedup/remake/rig/patch/LocalPlayerPatch.java
+++ b/src/main/java/com/tiedup/remake/rig/patch/LocalPlayerPatch.java
@@ -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 {
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 {
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 {
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 {
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 {
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 {
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 {
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 {
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) {