Skip to content

Commit

Permalink
Now its fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Waterpicker committed Dec 12, 2024
1 parent cdfc41a commit 9cc9146
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public MailEditScreen(Player arg, ItemStack arg2, InteractionHand arg3) {
location = ((MailItem) arg2.getItem()).getType().location;
}


private void setClipboard(String clipboardValue) {
if (this.minecraft != null) {
TextFieldHelper.setClipboardContents(this.minecraft, clipboardValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class ClientPacketProxy : PacketProxy() {
}

private fun <T : GenerationsNetworkPacket<T>> createConsumer(handler: ClientNetworkPacketHandler<T>): Consumer<T> {
return Consumer { handler.handle(it, Minecraft.getInstance())}
return Consumer {
var minecraft =Minecraft.getInstance()
minecraft.execute { handler.handle(it, minecraft) }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import generations.gg.generations.core.generationscore.common.client.screen.mail
import generations.gg.generations.core.generationscore.common.network.ClientNetworkPacketHandler
import generations.gg.generations.core.generationscore.common.tags.GenerationsItemTags
import net.minecraft.client.Minecraft
import kotlin.math.min

object S2COpenMailEditScreenPacketHandler : ClientNetworkPacketHandler<S2COpenMailEditScreenPacket> {
override fun handle(packet: S2COpenMailEditScreenPacket, minecraft: Minecraft) {
val itemStack = Minecraft.getInstance().player!!.getItemInHand(packet.hand)
val itemStack = minecraft.player!!.getItemInHand(packet.hand)
if (itemStack.`is`(GenerationsItemTags.CLOSED_POKEMAIL))
Minecraft.getInstance().setScreen(MailViewScreen(WrittenMailAccess(itemStack)))
minecraft.setScreen(MailViewScreen(WrittenMailAccess(itemStack)))
else if (itemStack.`is`(GenerationsItemTags.POKEMAIL))
Minecraft.getInstance().setScreen(MailEditScreen(Minecraft.getInstance().player, itemStack, packet.hand))
minecraft.setScreen(MailEditScreen(minecraft.player, itemStack, packet.hand))
}
}

0 comments on commit 9cc9146

Please sign in to comment.