Skip to content

Commit

Permalink
Fix: Baby Zombie Carnival Size (#2518)
Browse files Browse the repository at this point in the history
  • Loading branch information
j10a1n15 authored Sep 17, 2024
1 parent fe59a31 commit 5cba132
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ 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
Expand Down Expand Up @@ -98,19 +97,11 @@ object CarnivalZombieShootout {
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)
val boundingBox = if (isSmall) entity.entityBoundingBox.expand(0.0, -0.4, 0.0).offset(0.0, -0.4, 0.0)
else entity.entityBoundingBox

event.drawHitbox(
boundingBox,
boundingBox.expand(0.1, 0.05, 0.0).offset(0.0, 0.05, 0.0),
lineWidth = 3,
type.color,
depth = false,
Expand Down

0 comments on commit 5cba132

Please sign in to comment.