-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Removed part-transform-based variables - Added proper variables stored in LivingEntity - Fixed arms spreading apart when looking up or down while holding charged crossbow - Added rotation for Ghasts when flying up and down - Fixed player animations on servers for the most part, there's still noticable issues with sprint jumping and crossbow charging that still need to be worked out - Updated version to test5
- Loading branch information
1 parent
c576ae7
commit 0bc0631
Showing
6 changed files
with
156 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/java/com/trainguy/animationoverhaul/access/LivingEntityAccess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.trainguy.animationoverhaul.access; | ||
|
||
public interface LivingEntityAccess { | ||
float getAnimationVariable(String animationVariable); | ||
void setAnimationVariable(String animationVariable, float newValue); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
src/main/java/com/trainguy/animationoverhaul/mixin/MixinLivingEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.trainguy.animationoverhaul.mixin; | ||
|
||
import com.trainguy.animationoverhaul.access.LivingEntityAccess; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
|
||
@Unique | ||
@Mixin(LivingEntity.class) | ||
public abstract class MixinLivingEntity implements LivingEntityAccess { | ||
public float crouchAmount; | ||
public float inAirAmount; | ||
public float kneelAmount; | ||
public float verticalMovementRotation; | ||
public float sprintAmount; | ||
|
||
public float leftArmItemPoseAmount; | ||
public float rightArmItemPoseAmount; | ||
|
||
public float leftArmBowPoseAmount; | ||
public float rightArmBowPoseAmount; | ||
|
||
public float leftArmSpearPoseAmount; | ||
public float rightArmSpearPoseAmount; | ||
|
||
public float leftArmCrossbowPoseAmount; | ||
public float rightArmCrossbowPoseAmount; | ||
|
||
public float leftArmShieldPoseAmount; | ||
public float rightArmShieldPoseAmount; | ||
|
||
public float leftArmSpyglassPoseAmount; | ||
public float rightArmSpyglassPoseAmount; | ||
|
||
public float getAnimationVariable(String variableType){ | ||
return switch (variableType) { | ||
case "crouchAmount" -> crouchAmount; | ||
case "inAirAmount" -> inAirAmount; | ||
case "kneelAmount" -> kneelAmount; | ||
case "sprintAmount" -> sprintAmount; | ||
case "verticalMovementRotation" -> verticalMovementRotation; | ||
case "leftArmItemPoseAmount" -> leftArmItemPoseAmount; | ||
case "rightArmItemPoseAmount" -> rightArmItemPoseAmount; | ||
case "leftArmBowPoseAmount" -> leftArmBowPoseAmount; | ||
case "rightArmBowPoseAmount" -> rightArmBowPoseAmount; | ||
case "leftArmSpearPoseAmount" -> leftArmSpearPoseAmount; | ||
case "rightArmSpearPoseAmount" -> rightArmSpearPoseAmount; | ||
case "leftArmCrossbowPoseAmount" -> leftArmCrossbowPoseAmount; | ||
case "rightArmCrossbowPoseAmount" -> rightArmCrossbowPoseAmount; | ||
case "leftArmShieldPoseAmount" -> leftArmShieldPoseAmount; | ||
case "rightArmShieldPoseAmount" -> rightArmShieldPoseAmount; | ||
case "leftArmSpyglassPoseAmount" -> leftArmSpyglassPoseAmount; | ||
case "rightArmSpyglassPoseAmount" -> rightArmSpyglassPoseAmount; | ||
default -> 0; | ||
}; | ||
} | ||
public void setAnimationVariable(String variableType, float newValue){ | ||
switch (variableType) { | ||
case "crouchAmount" -> crouchAmount = newValue; | ||
case "inAirAmount" -> inAirAmount = newValue; | ||
case "kneelAmount" -> kneelAmount = newValue; | ||
case "sprintAmount" -> sprintAmount = newValue; | ||
case "verticalMovementRotation" -> verticalMovementRotation = newValue; | ||
case "leftArmItemPoseAmount" -> leftArmItemPoseAmount = newValue; | ||
case "rightArmItemPoseAmount" -> rightArmItemPoseAmount = newValue; | ||
case "leftArmBowPoseAmount" -> leftArmBowPoseAmount = newValue; | ||
case "rightArmBowPoseAmount" -> rightArmBowPoseAmount = newValue; | ||
case "leftArmSpearPoseAmount" -> leftArmSpearPoseAmount = newValue; | ||
case "rightArmSpearPoseAmount" -> rightArmSpearPoseAmount = newValue; | ||
case "leftArmCrossbowPoseAmount" -> leftArmCrossbowPoseAmount = newValue; | ||
case "rightArmCrossbowPoseAmount" -> rightArmCrossbowPoseAmount = newValue; | ||
case "leftArmShieldPoseAmount" -> leftArmShieldPoseAmount = newValue; | ||
case "rightArmShieldPoseAmount" -> rightArmShieldPoseAmount = newValue; | ||
case "leftArmSpyglassPoseAmount" -> leftArmSpyglassPoseAmount = newValue; | ||
case "rightArmSpyglassPoseAmount" -> rightArmSpyglassPoseAmount = newValue; | ||
default -> System.out.println("Invalid variable type: " + variableType); | ||
} | ||
} | ||
} |
Oops, something went wrong.