diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-08 17:14:21 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-08 17:14:21 +0200 |
commit | fa639add79f64941967aae33737d1e85945b79e0 (patch) | |
tree | 3f44d116733b15f3f7ac18bc797892d4edcb4d01 /src/main/java/at | |
parent | dddd91d1cead43a8164425f28dffd6ea799ab22f (diff) | |
download | skyhanni-fa639add79f64941967aae33737d1e85945b79e0.tar.gz skyhanni-fa639add79f64941967aae33737d1e85945b79e0.tar.bz2 skyhanni-fa639add79f64941967aae33737d1e85945b79e0.zip |
code cleanup
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index ec2a212c1..b12eb2f3e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.* +import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt import at.hannibal2.skyhanni.utils.ItemUtils.cleanName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -50,13 +51,13 @@ class MinionFeatures { fun onPlayerInteract(event: PlayerInteractEvent) { if (!LorenzUtils.inSkyBlock) return if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return - if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) return; + if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) return - val lookingAt = event.pos.offset(event.face) + val lookingAt = event.pos.offset(event.face).toLorenzVec() val equipped = InventoryUtils.getItemInHand() ?: return - if (equipped.displayName.contains(" Minion ") && event.world.getBlockState(lookingAt).block == Blocks.air) { - newMinion = lookingAt.toLorenzVec().add(0.5, 0.0, 0.5) + if (equipped.displayName.contains(" Minion ") && lookingAt.getBlockStateAt().block == Blocks.air) { + newMinion = lookingAt.add(0.5, 0.0, 0.5) newMinionName = getMinionName(equipped.cleanName()) } else { newMinion = null |