Fixed EntityPropertiesPacket base value (#545)

This commit is contained in:
Bloepiloepi 2021-12-22 22:47:59 +01:00 committed by TheMode
parent 7e5cd64f8d
commit 18814f77e2

View File

@ -38,15 +38,9 @@ public record EntityPropertiesPacket(int entityId, List<AttributeInstance> prope
writer.writeVarInt(properties.size()); writer.writeVarInt(properties.size());
for (AttributeInstance instance : properties) { for (AttributeInstance instance : properties) {
final Attribute attribute = instance.getAttribute(); final Attribute attribute = instance.getAttribute();
double value = instance.getValue();
float maxValue = attribute.getMaxValue();
// Bypass vanilla limit client-side if needed (by sending the max value allowed)
final double v = value > maxValue ? maxValue : value;
writer.writeSizedString(attribute.getKey()); writer.writeSizedString(attribute.getKey());
writer.writeDouble(v); writer.writeDouble(instance.getBaseValue());
{ {
Collection<AttributeModifier> modifiers = instance.getModifiers(); Collection<AttributeModifier> modifiers = instance.getModifiers();