mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2025-01-24 08:41:21 +01:00
Set armor stands as markers on Minecraft 1.8
This commit is contained in:
parent
49d6930389
commit
a67866ff42
@ -31,6 +31,12 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
|
||||
setArms(false);
|
||||
setGravity(true);
|
||||
setBasePlate(true);
|
||||
try {
|
||||
ReflectionUtils.callPrivateMethod(EntityArmorStand.class, this, "n", new Class[]{ boolean.class }, new Object[]{ true }); // n() = setMarker()
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// It will still work.
|
||||
}
|
||||
this.parentPiece = parentPiece;
|
||||
try {
|
||||
ReflectionUtils.setPrivateField(EntityArmorStand.class, this, "bg", Integer.MAX_VALUE);
|
||||
|
@ -31,6 +31,12 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
|
||||
setArms(false);
|
||||
setGravity(true);
|
||||
setBasePlate(true);
|
||||
try {
|
||||
ReflectionUtils.callPrivateMethod(EntityArmorStand.class, this, "n", new Class[]{ boolean.class }, new Object[]{ true }); // n() = setMarker()
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// It will still work.
|
||||
}
|
||||
this.parentPiece = parentPiece;
|
||||
try {
|
||||
ReflectionUtils.setPrivateField(EntityArmorStand.class, this, "bi", Integer.MAX_VALUE);
|
||||
|
@ -31,6 +31,12 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
|
||||
setArms(false);
|
||||
setGravity(true);
|
||||
setBasePlate(true);
|
||||
try {
|
||||
ReflectionUtils.callPrivateMethod(EntityArmorStand.class, this, "n", new Class[]{ boolean.class }, new Object[]{ true }); // n() = setMarker()
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// It will still work.
|
||||
}
|
||||
this.parentPiece = parentPiece;
|
||||
try {
|
||||
ReflectionUtils.setPrivateField(EntityArmorStand.class, this, "bi", Integer.MAX_VALUE);
|
||||
|
@ -12,7 +12,7 @@ public class Offsets {
|
||||
WITHER_SKULL_WITH_SLIME = -0.22,
|
||||
|
||||
// For 1.8+, a single armor stand. As with wither skulls and horses, the bottom part of the nametag should be on the surface of the block.
|
||||
ARMOR_STAND_ALONE = -1.25,
|
||||
ARMOR_STAND_ALONE = -0.26,
|
||||
|
||||
// For 1.8+, an armor stand holding an item.
|
||||
ARMOR_STAND_WITH_ITEM = -1.48,
|
||||
|
@ -29,6 +29,12 @@ public class ReflectionUtils {
|
||||
return field.get(handle);
|
||||
}
|
||||
|
||||
public static Object callPrivateMethod(Class<?> clazz, Object handle, String methodName, Class<?>[] parameterTypes, Object[] args) throws Exception {
|
||||
Method method = clazz.getDeclaredMethod(methodName, parameterTypes);
|
||||
method.setAccessible(true);
|
||||
return method.invoke(handle, args);
|
||||
}
|
||||
|
||||
private static Method getStackTraceElementMethod;
|
||||
private static Method getStackTraceDepthMethod;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user