Skip to content
Open

Dev #567

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/emf_animation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
# render.shadow_opacity - How transparent the shadow is
# render.shadow_offset_x, render.shadow_offset_z - The location of the shadow
# render.leash_offset_x, render.leash_offset_y, render.leash_offset_z - The position of the point the leash attaches to
@ render.leash_holder_offset_x, render.leash_holder_offset_y,
@ render.leash_holder_offset_z - The position of the point the leash attaches to for the holding entity
@ render.<LEASH_OFFSET_TYPE>_1, render.<LEASH_OFFSET_TYPE>_2,
@ render.<LEASH_OFFSET_TYPE>_3 , render.<LEASH_OFFSET_TYPE>_4 - The 4 corner positions of leashes when on happy ghast and boats (fallback to the leash_offset_x/y/zif not present)
@ render.fire_x, render.fire_y, render.fire_z - The position of the fire effect
@ render.fire_scale, render.fire_height - The scale and height of the fire effect
#
# Expressions
#
Expand Down Expand Up @@ -163,6 +169,9 @@
@ is_holding_item_left - If an item is held in the entities left hand slot
@ is_paused - If the game is paused
@ is_hovered - If the entity is being looked at and within normal reach of the player
@ is_player_first_person - If the player is in first person view
@ is_player_third_person - If the player is in third person view
@ is_player_third_person_reversed - If the player is in reversed third person view
#
# Operators
# +, -, *, /, %
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@

[?]
- fixed several model exporting issues, including missing parts, wrong rotations, missing mirrored uvs, and rabbit/axolotl legs on 26.1+
- fixed block entity models breaking in the latest versions
- fixed vex & allay items not matching animated arm positions
- fixed `render.shadow_size`, `render.shadow_opacity`, `render.shadow_offset_x`, `render.shadow_offset_z`
- added `render.fire_x`, `render.fire_y`, `render.fire_z` animation variables for controlling the fire rendering position on entities
- added `render.fire_scale`, `render.fire_height` animation variables for controlling the fire rendering scale and height on entities
- fixed `render.leash_offset_x`, `render.leash_offset_y`, `render.leash_offset_z`
- added `render.leash_holder_offset_x`, `render.leash_holder_offset_y`, `render.leash_holder_offset_z` which do the same as above but affect the holding entity instead of the leashed entity
- added `render.<LEASH_OFFSET_TYPE>_1`, `render.<LEASH_OFFSET_TYPE>_2`, `render.<LEASH_OFFSET_TYPE>_3` , `render.<LEASH_OFFSET_TYPE>_4`
- these can apply to any of the x,y,z or holder and normal leash offset values and allows you to modify the quad leash offsets used by ghasts and boats, and any other entity that uses a quad leash connection
- Note: if the _1 .. _4 variants aren't used then the regular x,y,z offset can be used instead applied to all 4 positions
- improved and fixed item attachment handling
- fixed debug outline rendering not outlining everything
- fixed 26.2 neoforge iris compatibility not working causing excess animation during the shadow pass
- fixed first person arm rendering with sleeves even when turned off in the settings
- fixed first person arm animations with some other mods hand rendering
- fixed several issues relating to layered or held models desyncing with or breaking the base model e.g. held tridents possibly breaking the player model
- added new boolean animation variables `is_player_first_person`, `is_player_third_person`, `is_player_third_person_reversed`

[3.2.4]
Expand Down
14 changes: 8 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ base.archivesName.set("entity_model_features-$modVersion-${project.name}")

val manuallyAccessTransform = mcVersion >= 26_00_00 && platform.isNeoForge
val accessWidener = "entity_model_features_" + when {
mcVersion >= 26_02_00 -> 15
mcVersion >= 26_01_00 -> 14
mcVersion >= 1_21_11 -> 13
mcVersion >= 1_21_09 -> 12
Expand Down Expand Up @@ -97,14 +98,13 @@ dependencies {
fun modImpl(modPrefix: String, vararg versions: Pair<Int, String?>): Boolean {
for ((versionMC, versionMod) in versions) {
if (platform.mcVersion >= versionMC) {
if (versionMod != null) {
return if (versionMod != null) {
modImplementation("$modPrefix$versionMod") {
exclude("net.fabricmc.fabric-api")
isTransitive = true
}
return true
}
break
true
} else false
}
}
return false
Expand Down Expand Up @@ -136,7 +136,8 @@ dependencies {

"IRIS" setVar (
modImpl("maven.modrinth:iris:",
26_01_00 to ver("4cGUAiJ6", null, null),
26_02_00 to ver("3uIIps8q", null, "1.11.2+26.2-neoforge"),
26_01_00 to ver("MwcLS51S", null, "YEGDGnJM"),
//1_21_11 to ver("TSXvi2yD", null, "t3ruzodq"), //"k9tHcfnb"), //todo why does this break
1_21_06 to ver("l77DAK6U", null, "t3ruzodq"), //"xA5cxBvz"), // same here
1_21_05 to ver("U6evbjd0", null, "t3ruzodq"), //"KAopiPos"),
Expand All @@ -154,6 +155,7 @@ dependencies {
if (platform.isFabric) {
modImpl(
"maven.modrinth:modmenu:",
26_02_00 to "TLnEHUyx",
26_01_00 to "XIDyVLo7",
1_21_05 to "R7uVB42W",
1_21_02 to "PcJvQYqu",
Expand Down Expand Up @@ -314,7 +316,7 @@ private fun changelog(): String? {
}
}

if (sb.isEmpty()) null
if (sb.isEmpty()) return null

return sb.toString()
}
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ essential.defaults.loom.mappings=mojmap
loom.ignoreDependencyLoomVersionValidation=true

archives_base_name=entity_model_features
mod_version=3.2.4
mod_version=3.3
maven_group=traben.entity_model_features

etf_version=7.1
use_local_etf=false
etf_version=7.2
use_local_etf=true

5 changes: 3 additions & 2 deletions root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
// Advanced users may use multiple (potentially independent) multi-version trees in different sub-projects.
// This is currently equivalent to applying `com.replaymod.preprocess-root`.
kotlin("jvm") version "2.3.0" apply false
id("gg.essential.loom") version "1.15.49" apply false // https://repo.essential.gg/#/public/gg/essential/loom/gg.essential.loom.gradle.plugin
id("gg.essential.loom") version "1.15.50" apply false // https://repo.essential.gg/#/public/gg/essential/loom/gg.essential.loom.gradle.plugin
id("gg.essential.multi-version.root")
}

Expand Down Expand Up @@ -56,7 +56,8 @@ preprocess {
// next, then remap the main project to this and set the current to old
//current.connectToVersion(12109, forge = false, neoforge = false)

null.connectToVersion(26_01_00, forge = false, neoforge = true)
null.connectToVersion(26_02_00, forge = false, neoforge = true)
.connectToVersion(26_01_00, forge = false, neoforge = true)
.connectToVersion(1_21_11)
.connectToVersion(1_21_09)
.connectToVersion(1_21_06)
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pluginManagement {
maven("https://maven.neoforged.net/releases/")
}
plugins {
val egtVersion = "0.7.0-alpha.5"
val egtVersion = "0.7.2"
id("gg.essential.multi-version.root") version egtVersion
id("gg.essential.multi-version.api-validation") version egtVersion
}
Expand All @@ -36,6 +36,7 @@ fun MutableList<String>.version(mcVersion: Int, forge: Boolean = true, neoforge:
}

mutableListOf<String>()
.version(26_02_00, forge = false, neoforge = true)
.version(26_01_00, forge = false, neoforge = true)
.version(12111)
.version(12109)
Expand Down
42 changes: 41 additions & 1 deletion src/main/java/traben/entity_model_features/EMF.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
import org.apache.logging.log4j.LogManager;
import traben.entity_model_features.config.EMFConfig;
import traben.entity_model_features.mod_compat.PALCompat;
import traben.entity_model_features.models.animation.state.EMFEntityRenderState;
import traben.entity_model_features.models.animation.state.EMFEntityRenderStateViaReference;
import traben.entity_model_features.models.animation.state.EMFState;
import traben.entity_model_features.models.parts.EMFModelPartRoot;
import traben.entity_model_features.models.parts.EMFModelPartVanilla;
import traben.entity_model_features.propeties.*;
import traben.entity_model_features.utils.EMFEntity;
import traben.entity_model_features.utils.EMFUtils;
Expand All @@ -17,14 +21,17 @@
import traben.entity_texture_features.config.ETFConfigWarnings;
import traben.entity_texture_features.features.property_reading.properties.RandomProperties;
import traben.entity_texture_features.features.state.ETFEntityRenderState;
import traben.entity_texture_features.features.state.ETFState;
import traben.entity_texture_features.features.state.ETFSubmitData;
import traben.entity_texture_features.utils.ETFEntity;
import traben.entity_texture_features.utils.ETFUtils2;
import traben.tconfig.TConfigHandler;

import java.util.Random;

public class EMF {

public static final int EYES_FEATURE_LIGHT_VALUE = ETFUtils2.FULL_BRIGHT + 1;

public static final String MOD_ID = "entity_model_features";
public static boolean forgeHadLoadingError = false;
public static boolean testedForge = !ETF.isForge();
Expand Down Expand Up @@ -110,6 +117,39 @@ public String getSubTitle() {
} catch (Exception ignored) {}
}
//#endif

//#if MC >= 1.21.9
ETFSubmitData.DATA_IN.add((data, vanilla)->{

var state = EMFState.state();
if (state != null) {
var pose = state.getBipedPose();
if (pose != null && pose.applyToSubmit) {
data.data.put("bipedPose", state.getBipedPose());
}
}

data.data.put("onShoulder", state != null && state.onShoulder());

data.data.put("isMainModelPhase", EMFState.isMainPhase);
data.data.put("isLayerModelPhase", EMFState.isLayerPhase);

EMFModelPartRoot emfRoot = vanilla.model().root() instanceof EMFModelPartRoot ? (EMFModelPartRoot) vanilla.model().root() : null;
if (emfRoot != null) {
data.data.put("modelVariant", emfRoot.currentModelVariant);
}
});

//#if MC >= 26.2
ETFSubmitData.DATA_OUT.add((data, vanilla)->{
// Replaces logic for model part submits that now wrap in simple models
if (vanilla.model().root() instanceof EMFModelPartVanilla partVanilla && partVanilla.getRoot() != partVanilla) {
EMFManager.getInstance().entityRenderCount++; // TODO still needed?
}
});
//#endif

//#endif
}

//mod menu config screen factory
Expand Down
22 changes: 12 additions & 10 deletions src/main/java/traben/entity_model_features/EMFAnimationApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
import org.apache.commons.lang3.function.TriFunction;
import org.jetbrains.annotations.Nullable;
import traben.entity_model_features.models.IEMFModel;
import traben.entity_model_features.models.animation.EMFAnimationEntityContext;
import traben.entity_model_features.models.animation.math.asm.ASMVisitable;
import traben.entity_model_features.models.animation.math.methods.MethodRegistry;
import traben.entity_model_features.models.animation.math.variables.VariableRegistry;
import traben.entity_model_features.models.animation.math.variables.factories.UniqueVariableFactory;
import traben.entity_model_features.models.animation.state.EMFState;
import traben.entity_model_features.models.parts.EMFModelPart;
import traben.entity_model_features.models.parts.EMFModelPartCustom;
import traben.entity_model_features.utils.EMFAnimationPauseHandler;
import traben.entity_model_features.utils.EMFEntity;
import traben.entity_model_features.utils.EMFUtils;

Expand Down Expand Up @@ -54,7 +55,8 @@ static int getApiVersion() {
* @return the currently rendered entity
*/
static @Nullable EMFEntity getCurrentEntity() {
return EMFAnimationEntityContext.getEMFEntity();
var state = EMFState.state();
return state != null ? state.emfEntity() : null;
}

/**
Expand Down Expand Up @@ -201,7 +203,7 @@ static boolean registerPauseCondition(Function<EMFEntity, Boolean> shouldPause)
if (shouldPause == null) {
throw paramFail("null pause condition");
}
EMFAnimationEntityContext.pauseListeners.add(shouldPause);
EMFAnimationPauseHandler.pauseListeners.add(shouldPause);
return true;
}

Expand All @@ -213,7 +215,7 @@ static boolean pauseAllCustomAnimationsForEntity(EMFEntity entityOrBlockEntity)
if (entityOrBlockEntity == null || entityOrBlockEntity.etf$getUuid() == null) {
return false;
}
EMFAnimationEntityContext.entitiesPaused.add(entityOrBlockEntity.etf$getUuid());
EMFAnimationPauseHandler.entitiesPaused.add(entityOrBlockEntity.etf$getUuid());
return true;
}

Expand All @@ -225,8 +227,8 @@ static boolean resumeAllCustomAnimationsForEntity(EMFEntity entityOrBlockEntity)
if (entityOrBlockEntity == null || entityOrBlockEntity.etf$getUuid() == null) {
return false;
}
EMFAnimationEntityContext.entitiesPaused.remove(entityOrBlockEntity.etf$getUuid());
EMFAnimationEntityContext.entitiesPausedParts.remove(entityOrBlockEntity.etf$getUuid());
EMFAnimationPauseHandler.entitiesPaused.remove(entityOrBlockEntity.etf$getUuid());
EMFAnimationPauseHandler.entitiesPausedParts.remove(entityOrBlockEntity.etf$getUuid());
return true;
}

Expand All @@ -240,7 +242,7 @@ static boolean pauseCustomAnimationsForThesePartsOfEntity(EMFEntity entityOrBloc
|| parts == null || parts.length == 0) {
return false;
}
EMFAnimationEntityContext.entitiesPausedParts.put(entityOrBlockEntity.etf$getUuid(), parts);
EMFAnimationPauseHandler.entitiesPausedParts.put(entityOrBlockEntity.etf$getUuid(), parts);
return true;
}

Expand All @@ -254,7 +256,7 @@ static boolean registerVanillaModelCondition(Function<EMFEntity, Boolean> should
if (shouldUseVanillaModel == null) {
throw paramFail("null vanilla model condition");
}
EMFAnimationEntityContext.forceVanillaModelListeners.add(shouldUseVanillaModel);
EMFState.forceVanillaModelListeners.add(shouldUseVanillaModel);
return true;
}

Expand All @@ -266,7 +268,7 @@ static boolean lockEntityToVanillaModel(EMFEntity entityOrBlockEntity){
if (entityOrBlockEntity == null || entityOrBlockEntity.etf$getUuid() == null) {
return false;
}
EMFAnimationEntityContext.entitiesToForceVanillaModel.add(entityOrBlockEntity.etf$getUuid());
EMFState.entitiesToForceVanillaModel.add(entityOrBlockEntity.etf$getUuid());
return true;
}

Expand All @@ -278,7 +280,7 @@ static boolean unlockEntityToVanillaModel(EMFEntity entityOrBlockEntity){
if (entityOrBlockEntity == null || entityOrBlockEntity.etf$getUuid() == null) {
return false;
}
EMFAnimationEntityContext.entitiesToForceVanillaModel.remove(entityOrBlockEntity.etf$getUuid());
EMFState.entitiesToForceVanillaModel.remove(entityOrBlockEntity.etf$getUuid());
return true;
}

Expand Down
Loading