Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
added "delaying packets" notification
Browse files Browse the repository at this point in the history
  • Loading branch information
garlic-bred committed Apr 5, 2024
1 parent 933bc0a commit 22d2016
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Binary file removed easy-bedrock-breaker-template-1.20.2.zip
Binary file not shown.
11 changes: 9 additions & 2 deletions src/main/java/com/bread/EasyBedrockBreaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.network.packet.Packet;
Expand All @@ -31,8 +34,7 @@ public class EasyBedrockBreaker implements ClientModInitializer {
PlayerInputC2SPacket.class,
PlayerInteractBlockC2SPacket.class,
PlayerInteractItemC2SPacket.class,
QueryBlockNbtC2SPacket.class,
UpdatePlayerAbilitiesC2SPacket.class
UpdateSelectedSlotC2SPacket.class
};

@Override
Expand All @@ -42,6 +44,11 @@ public void onInitializeClient() {
if (!activateKey.isPressed()) releasePackets();
});

HudRenderCallback.EVENT.register((drawContext, tickDelta) -> {
if (EasyBedrockBreaker.isDelayingPackets())
MinecraftClient.getInstance().textRenderer.draw("delaying packets", 4, drawContext.getScaledWindowHeight() - 4 - MinecraftClient.getInstance().textRenderer.fontHeight, 0xffffffff, true, drawContext.getMatrices().peek().getPositionMatrix(), drawContext.getVertexConsumers(), TextRenderer.TextLayerType.NORMAL, 0x00000000, 1);
});

LOGGER.info("easy bedrock breaker initialized");
}

Expand Down

0 comments on commit 22d2016

Please sign in to comment.