Skip to content

Commit 45f1081

Browse files
authored
Update 1.21.9 implementation (#327)
* Add missing @OverRide annotations * Update Gradle and shadow plugin
1 parent af85e8d commit 45f1081

19 files changed

+46
-12
lines changed

common/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id "com.github.johnrengelman.shadow" version "8.1.1"
2+
id "com.gradleup.shadow" version "9.2.2"
33
id "maven-publish"
44
}
55

common/src/main/java/me/shedaniel/clothconfig2/api/animator/DoubleValueAnimatorImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public double doubleValue() {
104104
return amount;
105105
}
106106

107+
@Override
107108
public Double target() {
108109
return target;
109110
}

common/src/main/java/me/shedaniel/clothconfig2/gui/GlobalizedClothConfigScreen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ public int getItemHeight() {
340340
return 4 + strings.size() * 10;
341341
}
342342

343+
@Override
343344
@Nullable
344345
public ComponentPath nextFocusPath(FocusNavigationEvent focusNavigationEvent) {
345346
return null;

common/src/main/java/me/shedaniel/clothconfig2/gui/entries/DoubleListListEntry.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ protected boolean isValidText(@NotNull String text) {
9191
return text.chars().allMatch(c -> Character.isDigit(c) || c == '-' || c == '.');
9292
}
9393

94+
@Override
9495
public Double getValue() {
9596
try {
9697
return Double.valueOf(widget.getValue());

common/src/main/java/me/shedaniel/clothconfig2/gui/entries/EmptyEntry.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public int getItemHeight() {
4343
return height;
4444
}
4545

46+
@Override
4647
@Nullable
4748
public ComponentPath nextFocusPath(FocusNavigationEvent focusNavigationEvent) {
4849
return null;

common/src/main/java/me/shedaniel/clothconfig2/gui/entries/FloatListListEntry.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ protected boolean isValidText(@NotNull String text) {
9191
return text.chars().allMatch(c -> Character.isDigit(c) || c == '-' || c == '.');
9292
}
9393

94+
@Override
9495
public Float getValue() {
9596
try {
9697
return Float.valueOf(widget.getValue());

common/src/main/java/me/shedaniel/clothconfig2/gui/entries/IntegerListListEntry.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ protected boolean isValidText(@NotNull String text) {
9191
return text.chars().allMatch(c -> Character.isDigit(c) || c == '-');
9292
}
9393

94+
@Override
9495
public Integer getValue() {
9596
try {
9697
return Integer.valueOf(widget.getValue());

common/src/main/java/me/shedaniel/clothconfig2/gui/entries/LongListListEntry.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ protected boolean isValidText(@NotNull String text) {
9191
return text.chars().allMatch(c -> Character.isDigit(c) || c == '-');
9292
}
9393

94+
@Override
9495
public Long getValue() {
9596
try {
9697
return Long.valueOf(widget.getValue());

common/src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicElementListWidget.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public DynamicElementListWidget(Minecraft client, int width, int height, int top
5050
super(client, width, height, top, bottom, backgroundLocation);
5151
}
5252

53+
@Override
5354
@Nullable
5455
public ComponentPath nextFocusPath(FocusNavigationEvent focusNavigationEvent) {
5556
if (this.getItemCount() == 0) {
@@ -101,6 +102,7 @@ public ComponentPath nextFocusPath(FocusNavigationEvent focusNavigationEvent) {
101102
}
102103
}
103104

105+
@Override
104106
public void updateNarration(NarrationElementOutput narrationElementOutput) {
105107
E entry = this.hoveredItem;
106108
if (entry != null) {
@@ -117,6 +119,7 @@ public void updateNarration(NarrationElementOutput narrationElementOutput) {
117119
narrationElementOutput.add(NarratedElementType.USAGE, Component.translatable("narration.component_list.usage"));
118120
}
119121

122+
@Override
120123
public void setFocused(@Nullable GuiEventListener guiEventListener) {
121124
super.setFocused(guiEventListener);
122125
if (guiEventListener == null) {
@@ -125,10 +128,12 @@ public void setFocused(@Nullable GuiEventListener guiEventListener) {
125128

126129
}
127130

131+
@Override
128132
public NarratableEntry.NarrationPriority narrationPriority() {
129133
return this.isFocused() ? NarrationPriority.FOCUSED : super.narrationPriority();
130134
}
131135

136+
@Override
132137
protected boolean isSelected(int i) {
133138
return false;
134139
}
@@ -144,19 +149,23 @@ public abstract static class ElementEntry<E extends ElementEntry<E>> extends Ent
144149
public ElementEntry() {
145150
}
146151

152+
@Override
147153
public boolean isDragging() {
148154
return this.dragging;
149155
}
150156

157+
@Override
151158
public void setDragging(boolean bl) {
152159
this.dragging = bl;
153160
}
154161

162+
@Override
155163
@Nullable
156164
public GuiEventListener getFocused() {
157165
return this.focused;
158166
}
159167

168+
@Override
160169
public void setFocused(@Nullable GuiEventListener guiEventListener) {
161170
if (this.focused != null) {
162171
this.focused.setFocused(false);
@@ -179,6 +188,7 @@ public ComponentPath focusPathAtIndex(FocusNavigationEvent focusNavigationEvent,
179188
}
180189
}
181190

191+
@Override
182192
@Nullable
183193
public ComponentPath nextFocusPath(FocusNavigationEvent focusNavigationEvent) {
184194
if (focusNavigationEvent instanceof FocusNavigationEvent.ArrowNavigation arrowNavigation) {
@@ -206,8 +216,10 @@ public ComponentPath nextFocusPath(FocusNavigationEvent focusNavigationEvent) {
206216
return ContainerEventHandler.super.nextFocusPath(focusNavigationEvent);
207217
}
208218

219+
@Override
209220
public abstract List<? extends NarratableEntry> narratables();
210221

222+
@Override
211223
public void updateNarration(NarrationElementOutput narrationElementOutput) {
212224
List<? extends NarratableEntry> list = this.narratables();
213225
Screen.NarratableSearchResult narratableSearchResult = Screen.findNarratableWidget(list, this.lastNarratable);

common/src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicEntryListWidget.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ protected void setRenderHeader(boolean boolean_1, int headerHeight) {
127127
this.headerHeight = 0;
128128
}
129129

130+
@Override
130131
public NarrationPriority narrationPriority() {
131132
if (this.isFocused()) {
132133
return NarrationPriority.FOCUSED;
@@ -135,6 +136,7 @@ public NarrationPriority narrationPriority() {
135136
}
136137
}
137138

139+
@Override
138140
public void updateNarration(NarrationElementOutput narrationElementOutput) {
139141
E entry = this.hoveredItem;
140142
if (entry != null) {
@@ -173,10 +175,12 @@ public void selectItem(E item) {
173175
this.selectedItem = item;
174176
}
175177

178+
@Override
176179
public E getFocused() {
177180
return (E) super.getFocused();
178181
}
179182

183+
@Override
180184
public List<E> children() {
181185
return this.entries;
182186
}
@@ -385,6 +389,7 @@ protected int getScrollbarPosition() {
385389
return this.width / 2 + 124;
386390
}
387391

392+
@Override
388393
public boolean mouseClicked(MouseButtonEvent event, boolean doubleClick) {
389394
this.updateScrollingState(event.x(), event.y(), event.button());
390395
if (!this.isMouseOver(event.x(), event.y())) {
@@ -406,10 +411,12 @@ public boolean mouseClicked(MouseButtonEvent event, boolean doubleClick) {
406411
}
407412
}
408413

414+
@Override
409415
public ScreenRectangle getRectangle() {
410416
return new ScreenRectangle(this.left, this.top, this.right - this.left, this.bottom - this.top);
411417
}
412418

419+
@Override
413420
public void setFocused(@Nullable GuiEventListener guiEventListener) {
414421
super.setFocused(guiEventListener);
415422
int i = this.entries.indexOf(guiEventListener);
@@ -461,6 +468,7 @@ protected E nextEntry(ScreenDirection screenDirection, Predicate<E> predicate, @
461468
return null;
462469
}
463470

471+
@Override
464472
public boolean mouseReleased(MouseButtonEvent event) {
465473
if (this.getFocused() != null) {
466474
this.getFocused().mouseReleased(event);
@@ -469,6 +477,7 @@ public boolean mouseReleased(MouseButtonEvent event) {
469477
return false;
470478
}
471479

480+
@Override
472481
public boolean mouseDragged(MouseButtonEvent event, double deltaX, double deltaY) {
473482
if (super.mouseDragged(event, deltaX, deltaY)) {
474483
return true;
@@ -491,6 +500,7 @@ public boolean mouseDragged(MouseButtonEvent event, double deltaX, double deltaY
491500
}
492501
}
493502

503+
@Override
494504
public boolean mouseScrolled(double double_1, double double_2, double amountX, double amountY) {
495505
for (E entry : visibleChildren()) {
496506
if (entry.mouseScrolled(double_1, double_2, amountX, amountY)) {
@@ -501,6 +511,7 @@ public boolean mouseScrolled(double double_1, double double_2, double amountX, d
501511
return amountY != 0;
502512
}
503513

514+
@Override
504515
public boolean keyPressed(KeyEvent keyEvent) {
505516
if (super.keyPressed(keyEvent)) {
506517
return true;
@@ -527,6 +538,7 @@ protected void moveSelection(int shift) {
527538
this.ensureVisible(item);
528539
}
529540

541+
@Override
530542
public boolean isMouseOver(double double_1, double double_2) {
531543
return double_2 >= (double) this.top && double_2 <= (double) this.bottom && double_1 >= (double) this.left && double_1 <= (double) this.right;
532544
}
@@ -633,6 +645,7 @@ public Entry() {
633645

634646
public abstract void render(GuiGraphics graphics, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isHovered, float delta);
635647

648+
@Override
636649
public boolean isMouseOver(double double_1, double double_2) {
637650
return this.bounds.contains(double_1, double_2);
638651
}

0 commit comments

Comments
 (0)