From 8978b9bf4d76b10709f729ef023b2b28aaff02f9 Mon Sep 17 00:00:00 2001 From: The_Fireplace Date: Tue, 29 Nov 2022 09:47:30 -0600 Subject: [PATCH] Fixed skeleton hitboxes Closes #241 --- changelog.txt | 2 +- .../overlord/entity/OwnedSkeletonEntity.java | 11 +++++++++++ .../overlord/loader/FabricEntityLoaderHelper.java | 2 +- .../overlord/loader/ForgeEntityLoaderHelper.java | 2 +- gradle.properties | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index ac4a92f3..bf846975 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1 +1 @@ -Port to 1.19.2 \ No newline at end of file +Fixed skeleton hitboxes \ No newline at end of file diff --git a/common/src/main/java/dev/the_fireplace/overlord/entity/OwnedSkeletonEntity.java b/common/src/main/java/dev/the_fireplace/overlord/entity/OwnedSkeletonEntity.java index e5dbf8d8..dd511b71 100644 --- a/common/src/main/java/dev/the_fireplace/overlord/entity/OwnedSkeletonEntity.java +++ b/common/src/main/java/dev/the_fireplace/overlord/entity/OwnedSkeletonEntity.java @@ -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); } diff --git a/fabric/src/main/java/dev/the_fireplace/overlord/loader/FabricEntityLoaderHelper.java b/fabric/src/main/java/dev/the_fireplace/overlord/loader/FabricEntityLoaderHelper.java index 817f0e48..b7b27cb7 100644 --- a/fabric/src/main/java/dev/the_fireplace/overlord/loader/FabricEntityLoaderHelper.java +++ b/fabric/src/main/java/dev/the_fireplace/overlord/loader/FabricEntityLoaderHelper.java @@ -24,7 +24,7 @@ public EntityType 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(); } diff --git a/forge/src/main/java/dev/the_fireplace/overlord/loader/ForgeEntityLoaderHelper.java b/forge/src/main/java/dev/the_fireplace/overlord/loader/ForgeEntityLoaderHelper.java index 7e8e3942..dffea997 100644 --- a/forge/src/main/java/dev/the_fireplace/overlord/loader/ForgeEntityLoaderHelper.java +++ b/forge/src/main/java/dev/the_fireplace/overlord/loader/ForgeEntityLoaderHelper.java @@ -30,7 +30,7 @@ public final class ForgeEntityLoaderHelper implements EntityLoaderHelper @Override public EntityType buildOwnedSkeletonType() { EntityType ownedSkeleton = EntityType.Builder.of(OwnedSkeletonEntity::new, MobCategory.MISC) - .sized(1, 2) + .sized(0.6F, 1.99F) .setTrackingRange(24) .setUpdateInterval(3) .setShouldReceiveVelocityUpdates(true) diff --git a/gradle.properties b/gradle.properties index 7b44c490..1c23da2c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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