use of net.minecraft.server.v1_13_R2.AttributeMapBase in project Arcade2 by ShootGame.
the class GamePlayer method getAttribute.
@Override
public Attribute getAttribute(AttributeKey key) {
EntityPlayer mojang = this.getMojang();
if (this.attributeMap == null) {
try {
Field mojangMap = EntityLiving.class.getDeclaredField("attributeMap");
mojangMap.setAccessible(true);
this.attributeMap = new TrackingAttributeMap((AttributeMapBase) mojangMap.get(mojang));
} catch (ReflectiveOperationException ex) {
this.game.getPlugin().getLogger().log(Level.SEVERE, "Could not inject attribute map", ex);
return null;
}
}
return this.attributeMap.getAttribute(key);
}
Aggregations