UltrusBot / MobOrigins

MIT License
8 stars 18 forks source link

Crash when camera entity is not a LivingEntity #47

Closed parzivail closed 1 year ago

parzivail commented 1 year ago

The client camera entity is modified by a few mods to be a plain Entity or subclass that doesn't inherit LivingEntity, so this explicit cast throws an exception: https://github.com/UltrusBot/MobOrigins/blob/5a9d5197f51af0ad8289ee693031fc42f70c6562/src/main/java/me/ultrusmods/moborigins/mixin/client/BackgroundRendererMixin.java#L67

UltrusBot commented 1 year ago

Ah, I'll wrap that in a instanceof check

kb-1000 commented 1 year ago

A more specific example of this case would be the camera entity used by PSWG's ship chase cam. The question there would be, should that mixin still apply if the player is flying a ship? If so, you'd want a way to either get its "owner" in some way or get the player entity instead.