31 lines
812 B
Go
31 lines
812 B
Go
|
|
//go:build gl
|
|||
|
|
|
|||
|
|
// 实体可视映射:实体类型 → 广告牌贴图键与高度(渲染.md §5.3)。
|
|||
|
|
package main
|
|||
|
|
|
|||
|
|
import "mc/internal/entity"
|
|||
|
|
|
|||
|
|
// entityVisual 返回实体的贴图键与身高(米)。
|
|||
|
|
// 动物按 ID 轮换四种外观(cow/pig/sheep/chicken)。
|
|||
|
|
func entityVisual(e *entity.Entity) (key string, height float32) {
|
|||
|
|
switch e.Kind {
|
|||
|
|
case entity.KindZombie:
|
|||
|
|
return "entity/zombie/zombie", 1.95
|
|||
|
|
case entity.KindVillager:
|
|||
|
|
return "entity/villager/villager", 1.95
|
|||
|
|
case entity.KindAnimal:
|
|||
|
|
switch e.ID % 4 {
|
|||
|
|
case 0:
|
|||
|
|
return "entity/cow/cow_temperate", 1.4
|
|||
|
|
case 1:
|
|||
|
|
return "entity/pig/pig_temperate", 0.9
|
|||
|
|
case 2:
|
|||
|
|
return "entity/sheep/sheep", 1.3
|
|||
|
|
default:
|
|||
|
|
return "entity/chicken/chicken_temperate", 0.7
|
|||
|
|
}
|
|||
|
|
default:
|
|||
|
|
return "", 0 // 掉落物等后置接入
|
|||
|
|
}
|
|||
|
|
}
|