Cleanup the reflection for arrow collisions

This commit is contained in:
Sam 2018-03-01 13:52:10 +00:00 committed by Alexander Meech
parent af5eb3c997
commit be457c7f3c

View File

@ -1103,10 +1103,11 @@ public class UtilEnt
try try
{ {
EntityArrow entityArrow = ((CraftArrow) arrow).getHandle(); EntityArrow entityArrow = ((CraftArrow) arrow).getHandle();
Class<?> clazz = entityArrow.getClass();
Field fieldX = EntityArrow.class.getDeclaredField("d"); Field fieldX = clazz.getDeclaredField("d");
Field fieldY = EntityArrow.class.getDeclaredField("e"); Field fieldY = clazz.getDeclaredField("e");
Field fieldZ = EntityArrow.class.getDeclaredField("f"); Field fieldZ = clazz.getDeclaredField("f");
fieldX.setAccessible(true); fieldX.setAccessible(true);
fieldY.setAccessible(true); fieldY.setAccessible(true);