EntityWrapper.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:PlotSquared 作者:
public void storeLiving(LivingEntity lived) {
    this.lived = new LivingEntityStats();
    this.lived.potions = lived.getActivePotionEffects();
    this.lived.loot = lived.getCanPickupItems();
    this.lived.name = lived.getCustomName();
    this.lived.visible = lived.isCustomNameVisible();
    this.lived.health = (float) lived.getHealth();
    this.lived.air = (short) lived.getRemainingAir();
    this.lived.persistent = lived.getRemoveWhenFarAway();
    this.lived.leashed = lived.isLeashed();
    if (this.lived.leashed) {
        Location location = lived.getLeashHolder().getLocation();
        this.lived.leashX = (short) (this.x - location.getBlockX());
        this.lived.leashY = (short) (this.y - location.getBlockY());
        this.lived.leashZ = (short) (this.z - location.getBlockZ());
    }
    EntityEquipment equipment = lived.getEquipment();
    this.lived.equipped = equipment != null;
    if (this.lived.equipped) {
        storeEquipment(equipment);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号