Prepare to parse the method searge statements

This commit is contained in:
riking
2014-06-14 19:30:47 -07:00
parent 4ddded6b06
commit 0c84316121
5 changed files with 109 additions and 9 deletions

View File

@@ -530,6 +530,7 @@ public class PacketsManager {
Object obj = null;
if (entity instanceof LivingEntity) {
try {
// Use reflection so that this works for either int or double methods
obj = LivingEntity.class.getMethod("getHealth").invoke(entity);
if (obj instanceof Double ? (Double) obj == 0 : (Integer) obj == 0) {
soundType = SoundType.DEATH;