Skip to content

Commit a27497e

Browse files
authored
Add "No 2b2t Action Text" to NoRender (#261)
1 parent bb90ef0 commit a27497e

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/main/java/com/lambda/mixin/network/ClientPlayNetworkHandlerMixin.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,11 @@ void onSendMessage(String content, Operation<Void> original) {
125125
if (!EventFlow.post(event).isCanceled())
126126
original.call(event.getMessage());
127127
}
128+
129+
@Inject(method = "onOverlayMessage", at = @At("HEAD"), cancellable = true)
130+
void onOverlayMessage(OverlayMessageS2CPacket packet, CallbackInfo ci) {
131+
if (NoRender.getNo2b2tActionText() && packet.text().getString().equals("2b2t.org")) {
132+
ci.cancel();
133+
}
134+
}
128135
}

src/main/kotlin/com/lambda/module/modules/render/NoRender.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ object NoRender : Module(
6363
@JvmStatic val noBossBar by setting("No Boss Bar", false).group(Group.Hud)
6464
@JvmStatic val noScoreBoard by setting("No Score Board", false).group(Group.Hud)
6565
@JvmStatic val noStatusEffects by setting("No Status Effects", false).group(Group.Hud)
66+
@JvmStatic val no2b2tActionText by setting("No 2b2t Action Text", true, description = "Blocks the '2b2t.org' text from the action bar 2b2t randomly sends").group(Group.Hud)
6667

6768
@JvmStatic val noArmor by setting("No Armor", false).group(Group.Entity)
6869
@JvmStatic val includeNoOtherHeadItems by setting("Include No Other Head Items", false) { noArmor }.group(Group.Entity)

0 commit comments

Comments
 (0)