mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 09:39:05 +00:00
Fix NPC hitbox scaling for large sizes
This commit is contained in:
1 parent
111f16647d
commit
3d9b54ef5b
6 files changed
+70
-41
No files matched your search
@@ -25,14 +25,21 @@ public class EntityNPCGolem extends EntityNPCInterface {
|
||||
|
||||
public void updateHitbox() {
|
||||
currentAnimation = EnumAnimation.values()[dataWatcher.getWatchableObjectInt(14)];
|
||||
float newWidth;
|
||||
float newHeight;
|
||||
if (currentAnimation == EnumAnimation.LYING) {
|
||||
width = height = 0.5f;
|
||||
newWidth = 0.5f;
|
||||
newHeight = 0.5f;
|
||||
} else if (currentAnimation == EnumAnimation.SITTING) {
|
||||
width = 1.4f;
|
||||
height = 2f;
|
||||
newWidth = 1.4f;
|
||||
newHeight = 2f;
|
||||
} else {
|
||||
width = 1.4f;
|
||||
height = 2.5f;
|
||||
newWidth = 1.4f;
|
||||
newHeight = 2.5f;
|
||||
}
|
||||
setSize(newWidth, newHeight);
|
||||
if (width / 2 > World.MAX_ENTITY_RADIUS) {
|
||||
World.MAX_ENTITY_RADIUS = width / 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user