Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-23 23:00:13 +01:00
Fix 1.14+ walk animation (#1469)
* Do not send NaN health metadata to 1.14+ clients * Added config option 'fix-1_14-health-nan'
Dieser Commit ist enthalten in:
Ursprung
aa9a1df1ab
Commit
7e008226ec
@ -274,4 +274,9 @@ public class BukkitViaConfig extends Config implements ViaVersionConfig {
|
||||
public boolean isNonFullBlockLightFix() {
|
||||
return getBoolean("fix-non-full-blocklight", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_14HealthNaNFix() {
|
||||
return getBoolean("fix-1_14-health-nan", true);
|
||||
}
|
||||
}
|
||||
|
@ -327,4 +327,9 @@ public class BungeeViaConfig extends Config implements ViaVersionConfig {
|
||||
public boolean isNonFullBlockLightFix() {
|
||||
return getBoolean("fix-non-full-blocklight", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_14HealthNaNFix() {
|
||||
return getBoolean("fix-1_14-health-nan", true);
|
||||
}
|
||||
}
|
||||
|
@ -344,4 +344,6 @@ public interface ViaVersionConfig {
|
||||
* @return True if enabled
|
||||
*/
|
||||
boolean isNonFullBlockLightFix();
|
||||
|
||||
boolean is1_14HealthNaNFix();
|
||||
}
|
||||
|
@ -39,6 +39,12 @@ public class MetadataRewriter {
|
||||
if (metadata.getId() > 5) {
|
||||
metadata.setId(metadata.getId() + 1);
|
||||
}
|
||||
if (metadata.getId() == 8 && type.isOrHasParent(Entity1_14Types.EntityType.LIVINGENTITY)) {
|
||||
final float v = ((Number) metadata.getValue()).floatValue();
|
||||
if (Float.isNaN(v) && Via.getConfig().is1_14HealthNaNFix()) {
|
||||
metadata.setValue(1F);
|
||||
}
|
||||
}
|
||||
|
||||
//Metadata 12 added to living_entity
|
||||
if (metadata.getId() > 11 && type.isOrHasParent(Entity1_14Types.EntityType.LIVINGENTITY)) {
|
||||
|
@ -128,6 +128,8 @@ change-1_9-hitbox: false
|
||||
change-1_14-hitbox: false
|
||||
# Fixes 1.14+ clients on sub 1.14 servers having a light value of 0 for non full blocks.
|
||||
fix-non-full-blocklight: true
|
||||
# Fixes walk animation not shown when health is set to Float.NaN
|
||||
fix-1_14-health-nan: true
|
||||
#
|
||||
# Enable serverside block-connections for 1.13+ clients
|
||||
serverside-blockconnections: false
|
||||
|
@ -280,4 +280,9 @@ public class SpongeViaConfig extends Config implements ViaVersionConfig {
|
||||
public boolean isNonFullBlockLightFix() {
|
||||
return getBoolean("fix-non-full-blocklight", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_14HealthNaNFix() {
|
||||
return getBoolean("fix-1_14-health-nan", true);
|
||||
}
|
||||
}
|
||||
|
@ -333,4 +333,9 @@ public class VelocityViaConfig extends Config implements ViaVersionConfig {
|
||||
public boolean isNonFullBlockLightFix() {
|
||||
return getBoolean("fix-non-full-blocklight", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_14HealthNaNFix() {
|
||||
return getBoolean("fix-1_14-health-nan", true);
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren