11//@ts -check
22import * as THREE from 'three'
33import { OBJLoader } from 'three-stdlib'
4+ import huskPng from 'mc-assets/dist/other-textures/latest/entity/zombie/husk.png'
45import entities from './entities.json'
56import { externalModels } from './objModels'
67import externalTexturesJson from './externalTextures.json'
@@ -290,6 +291,10 @@ const getEntity = (name) => {
290291// zombie_villager: 'zombie_villager/zombie_villager'
291292// }
292293
294+ const scaleEntity = {
295+ zombie : 1.9 ,
296+ husk : 1.9
297+ }
293298// eslint-disable-next-line @typescript-eslint/no-extraneous-class
294299export class EntityMesh {
295300 constructor ( version , type , scene , /** @type {{textures?, rotation?: Record<string, {x,y,z}>} } */ overrides = { } ) {
@@ -303,6 +308,9 @@ export class EntityMesh {
303308 if ( originalType === 'zombie_horse' ) {
304309 texturePath = `textures/${ version } /entity/horse/horse_zombie.png`
305310 }
311+ if ( originalType === 'husk' ) {
312+ texturePath = huskPng
313+ }
306314 if ( originalType === 'skeleton_horse' ) {
307315 texturePath = `textures/${ version } /entity/horse/horse_skeleton.png`
308316 }
@@ -325,6 +333,8 @@ export class EntityMesh {
325333 alphaTest : 0.1
326334 } )
327335 const obj = objLoader . parse ( externalModels [ type ] )
336+ const scale = scaleEntity [ originalType ]
337+ if ( scale ) obj . scale . set ( scale , scale , scale )
328338 if ( type === 'boat' ) obj . position . y = - 1 // todo, should not be hardcoded
329339 obj . traverse ( ( child ) => {
330340 if ( child instanceof THREE . Mesh ) {
0 commit comments