mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 20:22:37 +00:00
fix potential NPE
This commit is contained in:
1 parent
17d8c99e8b
commit
3d789cdf3a
2 files changed
+2
-2
No files matched your search
@@ -62,7 +62,7 @@ public class EntityCustomNpc extends EntityNPCFlying {
|
||||
@Override
|
||||
public void updateHitbox() {
|
||||
Entity entity = modelData.getEntity(this);
|
||||
if (modelData == null || entity == null) {
|
||||
if (entity == null) {
|
||||
baseHeight = 1.9f - modelData.getBodyY() + (modelData.modelScale.head.scaleY - 1) / 2;
|
||||
super.updateHitbox();
|
||||
} else {
|
||||
|
||||
@@ -328,7 +328,7 @@ public class RoleCompanion extends RoleInterface {
|
||||
((CompanionTrader) jobInterface).interact(player);
|
||||
if (player != owner || !npc.isEntityAlive() || npc.isAttacking())
|
||||
return;
|
||||
if (player.isSneaking()) {
|
||||
if (player != null && player.isSneaking()) {
|
||||
openGui(player);
|
||||
} else {
|
||||
setSitting(!isSitting());
|
||||
|
||||
Reference in new issue
Block a user