Search in sources :

Example 1 with CraftAttributeMap

use of org.bukkit.craftbukkit.v1_16_R3.attribute.CraftAttributeMap in project MyPet by xXKeyleXx.

the class EntityMyPet method replaceCraftAttributes.

protected void replaceCraftAttributes() {
    Field craftAttributesField = ReflectionUtil.getField(EntityLiving.class, "craftAttributes");
    CraftAttributeMap craftAttributes = new CraftAttributeMap(this.getAttributeMap());
    ReflectionUtil.setFinalFieldValue(craftAttributesField, this, craftAttributes);
}
Also used : Field(java.lang.reflect.Field) CraftAttributeMap(org.bukkit.craftbukkit.v1_16_R1.attribute.CraftAttributeMap)

Example 2 with CraftAttributeMap

use of org.bukkit.craftbukkit.v1_16_R3.attribute.CraftAttributeMap in project PaperDev by Kamillaova.

the class EntityLiving method getAttributeMap.

public AttributeMapBase getAttributeMap() {
    if (this.attributeMap == null) {
        this.attributeMap = new AttributeMapServer();
        // CraftBukkit
        this.craftAttributes = new CraftAttributeMap(attributeMap);
    }
    return this.attributeMap;
}
Also used : CraftAttributeMap(org.bukkit.craftbukkit.v1_12_R1.attribute.CraftAttributeMap)

Example 3 with CraftAttributeMap

use of org.bukkit.craftbukkit.v1_16_R3.attribute.CraftAttributeMap in project MyPet by xXKeyleXx.

the class EntityMyPet method replaceCraftAttributes.

protected void replaceCraftAttributes() {
    Field craftAttributesField = ReflectionUtil.getField(EntityLiving.class, "craftAttributes");
    CraftAttributeMap craftAttributes = new CraftAttributeMap(this.getAttributeMap());
    ReflectionUtil.setFinalFieldValue(craftAttributesField, this, craftAttributes);
}
Also used : Field(java.lang.reflect.Field) CraftAttributeMap(org.bukkit.craftbukkit.v1_16_R3.attribute.CraftAttributeMap)

Aggregations

Field (java.lang.reflect.Field)2 CraftAttributeMap (org.bukkit.craftbukkit.v1_12_R1.attribute.CraftAttributeMap)1 CraftAttributeMap (org.bukkit.craftbukkit.v1_16_R1.attribute.CraftAttributeMap)1 CraftAttributeMap (org.bukkit.craftbukkit.v1_16_R3.attribute.CraftAttributeMap)1