Improved cloak physics
This commit is contained in:
+4
-13
@@ -314,25 +314,16 @@ public class CloakFeatureRenderer extends FeatureRenderer<PlayerEntityRenderStat
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
if (now - lastUpdate >= 20) {
|
||||
float velX = Math.min(1.0f, playerEntityRenderState.field_53537 / 108.0f);
|
||||
float velX = Math.min(0.6f, playerEntityRenderState.field_53537 / 108.0f);
|
||||
float rawVelY = playerEntityRenderState.field_53536;
|
||||
float velY = (rawVelY > 4.0f ? rawVelY : 0.0f) / 16;
|
||||
float velY = (rawVelY > 3.4f ? rawVelY : 0.0f) / 16;
|
||||
|
||||
float value = playerEntityRenderState.isSwimming ? 0.0f : velX + velY;
|
||||
|
||||
if (Config.cloakPhysics.value) {
|
||||
updateSegmentValues(value);
|
||||
updateSegmentValues(segmentValues[0] + (value - segmentValues[0]) * 0.3f);
|
||||
} else {
|
||||
float last = segmentValues[0];
|
||||
float maxStep = 0.02f;
|
||||
float next = value;
|
||||
|
||||
if (next > last)
|
||||
next = Math.min(next, last + maxStep);
|
||||
else if (next < last)
|
||||
next = Math.max(next, last - maxStep);
|
||||
|
||||
Arrays.fill(segmentValues, next);
|
||||
Arrays.fill(segmentValues, segmentValues[0] + (value - segmentValues[0]) * 0.05f);
|
||||
}
|
||||
lastUpdate = now;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user