Skip to content

Commit

Permalink
Fixed skeleton hitboxes
Browse files Browse the repository at this point in the history
Closes #241
  • Loading branch information
The-Fireplace committed Nov 29, 2022
1 parent 522f8c6 commit 8978b9b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Port to 1.19.2
Fixed skeleton hitboxes
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ public void onSyncedDataUpdated(EntityDataAccessor<?> data) {
}
}

@Override
public EntityDimensions getDimensions(Pose pose) {
EntityDimensions parentDimensions = super.getDimensions(pose);
float width = 0.6f;
if (hasMuscles()) {
width += 0.2F;
}

return new EntityDimensions(parentDimensions.width / 0.6F * width, parentDimensions.height, parentDimensions.fixed);
}

public ItemStack getAugmentBlockStack() {
return entityData.get(AUGMENT_BLOCK);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public EntityType<OwnedSkeletonEntity> buildOwnedSkeletonType() {
return FabricEntityTypeBuilder.createLiving()
.entityFactory(OwnedSkeletonEntity::new)
.defaultAttributes(OwnedSkeletonEntity::createOwnedSkeletonAttributes)
.dimensions(EntityDimensions.scalable(1, 2))
.dimensions(EntityDimensions.scalable(0.6F, 1.99F))
.trackable(24, 3, true)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class ForgeEntityLoaderHelper implements EntityLoaderHelper
@Override
public EntityType<OwnedSkeletonEntity> buildOwnedSkeletonType() {
EntityType<OwnedSkeletonEntity> ownedSkeleton = EntityType.Builder.of(OwnedSkeletonEntity::new, MobCategory.MISC)
.sized(1, 2)
.sized(0.6F, 1.99F)
.setTrackingRange(24)
.setUpdateInterval(3)
.setShouldReceiveVelocityUpdates(true)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ architectury_version=6.3.49
# Mod Properties
maven_group=dev.the-fireplace
archives_base_name=Overlord
mod_version=3.2.2
mod_version=3.2.3
release_type=release
license_id=MPL-2.0
license_name=Mozilla Public License 2.0
Expand Down

0 comments on commit 8978b9b

Please sign in to comment.