Skip to content

Commit

Permalink
Fixed pest damage indicator not working for some pests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hannibal002 committed Nov 26, 2023
1 parent ff879da commit 46e531a
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import net.minecraft.entity.monster.EntitySkeleton
import net.minecraft.entity.monster.EntitySlime
import net.minecraft.entity.monster.EntitySpider
import net.minecraft.entity.monster.EntityZombie
import net.minecraft.entity.passive.EntityBat
import net.minecraft.entity.passive.EntityHorse
import net.minecraft.entity.passive.EntityWolf
import java.util.UUID
Expand Down Expand Up @@ -80,6 +81,7 @@ class MobFinder {
internal fun tryAdd(entity: EntityLivingBase) = when {
LorenzUtils.inDungeons -> tryAddDungeon(entity)
RiftAPI.inRift() -> tryAddRift(entity)
GardenAPI.inGarden() -> tryAddGarden(entity)
else -> {
when (entity) {
/*
Expand All @@ -89,7 +91,6 @@ class MobFinder {
* Please take this into consideration if you are to modify this.
*/
is EntityOtherPlayerMP -> tryAddEntityOtherPlayerMP(entity)
is EntitySilverfish -> tryAddEntitySilverfish(entity)
is EntityIronGolem -> tryAddEntityIronGolem(entity)
is EntityPigZombie -> tryAddEntityPigZombie(entity)
is EntityMagmaCube -> tryAddEntityMagmaCube(entity)
Expand All @@ -109,7 +110,15 @@ class MobFinder {
}
}

private fun tryAddEntitySilverfish(entity: EntitySilverfish): EntityResult? {
private fun tryAddGarden(entity: EntityLivingBase): EntityResult? {
if (entity is EntitySilverfish || entity is EntityBat) {
return tryAddGardenPest(entity)
}

return null
}

private fun tryAddGardenPest(entity: EntityLivingBase): EntityResult? {
if (!GardenAPI.inGarden()) return null

if (entity.hasNameTagWith(3, "Beetle")) return EntityResult(bossType = BossType.GARDEN_PEST_BEETLE)
Expand Down

0 comments on commit 46e531a

Please sign in to comment.