From b7146c08b4d0445d6e3e50dfd939d8f19401cd40 Mon Sep 17 00:00:00 2001 From: TomJuri Date: Mon, 4 Sep 2023 20:00:40 +0200 Subject: [PATCH] removed old boss spawner --- .../dev/macrohq/swiftslayer/SwiftSlayer.kt | 6 -- .../swiftslayer/command/BossSpawnercommand.kt | 20 ------- .../macrohq/swiftslayer/macro/BossSpawner.kt | 59 ------------------- .../dev/macrohq/swiftslayer/util/Ref.kt | 2 - 4 files changed, 87 deletions(-) delete mode 100644 src/main/kotlin/dev/macrohq/swiftslayer/command/BossSpawnercommand.kt delete mode 100644 src/main/kotlin/dev/macrohq/swiftslayer/macro/BossSpawner.kt diff --git a/src/main/kotlin/dev/macrohq/swiftslayer/SwiftSlayer.kt b/src/main/kotlin/dev/macrohq/swiftslayer/SwiftSlayer.kt index f41d855..da24967 100644 --- a/src/main/kotlin/dev/macrohq/swiftslayer/SwiftSlayer.kt +++ b/src/main/kotlin/dev/macrohq/swiftslayer/SwiftSlayer.kt @@ -1,10 +1,8 @@ package dev.macrohq.swiftslayer import cc.polyfrost.oneconfig.utils.commands.CommandManager -import dev.macrohq.swiftslayer.command.BossSpawnercommand import dev.macrohq.swiftslayer.command.PathfindTest import dev.macrohq.swiftslayer.config.SwiftSlayerConfig -import dev.macrohq.swiftslayer.macro.BossSpawner import dev.macrohq.swiftslayer.macro.EndermanMacro import dev.macrohq.swiftslayer.macro.MobKiller import dev.macrohq.swiftslayer.pathfinding.PathExecutor @@ -26,7 +24,6 @@ class SwiftSlayer { lateinit var pathExecutor: PathExecutor private set lateinit var config: SwiftSlayerConfig private set - lateinit var bossSpawner: BossSpawner private set lateinit var mobKiller: MobKiller private set lateinit var endermanMacro: EndermanMacro private set var removeLater: BlockPos? = null @@ -35,15 +32,12 @@ class SwiftSlayer { fun init(event: FMLInitializationEvent) { config = SwiftSlayerConfig() pathExecutor = PathExecutor() - bossSpawner = BossSpawner() mobKiller = MobKiller() endermanMacro = EndermanMacro() MinecraftForge.EVENT_BUS.register(this) - MinecraftForge.EVENT_BUS.register(bossSpawner) MinecraftForge.EVENT_BUS.register(pathExecutor) MinecraftForge.EVENT_BUS.register(mobKiller) CommandManager.register(PathfindTest()) - CommandManager.register(BossSpawnercommand()) } @SubscribeEvent diff --git a/src/main/kotlin/dev/macrohq/swiftslayer/command/BossSpawnercommand.kt b/src/main/kotlin/dev/macrohq/swiftslayer/command/BossSpawnercommand.kt deleted file mode 100644 index 3db8718..0000000 --- a/src/main/kotlin/dev/macrohq/swiftslayer/command/BossSpawnercommand.kt +++ /dev/null @@ -1,20 +0,0 @@ -package dev.macrohq.swiftslayer.command - -import cc.polyfrost.oneconfig.utils.commands.annotations.Command -import cc.polyfrost.oneconfig.utils.commands.annotations.Main -import cc.polyfrost.oneconfig.utils.commands.annotations.SubCommand -import dev.macrohq.swiftslayer.util.bossSpawner - - -@Command(value = "bossspawner", aliases = ["bs", "bsp"]) -class BossSpawnercommand { - @Main - fun main() { - - } - - @SubCommand - fun stop(){ - bossSpawner.disable() - } -} \ No newline at end of file diff --git a/src/main/kotlin/dev/macrohq/swiftslayer/macro/BossSpawner.kt b/src/main/kotlin/dev/macrohq/swiftslayer/macro/BossSpawner.kt deleted file mode 100644 index 457e21c..0000000 --- a/src/main/kotlin/dev/macrohq/swiftslayer/macro/BossSpawner.kt +++ /dev/null @@ -1,59 +0,0 @@ -package dev.macrohq.swiftslayer.macro - -import dev.macrohq.swiftslayer.util.* -import net.minecraft.entity.EntityLiving -import net.minecraft.entity.monster.EntityZombie -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent - - -class BossSpawner { - - private var enabled = false - private var state = State.GOTO_MOB - private var target: EntityLiving? = null - private var condition = { true } - - @SubscribeEvent - fun onTick(event: ClientTickEvent) { - if(!enabled || !condition()) return - if(target == null || target!!.isDead) target = EntityUtil.getMobs(EntityZombie::class.java, 100).firstOrNull() - if(target == null) { - Logger.error("Couldn't find any targets :(") - disable() - return - } - Logger.info(target!!.getDistanceSqToEntity(player)) - when(state) { - State.GOTO_MOB -> { - RenderUtil.entites.add(target!!) - PathingUtil.goto(target!!.getStandingOnCeil()) - condition = { PathingUtil.isDone } - } - - State.ROTATE_TO_MOB -> { - - } - - State.KILL_MOB -> { - - } - } - state = State.entries[(state.ordinal + 1) % State.entries.size] - } - - fun enable(entity: Class) { - enabled = true - } - - fun disable() { - enabled = false - } - - private enum class State { - GOTO_MOB, - ROTATE_TO_MOB, - KILL_MOB, - } - -} diff --git a/src/main/kotlin/dev/macrohq/swiftslayer/util/Ref.kt b/src/main/kotlin/dev/macrohq/swiftslayer/util/Ref.kt index bfdd124..ad6ff13 100644 --- a/src/main/kotlin/dev/macrohq/swiftslayer/util/Ref.kt +++ b/src/main/kotlin/dev/macrohq/swiftslayer/util/Ref.kt @@ -20,7 +20,5 @@ val config get() = swiftSlayer.config val pathExecutor get() = swiftSlayer.pathExecutor -val bossSpawner - get() = swiftSlayer.bossSpawner val mobKiller get() = swiftSlayer.mobKiller \ No newline at end of file