Skip to content

Commit

Permalink
Fixed custom AI goals on 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Nov 7, 2023
1 parent 3e0a8b1 commit e306190
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.willfp.eco.internal.spigot.proxy.common.ai

import com.willfp.eco.core.entities.ai.CustomGoal
import com.willfp.eco.core.entities.ai.GoalFlag
import com.willfp.eco.internal.spigot.proxy.common.toBukkitEntity
import net.minecraft.world.entity.PathfinderMob
import net.minecraft.world.entity.ai.goal.Goal
import java.util.EnumSet
Expand Down Expand Up @@ -51,7 +52,7 @@ private class NMSCustomGoal<T : org.bukkit.entity.Mob>(
) : Goal() {
init {
@Suppress("UNCHECKED_CAST")
customEntityGoal.initialize(entity.bukkitMob as T)
customEntityGoal.initialize(entity.toBukkitEntity() as T)
this.setFlags(EnumSet.copyOf(customEntityGoal.flags.toNMSFlags()))
}

Expand Down

0 comments on commit e306190

Please sign in to comment.