Skip to content

Commit 4e391c0

Browse files
committed
ref: fakeplayer nil id
1 parent 9dd364a commit 4e391c0

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

common/src/main/kotlin/com/lambda/config/groups/Targeting.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import net.minecraft.entity.LivingEntity
3232
import net.minecraft.entity.decoration.ArmorStandEntity
3333
import net.minecraft.entity.mob.MobEntity
3434
import net.minecraft.entity.passive.PassiveEntity
35-
import net.minecraft.util.Uuids
3635
import java.util.UUID
3736

3837
/**
@@ -175,7 +174,6 @@ abstract class Targeting(
175174
}
176175

177176
private val illegalTargets = setOf(
178-
UUID(0L, 0L),
179177
UUID(5706954458220675710L, -6736729783554821869L),
180178
UUID(-6114492090883684892, -8539188786807016414)
181179
)

common/src/main/kotlin/com/lambda/module/modules/combat/FakePlayer.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,25 @@ object FakePlayer : Module(
3737
private val playerName by setting("Name", "Steve")
3838

3939
private var fakePlayer: OtherClientPlayerEntity? = null
40+
private val nilUuid = UUID(0, 0)
4041

4142
init {
4243
onEnable {
43-
// Avoid multiple api requests
44-
if (fakePlayer?.gameProfile?.name == playerName)
45-
return@onEnable spawnPlayer(fakePlayer!!.gameProfile)
44+
fakePlayer?.let { fake ->
45+
// Avoid multiple api requests
46+
if (fake.gameProfile.name == playerName)
47+
return@onEnable spawnPlayer(fake.gameProfile)
48+
}
4649

4750
runSafeConcurrent {
4851
val uuid =
4952
request("https://api.mojang.com/users/profiles/minecraft/$playerName") {
5053
method(Method.GET)
51-
}.json<GameProfile>().data?.id ?: UUID(0, 0)
54+
}.json<GameProfile>().data?.id ?: nilUuid
5255

5356
val fetchedProperties = mc.sessionService.fetchProfile(uuid, true)?.profile?.properties
5457

55-
val profile = GameProfile(UUID(0, 0), playerName).apply {
58+
val profile = GameProfile(nilUuid, playerName).apply {
5659
fetchedProperties?.forEach { key, value -> properties.put(key, value) }
5760
}
5861

0 commit comments

Comments
 (0)