mirror of https://github.com/kami-blue/client
[fix] Fixed rare crash with other mod in Blink, CrystalAura, and FakePlayer
This commit is contained in:
parent
6542baecaa
commit
faea0c7977
|
@ -169,7 +169,6 @@ object CrystalAura : Module() {
|
|||
|
||||
for (crystal in crystalList) {
|
||||
crystal.setDead()
|
||||
mc.world.removeEntityFromWorld(crystal.entityId)
|
||||
}
|
||||
|
||||
ignoredList.clear()
|
||||
|
|
|
@ -19,6 +19,8 @@ object FakePlayer : Module() {
|
|||
private val copyInventory = register(Settings.b("CopyInventory", false))
|
||||
val playerName = register(Settings.stringBuilder("PlayerName").withValue("Player").withVisibility { false })
|
||||
|
||||
private var fakePlayer: EntityOtherPlayerMP? = null
|
||||
|
||||
init {
|
||||
listener<ConnectionEvent.Disconnect> {
|
||||
disable()
|
||||
|
@ -31,7 +33,7 @@ object FakePlayer : Module() {
|
|||
return
|
||||
}
|
||||
if (playerName.value == "Player") MessageSendHelper.sendChatMessage("You can use &7'${Command.commandPrefix.value}fp <name>'&r to set a custom name")
|
||||
EntityOtherPlayerMP(mc.world, GameProfile(UUID.randomUUID(), playerName.value)).apply {
|
||||
fakePlayer = EntityOtherPlayerMP(mc.world, GameProfile(UUID.randomUUID(), playerName.value)).apply {
|
||||
copyLocationAndAnglesFrom(mc.player)
|
||||
rotationYawHead = mc.player.rotationYawHead
|
||||
if (copyInventory.value) inventory.copyInventory(mc.player.inventory)
|
||||
|
@ -42,6 +44,6 @@ object FakePlayer : Module() {
|
|||
|
||||
override fun onDisable() {
|
||||
if (mc.world == null || mc.player == null) return
|
||||
mc.world.removeEntityFromWorld(-911)
|
||||
fakePlayer?.setDead()
|
||||
}
|
||||
}
|
|
@ -7,7 +7,6 @@ import me.zeroeightsix.kami.module.Module
|
|||
import me.zeroeightsix.kami.setting.Settings
|
||||
import me.zeroeightsix.kami.util.event.listener
|
||||
import net.minecraft.client.entity.EntityOtherPlayerMP
|
||||
import net.minecraft.entity.Entity
|
||||
import net.minecraft.network.play.client.CPacketPlayer
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent
|
||||
import java.util.*
|
||||
|
@ -63,8 +62,9 @@ object Blink : Module() {
|
|||
rotationYawHead = mc.player.rotationYawHead
|
||||
inventory.copyInventory(mc.player.inventory)
|
||||
noClip = true
|
||||
}.also {
|
||||
mc.world.addEntityToWorld(-114514, it)
|
||||
}
|
||||
mc.world.addEntityToWorld(-114514, clonedPlayer as Entity)
|
||||
}
|
||||
|
||||
private fun end() {
|
||||
|
@ -77,7 +77,7 @@ object Blink : Module() {
|
|||
while (packets.isNotEmpty()) mc.connection!!.sendPacket(packets.poll())
|
||||
sending = false
|
||||
}
|
||||
mc.world?.removeEntityFromWorld(-114514)
|
||||
clonedPlayer?.setDead()
|
||||
clonedPlayer = null
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue