Fixed posture when using riptide

This commit is contained in:
Sollace 2021-06-07 16:27:54 +02:00
parent 7ba88d439b
commit 0ea6cad9a6
5 changed files with 13 additions and 3 deletions

View file

@ -19,5 +19,5 @@ org.gradle.daemon=false
# Dependencies # Dependencies
modmenu_version=2.0.0-beta.7 modmenu_version=2.0.0-beta.7
kirin_version=1.8.6-1.17-rc1-SNAPSHOT kirin_version=1.8.6-1.17-rc1-SNAPSHOT
hd_skins_version=6.4.4-1.17-rc1-SNAPSHOT hd_skins_version=6.4.5-1.17-rc1-SNAPSHOT
mson_version=1.3.2-1.17-rc1-SNAPSHOT mson_version=1.3.2-1.17-rc1-SNAPSHOT

View file

@ -32,6 +32,10 @@ public class ModelAttributes {
* True if the model is rotated 90degs (players) * True if the model is rotated 90degs (players)
*/ */
public boolean isHorizontal; public boolean isHorizontal;
/**
* True if the model is using riptide (players)
*/
public boolean isRiptide;
/** /**
* True if the model is swimming under water. * True if the model is swimming under water.
*/ */
@ -98,6 +102,7 @@ public class ModelAttributes {
isGoingFast = (isFlying && hasWings) || isGliding; isGoingFast = (isFlying && hasWings) || isGliding;
isGoingFast &= zMotion > 0.4F; isGoingFast &= zMotion > 0.4F;
isGoingFast |= entity.isUsingRiptide();
motionLerp = MathUtil.clampLimit(zMotion * 30, 1); motionLerp = MathUtil.clampLimit(zMotion * 30, 1);
@ -123,6 +128,7 @@ public class ModelAttributes {
isGliding = entity.isFallFlying(); isGliding = entity.isFallFlying();
isSwimming = mode == Mode.THIRD_PERSON && pony.isSwimming(entity); isSwimming = mode == Mode.THIRD_PERSON && pony.isSwimming(entity);
isSwimmingRotated = isSwimming && (entity instanceof PlayerEntity || entity instanceof Swimmer); isSwimmingRotated = isSwimming && (entity instanceof PlayerEntity || entity instanceof Swimmer);
isRiptide = entity.isUsingRiptide();
isHorizontal = isSwimming; isHorizontal = isSwimming;
isRidingInteractive = pony.isRidingInteractive(entity); isRidingInteractive = pony.isRidingInteractive(entity);
interpolatorId = entity.getUuid(); interpolatorId = entity.getUuid();

View file

@ -645,7 +645,7 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
@Override @Override
public void transform(BodyPart part, MatrixStack stack) { public void transform(BodyPart part, MatrixStack stack) {
if (attributes.isSleeping) { if (attributes.isSleeping || attributes.isRiptide) {
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90)); stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90));
stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180)); stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180));
} }

View file

@ -121,7 +121,7 @@ public class EquineRenderManager<T extends LivingEntity, M extends EntityModel<T
return PonyPosture.SWIMMING; return PonyPosture.SWIMMING;
} }
if (getModel().getAttributes().isGoingFast) { if (getModel().getAttributes().isGoingFast && !getModel().getAttributes().isRiptide) {
return PonyPosture.FLYING; return PonyPosture.FLYING;
} }

View file

@ -32,6 +32,8 @@ import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.render.entity.PlayerEntityRenderer; import net.minecraft.client.render.entity.PlayerEntityRenderer;
import net.minecraft.client.render.entity.feature.FeatureRenderer; import net.minecraft.client.render.entity.feature.FeatureRenderer;
import net.minecraft.client.render.entity.feature.StuckArrowsFeatureRenderer; import net.minecraft.client.render.entity.feature.StuckArrowsFeatureRenderer;
import net.minecraft.client.render.entity.feature.StuckStingersFeatureRenderer;
import net.minecraft.client.render.entity.feature.TridentRiptideFeatureRenderer;
import net.minecraft.client.render.entity.model.PlayerEntityModel; import net.minecraft.client.render.entity.model.PlayerEntityModel;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.Vec3f; import net.minecraft.util.math.Vec3f;
@ -64,6 +66,8 @@ public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRen
addLayer(new CapeFeature<>(this)); addLayer(new CapeFeature<>(this));
addLayer(new PassengerFeature<>(this, context)); addLayer(new PassengerFeature<>(this, context));
addLayer(new GearFeature<>(this)); addLayer(new GearFeature<>(this));
addFeature(new TridentRiptideFeatureRenderer<>(this, context.getModelLoader()));
addFeature(new StuckStingersFeatureRenderer<>(this));
} }
@SuppressWarnings({"unchecked", "rawtypes"}) @SuppressWarnings({"unchecked", "rawtypes"})