mirror of https://github.com/kami-blue/client
[fix] Pyro Client bug
Closes #1649 Signed-off-by: Dominika <sokolov.dominika@gmail.com>
This commit is contained in:
parent
0ead2f23eb
commit
60d1e841a9
|
@ -22,6 +22,7 @@ object FakePlayer : Module() {
|
|||
val playerName = register(Settings.stringBuilder("PlayerName").withValue("Player").withVisibility { false })
|
||||
|
||||
private var fakePlayer: EntityOtherPlayerMP? = null
|
||||
private const val ENTITY_ID = -7170400
|
||||
|
||||
init {
|
||||
listener<ConnectionEvent.Disconnect> {
|
||||
|
@ -38,6 +39,7 @@ object FakePlayer : Module() {
|
|||
disable()
|
||||
return
|
||||
}
|
||||
|
||||
if (playerName.value == "Player") {
|
||||
MessageSendHelper.sendChatMessage("You can use &7'${Command.commandPrefix.value}fp <name>'&r to set a custom name")
|
||||
}
|
||||
|
@ -47,12 +49,13 @@ object FakePlayer : Module() {
|
|||
rotationYawHead = mc.player.rotationYawHead
|
||||
if (copyInventory.value) inventory.copyInventory(mc.player.inventory)
|
||||
}.also {
|
||||
mc.world.addEntityToWorld(-911, it)
|
||||
mc.world.addEntityToWorld(ENTITY_ID, it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDisable() {
|
||||
if (mc.world == null || mc.player == null) return
|
||||
fakePlayer?.setDead()
|
||||
mc.world?.removeEntityFromWorld(ENTITY_ID)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue