Fix SendModel not changing when sending humanoid model

This commit is contained in:
Goodlyay 2025-06-23 05:49:00 -07:00
parent 8ba17b19cc
commit 03db436cd1

View File

@ -293,7 +293,7 @@ namespace MCGalaxy {
void Spawn(VisibleEntity vis, Position pos, Orientation rot, string skin, string name, string model) {
p.Session.SendSpawnEntity(vis.id, name, skin, pos, rot);
_SendModel(vis, model);
_SendModel(vis, model, true);
_SendRot(vis, rot);
_SendScales(vis);
}
@ -305,13 +305,13 @@ namespace MCGalaxy {
lock (visLocker) {
VisibleEntity vis;
if (!visible.TryGetValue(e, out vis)) return;
_SendModel(vis, model);
_SendModel(vis, model, false);
}
}
void _SendModel(VisibleEntity vis, string model) {
void _SendModel(VisibleEntity vis, string model, bool spawning) {
if (p.hasChangeModel) {
OnSendingModelEvent.Call(vis.e, ref model, p);
if (!model.CaselessEq("humanoid")) p.Session.SendChangeModel(vis.id, model);
if (!(spawning && model.CaselessEq("humanoid"))) p.Session.SendChangeModel(vis.id, model);
}
}
void _SendRot(VisibleEntity vis, Orientation rot) {