Code Duplication    Length = 17-18 lines in 2 locations

src/main/java/de/pewpewproject/lasertag/client/screen/LasertagGameManagerTeamsScreen.java 1 location

@@ 54-71 (lines=18) @@
51
        return this.list.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
52
    }
53
54
    @Override
55
    protected void init() {
56
        super.init();
57
58
        var columns = new ArrayList<ListColumn<Tuple<TeamDto, UUID>, UUID>>();
59
60
        columns.add(new ListColumn<>(this::getTeamNameColumn, Tuple::y, 2));
61
        columns.add(new ListColumn<>(this::getPlayerNameColumn, Tuple::y, 2));
62
        columns.add(new ListColumn<>(this::getKickPlayerColumn, Tuple::y, 1));
63
64
        var columnsDefinition = new ListColumnsDefinition<>(columns);
65
66
        var availableHeight = this.height - (2 * verticalPadding + this.textRenderer.fontHeight + 2 * buttonPadding + buttonHeight);
67
68
        this.list = this.addDrawableChild(ListWidget.fromAvailableHeight(horizontalPadding, verticalPadding + textRenderer.fontHeight + buttonPadding,
69
                this.width - 2 * horizontalPadding, availableHeight,
70
                this::getPlayers,
71
                columnsDefinition, this, this.textRenderer));
72
    }
73
74
    /**

src/main/java/de/pewpewproject/lasertag/client/screen/LasertagTeamSelectorScreen.java 1 location

@@ 65-81 (lines=17) @@
62
        return this.list.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
63
    }
64
65
    @Override
66
    protected void init() {
67
        super.init();
68
69
        var columns = new ArrayList<ListColumn<TeamDto, Integer>>();
70
71
        columns.add(new ListColumn<>(this::getTeamNameColumn, TeamDto::id, 2));
72
        columns.add(new ListColumn<>(this::getJoinTeamButtonColumn, TeamDto::id, 1));
73
74
        var columnsDefinition = new ListColumnsDefinition<>(columns);
75
76
        var availableHeight = this.height - (2 * VERTICAL_PADDING + this.textRenderer.fontHeight + 2 * BUTTON_PADDING + BUTTON_HEIGHT);
77
78
        this.list = this.addDrawableChild(ListWidget.fromAvailableHeight(HORIZONTAL_PADDING, VERTICAL_PADDING + textRenderer.fontHeight + BUTTON_PADDING,
79
                this.width - 2 * HORIZONTAL_PADDING, availableHeight,
80
                this::getTeams,
81
                columnsDefinition, this, this.textRenderer));
82
    }
83
84
    @Override