mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-12-22 16:48:25 +01:00
added OldWalkingAnimation in classic
This commit is contained in:
parent
79dfbc6b3b
commit
6c17a2c6e1
@ -5,7 +5,7 @@ minecraft_version=1.19.3
|
||||
yarn_mappings=1.19.3+build.5
|
||||
loader_version=0.14.14
|
||||
|
||||
mod_version=1.5.6
|
||||
mod_version=1.5.7
|
||||
maven_group=de.florianmichael
|
||||
archives_base_name=viafabricplus
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
package de.florianmichael.viafabricplus.injection.mixin.fixes.visual;
|
||||
|
||||
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
|
||||
import net.minecraft.client.model.ModelPart;
|
||||
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(BipedEntityModel.class)
|
||||
public class MixinBipedEntityModel<T extends LivingEntity> {
|
||||
|
||||
@Shadow @Final public ModelPart rightArm;
|
||||
|
||||
@Shadow @Final public ModelPart leftArm;
|
||||
|
||||
@Inject(method = "setAngles(Lnet/minecraft/entity/LivingEntity;FFFFF)V", at = @At(value = "FIELD", target = "Lnet/minecraft/client/model/ModelPart;roll:F", ordinal = 1, shift = At.Shift.AFTER))
|
||||
public void addOldWalkAnimation(T livingEntity, float f, float g, float h, float i, float j, CallbackInfo ci) {
|
||||
if (VisualSettings.getClassWrapper().oldWalkingAnimation.getValue()) {
|
||||
this.rightArm.pitch = MathHelper.cos(f * 0.6662F + 3.1415927F) * 2.0F * g;
|
||||
this.rightArm.roll = (MathHelper.cos(f * 0.2312F) + 1.0F) * 1.0F * g;
|
||||
|
||||
this.leftArm.pitch = MathHelper.cos(f * 0.6662F) * 2.0F * g;
|
||||
this.leftArm.roll = (MathHelper.cos(f * 0.2812F) - 1.0F) * 1.0F * g;
|
||||
}
|
||||
}
|
||||
}
|
@ -27,6 +27,7 @@ public class VisualSettings extends SettingGroup {
|
||||
|
||||
// a1_0_15 -> c0_28toc0_30
|
||||
public final ProtocolSyncBooleanSetting replaceCreativeInventory = new ProtocolSyncBooleanSetting(this, "Replace creative inventory", ProtocolRange.andOlder(LegacyProtocolVersion.c0_28toc0_30));
|
||||
public final ProtocolSyncBooleanSetting oldWalkingAnimation = new ProtocolSyncBooleanSetting(this, "Old walking animation", ProtocolRange.andOlder(LegacyProtocolVersion.c0_28toc0_30));
|
||||
|
||||
public VisualSettings() {
|
||||
super("Visual");
|
||||
|
@ -134,6 +134,7 @@
|
||||
"bridge.MixinConnectScreen",
|
||||
"bridge.MixinDownloadingTerrainScreen",
|
||||
"fixes.screen.MixinChatScreen",
|
||||
"fixes.visual.MixinBipedEntityModel",
|
||||
"fixes.visual.MixinChatHud",
|
||||
"fixes.visual.MixinChatScreen",
|
||||
"fixes.visual.MixinClientPlayerEntity",
|
||||
|
Loading…
Reference in New Issue
Block a user