aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-09-15 12:10:47 +0200
committerGitHub <noreply@github.com>2024-09-15 12:10:47 +0200
commitbea837f2ba12f049614f92096b47a9e601c288b9 (patch)
tree71f015b8f9fd4dddf708cc7f807d52028a79683d
parent67e09820b733caee179ea3c8808aa358cdcff94d (diff)
downloadskyhanni-bea837f2ba12f049614f92096b47a9e601c288b9.tar.gz
skyhanni-bea837f2ba12f049614f92096b47a9e601c288b9.tar.bz2
skyhanni-bea837f2ba12f049614f92096b47a9e601c288b9.zip
Fix: Zombie Shootout Baby Zombie Bounding Box (#2512)
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt
index d57903a57..79e93f2ad 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt
@@ -23,6 +23,7 @@ import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import net.minecraft.entity.monster.EntityZombie
import net.minecraft.init.Blocks
import net.minecraft.item.ItemStack
+import net.minecraft.util.AxisAlignedBB
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.awt.Color
import kotlin.time.Duration.Companion.seconds
@@ -95,9 +96,21 @@ object CarnivalZombieShootout {
for ((zombie, type) in drawZombies) {
val entity = EntityUtils.getEntityByID(zombie.entityId) ?: continue
+ val isSmall = (entity as? EntityZombie)?.isChild ?: false
+
+ val boundingBox = entity.entityBoundingBox.let {
+ if (isSmall) {
+ val widthScale = 0.5
+ val heightScale = 0.85
+ val newMin = it.minX + (it.maxX - it.minX) * (1 - widthScale) / 2
+ val newMax = it.maxX - (it.maxX - it.minX) * (1 - widthScale) / 2
+ val newHeight = it.minY + (it.maxY - it.minY) * heightScale / 1.75
+ AxisAlignedBB(newMin, it.minY, it.minZ, newMax, newHeight, it.maxZ)
+ } else it
+ }.expand(0.1, 0.05, 0.0).offset(0.0, 0.05, 0.0)
event.drawHitbox(
- entity.entityBoundingBox.expand(0.1, 0.05, 0.0).offset(0.0, 0.05, 0.0),
+ boundingBox,
lineWidth = 3,
type.color,
depth = false,