mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-27 14:13:11 +02:00
Comments: Attribute.GENERIC_MAX_HEALTH / IGenericInstanceHandle.
This commit is contained in:
parent
0491fa7805
commit
f7a11bbc95
@ -42,6 +42,8 @@ import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
|
||||
*/
|
||||
public class BridgeHealth {
|
||||
|
||||
// TODO: Move to (smaller?) IGenericInstanceHandle instances.
|
||||
|
||||
/** For debugging purposes. TODO: Reset on shutdown !? */
|
||||
private static Set<String> failures = new HashSet<String>();
|
||||
|
||||
@ -162,7 +164,17 @@ public class BridgeHealth {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the damage from an EntityDamageEvent.
|
||||
* Set the damage from an EntityDamageEvent. @SuppressWarnings("deprecation")
|
||||
public static double getMaxHealth(final LivingEntity entity){
|
||||
try{
|
||||
// TODO: Attribute.GENERIC_MAX_HEALTH for latest.
|
||||
return entity.getMaxHealth();
|
||||
}
|
||||
catch(IncompatibleClassChangeError e){
|
||||
return getDoubleOrInt(entity, "getMaxHealth", e);
|
||||
}
|
||||
}
|
||||
|
||||
*
|
||||
* @param event
|
||||
* @param damage
|
||||
@ -207,8 +219,10 @@ public class BridgeHealth {
|
||||
* in case of an IncompatibleClassChangeError without success on
|
||||
* recovery attempts.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static double getMaxHealth(final LivingEntity entity){
|
||||
try{
|
||||
// TODO: Attribute.GENERIC_MAX_HEALTH for latest.
|
||||
return entity.getMaxHealth();
|
||||
}
|
||||
catch(IncompatibleClassChangeError e){
|
||||
|
Loading…
Reference in New Issue
Block a user