下面列出了org.bukkit.entity.Entity#getClass ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public EntityInfo(Entity entity, @Nullable ParticipantState owner) {
super(owner);
this.entityType = entity.getType();
this.entityClass = entity.getClass();
this.customName = entity.getCustomName();
this.nameKey = NMSHacks.getTranslationKey(entity);
}
public static @Nullable MatchEntityState get(Entity entity) {
Match match = Matches.get(entity.getWorld());
String customName = entity instanceof Player ? null : entity.getCustomName();
return match == null ? null : new MatchEntityState(match, entity.getClass(), entity.getUniqueId(), entity.getEntityLocation(), customName);
}