• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CyclopsMC / IntegratedDynamics / 22186773560

19 Feb 2026 02:52PM UTC coverage: 52.603% (+0.2%) from 52.363%
22186773560

push

github

web-flow
Remove Lombok dependency (#1604)

2911 of 8664 branches covered (33.6%)

Branch coverage included in aggregate %.

17683 of 30486 relevant lines covered (58.0%)

3.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/cyclops/integrateddynamics/core/logicprogrammer/client/RenderPattern.java
1
package org.cyclops.integrateddynamics.core.logicprogrammer.client;
2

3
import net.minecraft.client.gui.Font;
4
import net.minecraft.client.gui.GuiGraphics;
5
import net.minecraft.client.gui.screens.Screen;
6
import net.minecraft.client.renderer.RenderPipelines;
7
import net.minecraft.client.renderer.texture.TextureManager;
8
import net.minecraft.resources.Identifier;
9
import net.minecraft.world.inventory.AbstractContainerMenu;
10
import org.apache.commons.lang3.tuple.Pair;
11
import org.cyclops.cyclopscore.helper.IModHelpers;
12
import org.cyclops.integrateddynamics.Reference;
13
import org.cyclops.integrateddynamics.api.client.gui.subgui.IGuiInputElement;
14
import org.cyclops.integrateddynamics.api.client.gui.subgui.ISubGuiBox;
15
import org.cyclops.integrateddynamics.api.logicprogrammer.IConfigRenderPattern;
16
import org.cyclops.integrateddynamics.core.client.gui.subgui.SubGuiBox;
17
import org.cyclops.integrateddynamics.core.logicprogrammer.RenderPatternCommon;
18

19
/**
20
 * Sub gui for rendering logic programmer elements.
21
 * @author rubensworks
22
 */
23
public class RenderPattern<E extends IGuiInputElement, G extends Screen, C extends AbstractContainerMenu> extends SubGuiBox implements ISubGuiBox {
24

25
    protected final E element;
26
    private final int x, y;
27
    protected final G gui;
28
    protected final C container;
29
    protected Identifier texture = Identifier.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/logic_programmer.png");
×
30

31
    public E getElement() {
32
        return element;
×
33
    }
34

35
    public RenderPattern(E element, int baseX, int baseY, int maxWidth, int maxHeight,
36
                         G gui, C container) {
37
        super(SubGuiBox.Box.LIGHT);
×
38
        this.element = element;
×
39
        IConfigRenderPattern configRenderPattern = element.getRenderPattern();
×
40
        this.x = RenderPatternCommon.calculateX(baseX, maxWidth, configRenderPattern);
×
41
        this.y = RenderPatternCommon.calculateY(baseY, maxHeight, configRenderPattern);
×
42
        this.gui = gui;
×
43
        this.container = container;
×
44
    }
×
45

46
    public C getContainer() {
47
        return container;
×
48
    }
49

50
    protected void drawSlot(GuiGraphics guiGraphics, int x, int y) {
51
        guiGraphics.blit(RenderPipelines.GUI_TEXTURED, SubGuiBox.TEXTURE, x, y, 19, 0, 18, 18, 256, 256);
×
52
    }
×
53

54
    @Override
55
    public void init(int guiLeft, int guiTop) {
56
        super.init(guiLeft, guiTop);
×
57
    }
×
58

59
    @Override
60
    public void tick() {
61

62
    }
×
63

64
    protected boolean drawRenderPattern() {
65
        return true;
×
66
    }
67

68
    @Override
69
    public void renderBg(GuiGraphics guiGraphics, int guiLeft, int guiTop, TextureManager textureManager, Font fontRenderer, float partialTicks, int mouseX, int mouseY) {
70
        super.renderBg(guiGraphics, guiLeft, guiTop, textureManager, fontRenderer, partialTicks, mouseX, mouseY);
×
71
        if (drawRenderPattern()) {
×
72
            IConfigRenderPattern configRenderPattern = element.getRenderPattern();
×
73

74
            int baseX = getX() + guiLeft;
×
75
            int baseY = getY() + guiTop;
×
76

77
            for (Pair<Integer, Integer> slot : configRenderPattern.getSlotPositions()) {
×
78
                drawSlot(guiGraphics, baseX + slot.getLeft(), baseY + slot.getRight());
×
79
            }
80

81
            if (configRenderPattern.getSymbolPosition() != null) {
×
82
                IModHelpers.get().getRenderHelpers().drawScaledCenteredString(guiGraphics, fontRenderer, element.getSymbol(),
×
83
                        baseX + configRenderPattern.getSymbolPosition().getLeft(),
×
84
                        baseY + configRenderPattern.getSymbolPosition().getRight() + 8,
×
85
                        0, 1, 0, false, Font.DisplayMode.NORMAL);
86
            }
87
        }
88
    }
×
89

90
    @Override
91
    public int getX() {
92
        return this.x;
×
93
    }
94

95
    @Override
96
    public int getY() {
97
        return this.y;
×
98
    }
99

100
    @Override
101
    public int getWidth() {
102
        return element.getRenderPattern().getWidth();
×
103
    }
104

105
    @Override
106
    public int getHeight() {
107
        return element.getRenderPattern().getHeight();
×
108
    }
109

110
    public void sendValueToServer() {
111

112
    }
×
113

114
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc