Skip to content

Commit

Permalink
Added back keep alive packets to fix 1.12.2 client
Browse files Browse the repository at this point in the history
  • Loading branch information
X-com committed May 15, 2020
1 parent 25b92cc commit 8a68567
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/main/java/carpetclient/mixins/MixinGuiDownloadTerrain.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package carpetclient.mixins;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiDownloadTerrain;
import net.minecraft.network.play.client.CPacketKeepAlive;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(GuiDownloadTerrain.class)
public class MixinGuiDownloadTerrain {

private int counter = 0;

public void updateScreen()
{
++counter;
if (counter % 20 == 0)
{
Minecraft.getMinecraft().getConnection().sendPacket(new CPacketKeepAlive());
}
}
}
3 changes: 2 additions & 1 deletion src/main/resources/mixins.carpetclient.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"MixinWorldServer",
"MixinItemStack",
"MixinGuiScreen",
"MixinGuiRecipeBook"
"MixinGuiRecipeBook",
"MixinGuiDownloadTerrain"
]
}

0 comments on commit 8a68567

Please sign in to comment.