mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-29 15:49:09 +01:00
Properly implement freezing ticks
This commit is contained in:
parent
b2ebfc6803
commit
ef0503ede0
1 changed files with 5 additions and 3 deletions
|
@ -305,9 +305,11 @@ public class Entity {
|
|||
metadata.getFlags().setFlag(EntityFlag.SWIMMING, pose.equals(Pose.SWIMMING));
|
||||
setDimensions(pose);
|
||||
break;
|
||||
case 7:
|
||||
//TODO check
|
||||
metadata.put(EntityData.FREEZING_EFFECT_STRENGTH, entityMetadata.getValue());
|
||||
case 7: // Freezing ticks
|
||||
// The value that Java edition gives us is in ticks, but Bedrock uses a float percentage of the strength 0.0 -> 1.0
|
||||
// The Java client caps its freezing tick percentage at 140
|
||||
int freezingTicks = Math.min((int) entityMetadata.getValue(), 140);
|
||||
metadata.put(EntityData.FREEZING_EFFECT_STRENGTH, (freezingTicks / (float) 140));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue