diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-23 23:45:24 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-23 23:45:24 +0200 |
commit | f43bac23acf79325f9f4de060b69c5c0b1d870eb (patch) | |
tree | f05971f36500a18091762a4b29f0b0415c25558f /src/main/java/at/hannibal2/skyhanni/test | |
parent | a21c3298d2ae7790b3d3770ee4a135c1817f3018 (diff) | |
download | skyhanni-f43bac23acf79325f9f4de060b69c5c0b1d870eb.tar.gz skyhanni-f43bac23acf79325f9f4de060b69c5c0b1d870eb.tar.bz2 skyhanni-f43bac23acf79325f9f4de060b69c5c0b1d870eb.zip |
Using EntityUtils.getEntities everywhere
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt index 5161005a4..661436c5e 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt @@ -1,16 +1,13 @@ package at.hannibal2.skyhanni.test.command +import at.hannibal2.skyhanni.utils.* +import at.hannibal2.skyhanni.utils.EntityUtils.getBlockInHand import at.hannibal2.skyhanni.utils.EntityUtils.getSkinTexture import at.hannibal2.skyhanni.utils.ItemUtils.cleanName import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture import at.hannibal2.skyhanni.utils.ItemUtils.isEnchanted import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.LocationUtils -import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth -import at.hannibal2.skyhanni.utils.OSUtils -import at.hannibal2.skyhanni.utils.toLorenzVec -import net.minecraft.client.Minecraft import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand @@ -28,14 +25,12 @@ object CopyNearbyEntitiesCommand { searchRadius = args[0].toInt() } - val minecraft = Minecraft.getMinecraft() val start = LocationUtils.playerLocation() - val world = minecraft.theWorld val resultList = mutableListOf<String>() var counter = 0 - for (entity in world.loadedEntityList) { + for (entity in EntityUtils.getEntities()) { val position = entity.position val vec = position.toLorenzVec() val distance = start.distance(vec) @@ -96,7 +91,7 @@ object CopyNearbyEntitiesCommand { is EntityEnderman -> { resultList.add("EntityEnderman:") - val heldBlockState = entity.heldBlockState + val heldBlockState = entity.getBlockInHand() resultList.add("- heldBlockState: $heldBlockState") if (heldBlockState != null) { val block = heldBlockState.block |