Skip to content

Commit

Permalink
feat: attempt to fix boss bar being out of frustum
Browse files Browse the repository at this point in the history
change bossBarFix to be default false due to new behavior
  • Loading branch information
My-Name-Is-Jeff committed Feb 1, 2024
1 parent ec60744 commit f1e0be8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/gg/skytils/skytilsmod/core/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1367,10 +1367,10 @@ object Config : Vigilant(

@Property(
type = PropertyType.SWITCH, name = "Boss Bar Fix",
description = "Hides the Witherborn boss bars.",
description = "Attempts to stop boss bars from disappearing.",
category = "Miscellaneous", subcategory = "Fixes"
)
var bossBarFix = true
var bossBarFix = false

@Property(
type = PropertyType.SWITCH, name = "Fix Falling Sand Rendering",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import net.minecraft.client.gui.inventory.GuiChest
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.settings.KeyBinding
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.boss.IBossDisplayData
import net.minecraft.entity.effect.EntityLightningBolt
import net.minecraft.entity.item.EntityArmorStand
import net.minecraft.entity.item.EntityFallingBlock
Expand All @@ -79,6 +80,7 @@ import net.minecraftforge.event.entity.EntityJoinWorldEvent
import net.minecraftforge.event.entity.living.EnderTeleportEvent
import net.minecraftforge.event.entity.player.ItemTooltipEvent
import net.minecraftforge.fml.common.Loader
import net.minecraftforge.fml.common.eventhandler.Event
import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
Expand Down Expand Up @@ -233,7 +235,9 @@ object MiscFeatures {
@SubscribeEvent
fun onCheckRender(event: CheckRenderEntityEvent<*>) {
if (!Utils.inSkyblock) return
if (Skytils.config.hideDyingMobs && event.entity is EntityLivingBase && (event.entity.health <= 0 || event.entity.isDead)) {
if (Skytils.config.bossBarFix && event.entity is IBossDisplayData && event.entity.isInvisible && event.entity.hasCustomName()) {
event.result = Event.Result.ALLOW
} else if (Skytils.config.hideDyingMobs && event.entity is EntityLivingBase && (event.entity.health <= 0 || event.entity.isDead)) {
event.isCanceled = true
} else if (event.entity is EntityFallingBlock) {
val entity = event.entity
Expand Down

0 comments on commit f1e0be8

Please sign in to comment.