Skip to content
This repository was archived by the owner on Sep 8, 2026. It is now read-only.

Commit 2677e66

Browse files
committed
implement blacklist on ScreenContainerAbstract
1 parent 85624f9 commit 2677e66

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/main/java/turing/tmb/mixin/client/ScreenContainerAbstractMixin.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import turing.tmb.TypedIngredient;
1515
import turing.tmb.api.recipe.RecipeIngredientRole;
1616
import turing.tmb.client.TMBRenderer;
17+
import turing.tmb.util.GuiHelper;
1718

1819
@Mixin(value = ScreenContainerAbstract.class, remap = false)
1920
public abstract class ScreenContainerAbstractMixin extends Screen {
@@ -29,6 +30,8 @@ public ScreenContainerAbstractMixin() {
2930

3031
@Inject(method = "render", at = @At("TAIL"))
3132
public void render(int mouseX, int mouseY, float pt, CallbackInfo ci) {
33+
ScreenContainerAbstract t = (ScreenContainerAbstract) (Object) this;
34+
if (GuiHelper.screenBlacklist.contains(t.getClass().getCanonicalName())) return;
3235
TMBRenderer.renderHeader(false, mouseX, mouseY, width, height, mc, null);
3336
TMBRenderer.renderItems(mouseX, mouseY, width, height, mc, null);
3437
TMBRenderer.renderHeader(true, mouseX, mouseY, width, height, mc, null);
@@ -37,16 +40,22 @@ public void render(int mouseX, int mouseY, float pt, CallbackInfo ci) {
3740

3841
@Inject(method = "tick", at = @At("HEAD"))
3942
public void tick(CallbackInfo ci) {
43+
ScreenContainerAbstract t = (ScreenContainerAbstract) (Object) this;
44+
if (GuiHelper.screenBlacklist.contains(t.getClass().getCanonicalName())) return;
4045
TMBRenderer.onTick();
4146
}
4247

4348
@Inject(method = "mouseClicked", at = @At("HEAD"))
4449
public void mouseClicked(int mouseX, int mouseY, int buttonNum, CallbackInfo ci) {
50+
ScreenContainerAbstract t = (ScreenContainerAbstract) (Object) this;
51+
if (GuiHelper.screenBlacklist.contains(t.getClass().getCanonicalName())) return;
4552
TMBRenderer.mouseClicked(mouseX, mouseY, width, height, mc);
4653
}
4754

4855
@Inject(method = "keyPressed", at = @At("HEAD"), cancellable = true)
4956
public void keyPressed(char eventCharacter, int eventKey, int mx, int my, CallbackInfo ci) {
57+
ScreenContainerAbstract t = (ScreenContainerAbstract) (Object) this;
58+
if (GuiHelper.screenBlacklist.contains(t.getClass().getCanonicalName())) return;
5059
TMBRenderer.keyTyped(eventCharacter, eventKey, mx, my);
5160
if (TMBRenderer.search != null && TMBRenderer.search.isFocused) {
5261
ci.cancel();

0 commit comments

Comments
 (0)