Dont send repeat action
This commit is contained in:
@ -21,7 +21,7 @@ public class KeyboardMixin {
|
|||||||
@Inject(method = "onKey", at = @At("HEAD"))
|
@Inject(method = "onKey", at = @At("HEAD"))
|
||||||
public void sendKeyPress(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) {
|
public void sendKeyPress(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) {
|
||||||
MinecraftClient client = ((Keyboard) (Object)this).client;
|
MinecraftClient client = ((Keyboard) (Object)this).client;
|
||||||
if(client.currentScreen == null) {
|
if(client.currentScreen == null && action != 2) {
|
||||||
PacketByteBuf byteBuf = new PacketByteBuf(Unpooled.buffer());
|
PacketByteBuf byteBuf = new PacketByteBuf(Unpooled.buffer());
|
||||||
byteBuf.writeInt(key);
|
byteBuf.writeInt(key);
|
||||||
byteBuf.writeByte(action);
|
byteBuf.writeByte(action);
|
||||||
|
|||||||
Reference in New Issue
Block a user