Skip to content

Commit

Permalink
Dusting off cobwebs (again)
Browse files Browse the repository at this point in the history
- Began updating to 1.21.4, not fully fixed yet
  • Loading branch information
Trainguy9512 committed Jan 14, 2025
1 parent c417c21 commit 6c71995
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 43 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'fabric-loom' version '1.9-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

repositories {
maven { url "https://maven.terraformersmc.com/" }
//MOD MENU maven { url "https://maven.terraformersmc.com/" }

// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
Expand All @@ -31,7 +32,7 @@ dependencies {
// mod menu (1.19)
//modRuntimeOnly "com.terraformersmc:modmenu:5.0.2"

// Uncomment the following line to enable the deprecated Fabric API modules.
// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.

// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
Expand All @@ -46,8 +47,7 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
it.options.release = 21
}

java {
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.22
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.8
loader_version=0.16.10

# Mod Properties
mod_version = 2.0.0-alpha
maven_group = com.trainguy9512
archives_base_name = animation-overhaul

# Dependencies
fabric_version=0.89.3+1.20.2
fabric_version=0.114.2+1.21.4
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.joml.Vector3f;

import java.util.function.BiFunction;
import java.util.function.Function;

public class FirstPersonPlayerJointAnimator extends LivingEntityJointAnimator<LocalPlayer, PlayerModel<LocalPlayer>, FirstPersonPlayerJointAnimator.FPPlayerLocators> {

Expand Down Expand Up @@ -135,16 +134,16 @@ public FirstPersonPlayerJointAnimator(){

protected JointSkeleton<FPPlayerLocators> buildRig() {
return JointSkeleton.of(FPPlayerLocators.root)
.addChildLocator(FPPlayerLocators.camera)
.addChildLocator(FPPlayerLocators.armBuffer)
.addChildLocator(FPPlayerLocators.leftArmBuffer, FPPlayerLocators.armBuffer)
.addChildLocator(FPPlayerLocators.rightArmBuffer, FPPlayerLocators.armBuffer)
.addChildLocator(FPPlayerLocators.leftArm, FPPlayerLocators.leftArmBuffer)
.addChildLocator(FPPlayerLocators.rightArm, FPPlayerLocators.rightArmBuffer)
.addChildLocator(FPPlayerLocators.leftHand, FPPlayerLocators.leftArm)
.addChildLocator(FPPlayerLocators.rightHand, FPPlayerLocators.rightArm)
.setLocatorDefaultPose(FPPlayerLocators.leftHand, PartPose.offsetAndRotation(1, 10, -2, -Mth.HALF_PI, 0, Mth.PI))
.setLocatorDefaultPose(FPPlayerLocators.rightHand, PartPose.offsetAndRotation(-1, 10, -2, -Mth.HALF_PI, 0, Mth.PI))
.addChildJoint(FPPlayerLocators.camera)
.addChildJoint(FPPlayerLocators.armBuffer)
.addChildJoint(FPPlayerLocators.leftArmBuffer, FPPlayerLocators.armBuffer)
.addChildJoint(FPPlayerLocators.rightArmBuffer, FPPlayerLocators.armBuffer)
.addChildJoint(FPPlayerLocators.leftArm, FPPlayerLocators.leftArmBuffer)
.addChildJoint(FPPlayerLocators.rightArm, FPPlayerLocators.rightArmBuffer)
.addChildJoint(FPPlayerLocators.leftHand, FPPlayerLocators.leftArm)
.addChildJoint(FPPlayerLocators.rightHand, FPPlayerLocators.rightArm)
.setDefaultJointTransform(FPPlayerLocators.leftHand, PartPose.offsetAndRotation(1, 10, -2, -Mth.HALF_PI, 0, Mth.PI))
.setDefaultJointTransform(FPPlayerLocators.rightHand, PartPose.offsetAndRotation(-1, 10, -2, -Mth.HALF_PI, 0, Mth.PI))
.setLocatorMirror(FPPlayerLocators.rightArm, FPPlayerLocators.leftArm)
.setLocatorMirror(FPPlayerLocators.rightHand, FPPlayerLocators.leftHand);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import com.trainguy9512.animationoverhaul.animation.data.AnimationDataContainer;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.renderer.entity.state.EntityRenderState;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;

public abstract class EntityJointAnimator<T extends Entity, M extends EntityModel<T>, L extends Enum<L>> extends JointAnimator<T, L> {
public abstract class EntityJointAnimator<R extends EntityRenderState, M extends EntityModel<R>, L extends Enum<L>> extends JointAnimator<T, L> {


//protected AnimationDataContainer entityAnimationData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import org.jetbrains.annotations.NotNull;

public class PlayerJointAnimator extends LivingEntityJointAnimator<Player, PlayerModel<Player>, PlayerJointAnimator.ModelPartLocators> {
public class PlayerJointAnimator extends LivingEntityJointAnimator<Player, PlayerModel, PlayerJointAnimator.ModelPartLocators> {

private static final String MODEL_PART_ROOT = "root";
private static final String MODEL_PART_HEAD = "head";
Expand Down Expand Up @@ -47,25 +45,25 @@ protected JointSkeleton<ModelPartLocators> buildRig() {
//TODO: Adjust rig with proper parenting and no more offsets on the legs.

return JointSkeleton.of(ModelPartLocators.root)
.addChildLocator(ModelPartLocators.body)
.addChildLocator(ModelPartLocators.cape)
.addChildLocator(ModelPartLocators.leftArm)
.addChildLocator(ModelPartLocators.rightArm)
.addChildLocator(ModelPartLocators.leftLeg)
.addChildLocator(ModelPartLocators.rightLeg)
.addChildLocator(ModelPartLocators.head)
.addChildJoint(ModelPartLocators.body)
.addChildJoint(ModelPartLocators.cape)
.addChildJoint(ModelPartLocators.leftArm)
.addChildJoint(ModelPartLocators.rightArm)
.addChildJoint(ModelPartLocators.leftLeg)
.addChildJoint(ModelPartLocators.rightLeg)
.addChildJoint(ModelPartLocators.head)
.setLocatorModelPart(ModelPartLocators.head, MODEL_PART_HEAD)
.setLocatorModelPart(ModelPartLocators.leftArm, MODEL_PART_LEFT_ARM)
.setLocatorModelPart(ModelPartLocators.rightArm, MODEL_PART_RIGHT_ARM)
.setLocatorModelPart(ModelPartLocators.leftLeg, MODEL_PART_LEFT_LEG)
.setLocatorModelPart(ModelPartLocators.rightLeg, MODEL_PART_RIGHT_LEG)
.setLocatorModelPart(ModelPartLocators.body, MODEL_PART_BODY)
.setLocatorModelPart(ModelPartLocators.cape, MODEL_PART_CAPE)
.setLocatorDefaultPose(ModelPartLocators.leftLeg, PartPose.offset(1.9f, 12.0f, 0.0f))
.setLocatorDefaultPose(ModelPartLocators.rightLeg, PartPose.offset(-1.9f, 12.0f, 0.0f))
.setLocatorDefaultPose(ModelPartLocators.leftArm, PartPose.offset(5.0f, 2.0f, 0.0f))
.setLocatorDefaultPose(ModelPartLocators.rightArm, PartPose.offset(-5.0f, 2.0f, 0.0f))
.setLocatorDefaultPose(ModelPartLocators.cape, PartPose.offsetAndRotation(0, 0, 2, 0, Mth.PI, 0))
.setDefaultJointTransform(ModelPartLocators.leftLeg, PartPose.offset(1.9f, 12.0f, 0.0f))
.setDefaultJointTransform(ModelPartLocators.rightLeg, PartPose.offset(-1.9f, 12.0f, 0.0f))
.setDefaultJointTransform(ModelPartLocators.leftArm, PartPose.offset(5.0f, 2.0f, 0.0f))
.setDefaultJointTransform(ModelPartLocators.rightArm, PartPose.offset(-5.0f, 2.0f, 0.0f))
.setDefaultJointTransform(ModelPartLocators.cape, PartPose.offsetAndRotation(0, 0, 2, 0, Mth.PI, 0))
.setLocatorMirror(ModelPartLocators.leftArm, ModelPartLocators.rightArm)
.setLocatorMirror(ModelPartLocators.rightArm, ModelPartLocators.leftArm)
.setLocatorMirror(ModelPartLocators.leftLeg, ModelPartLocators.rightLeg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private JointSkeleton<L> addLocator(Enum<L>locator){
return this;
}

public JointSkeleton<L> addChildLocator(Enum<L> locatorChild, Enum<L> locatorParent){
public JointSkeleton<L> addChildJoint(Enum<L> locatorChild, Enum<L> locatorParent){
if(this.locatorHashMap.keySet().contains(locatorParent)){
this.addLocator(locatorChild);
this.locatorHashMap.get(locatorParent).addChild(locatorChild);
Expand All @@ -70,8 +70,8 @@ public JointSkeleton<L> addChildLocator(Enum<L> locatorChild, Enum<L> locatorPar
return this;
}

public JointSkeleton<L> addChildLocator(Enum<L> locatorChild){
return this.addChildLocator(locatorChild, this.rootLocator);
public JointSkeleton<L> addChildJoint(Enum<L> locatorChild){
return this.addChildJoint(locatorChild, this.rootLocator);
}

public List<Enum<L>> getLocatorChildren(Enum<L> locator){
Expand Down Expand Up @@ -185,7 +185,7 @@ public boolean getLocatorUsesModelPart(Enum<L> locator){
* @param pose The part pose used as the default pose
* @return This skeleton
*/
public JointSkeleton<L> setLocatorDefaultPose(Enum<L> locator, PartPose pose){
public JointSkeleton<L> setDefaultJointTransform(Enum<L> locator, PartPose pose){
this.locatorHashMap.get(locator).setDefaultPose(pose);
return this;
}
Expand Down

0 comments on commit 6c71995

Please sign in to comment.