Skip to content

Commit

Permalink
Attempt at fixing mail crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Waterpicker committed Dec 12, 2024
1 parent 5d1b9c6 commit 28f5820
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ import net.minecraft.client.Minecraft
object S2COpenMailEditScreenPacketHandler : ClientNetworkPacketHandler<S2COpenMailEditScreenPacket> {
override fun handle(packet: S2COpenMailEditScreenPacket, minecraft: Minecraft) {
val itemStack = Minecraft.getInstance().player!!.getItemInHand(packet.hand)
if (itemStack.`is`(GenerationsItemTags.CLOSED_POKEMAIL)) Minecraft.getInstance()
.setScreen(MailViewScreen(WrittenMailAccess(itemStack))) else if (itemStack.`is`(GenerationsItemTags.POKEMAIL)) Minecraft.getInstance()
.setScreen(
MailEditScreen(
Minecraft.getInstance().player, itemStack,
packet.hand
)
)
if (itemStack.`is`(GenerationsItemTags.CLOSED_POKEMAIL))
Minecraft.getInstance().setScreen(MailViewScreen(WrittenMailAccess(itemStack)))
else if (itemStack.`is`(GenerationsItemTags.POKEMAIL))
Minecraft.getInstance().setScreen(MailEditScreen(Minecraft.getInstance().player, itemStack, packet.hand))
}
}

0 comments on commit 28f5820

Please sign in to comment.