Skip to content

Commit 1ee708b

Browse files
committed
apply spotless
1 parent 7e48eb0 commit 1ee708b

145 files changed

Lines changed: 3082 additions & 2409 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
/*
2+
* Copyright (C) 2026 The Debugify Contributors
3+
*
4+
* SPDX-License-Identifier: LGPL-3.0-or-later
5+
*/
16
package dev.isxander.debugify.client;
27

38
public class DebugifyClient {
4-
public static void onInitializeClient() {
5-
}
9+
public static void onInitializeClient() {
10+
}
611
}
Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2026 The Debugify Contributors
3+
*
4+
* SPDX-License-Identifier: LGPL-3.0-or-later
5+
*/
16
package dev.isxander.debugify.client.gui;
27

38
import dev.isxander.yacl3.api.Option;
@@ -9,39 +14,39 @@
914
import net.minecraft.network.chat.Component;
1015

1116
public class BugFixController extends BooleanController {
12-
public BugFixController(Option<Boolean> option, boolean errored) {
13-
super(option, state -> {
14-
if (errored)
15-
return Component.translatable("debugify.error.mixin_error.text").withStyle(ChatFormatting.RED);
16-
if (!option.available())
17-
return Component.translatable("debugify.fix.unavailable");
18-
return state
19-
? Component.translatable("debugify.fix.enabled").withStyle(ChatFormatting.GREEN)
20-
: Component.translatable("debugify.fix.disabled").withStyle(ChatFormatting.RED);
21-
}, false);
22-
}
17+
public BugFixController(Option<Boolean> option, boolean errored) {
18+
super(option, state -> {
19+
if (errored)
20+
return Component.translatable("debugify.error.mixin_error.text").withStyle(ChatFormatting.RED);
21+
if (!option.available())
22+
return Component.translatable("debugify.fix.unavailable");
23+
return state
24+
? Component.translatable("debugify.fix.enabled").withStyle(ChatFormatting.GREEN)
25+
: Component.translatable("debugify.fix.disabled").withStyle(ChatFormatting.RED);
26+
}, false);
27+
}
2328

24-
@Override
25-
public AbstractWidget provideWidget(YACLScreen screen, Dimension<Integer> widgetDimension) {
26-
return new BugFixControllerElement(this, screen, widgetDimension);
27-
}
29+
@Override
30+
public AbstractWidget provideWidget(YACLScreen screen, Dimension<Integer> widgetDimension) {
31+
return new BugFixControllerElement(this, screen, widgetDimension);
32+
}
2833

29-
public static class BugFixControllerElement extends BooleanControllerElement {
30-
private String tooltipString;
34+
public static class BugFixControllerElement extends BooleanControllerElement {
35+
private String tooltipString;
3136

32-
public BugFixControllerElement(BugFixController control, YACLScreen screen, Dimension<Integer> dim) {
33-
super(control, screen, dim);
34-
control.option().addListener((opt, pending) -> recalculateTooltipString());
35-
recalculateTooltipString();
36-
}
37+
public BugFixControllerElement(BugFixController control, YACLScreen screen, Dimension<Integer> dim) {
38+
super(control, screen, dim);
39+
control.option().addListener((opt, pending) -> recalculateTooltipString());
40+
recalculateTooltipString();
41+
}
3742

38-
@Override
39-
public boolean matchesSearch(String query) {
40-
return super.matchesSearch(query) || tooltipString.contains(query.toLowerCase());
41-
}
43+
@Override
44+
public boolean matchesSearch(String query) {
45+
return super.matchesSearch(query) || tooltipString.contains(query.toLowerCase());
46+
}
4247

43-
private void recalculateTooltipString() {
44-
this.tooltipString = control.option().description().text().getString().toLowerCase();
45-
}
46-
}
48+
private void recalculateTooltipString() {
49+
this.tooltipString = control.option().description().text().getString().toLowerCase();
50+
}
51+
}
4752
}
Lines changed: 106 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2026 The Debugify Contributors
3+
*
4+
* SPDX-License-Identifier: LGPL-3.0-or-later
5+
*/
16
package dev.isxander.debugify.client.gui;
27

38
import dev.isxander.debugify.config.DebugifyConfig;
@@ -14,105 +19,105 @@
1419
import net.minecraft.network.chat.Component;
1520

1621
public class ConfigGuiHelper {
17-
public static Screen createConfigGui(DebugifyConfig config, Screen parent) {
18-
var yacl = YetAnotherConfigLib.createBuilder()
19-
.title(Component.translatable("debugify.name"))
20-
.save(config::save);
21-
22-
var gameplayWarning = LabelOption.create(Component.translatable("debugify.gameplay.warning").withStyle(ChatFormatting.RED));
23-
var gameplayInMultiplayer = Option.<Boolean>createBuilder()
24-
.name(Component.translatable("debugify.gameplay.enable_in_multiplayer"))
25-
.binding(
26-
false,
27-
() -> config.gameplayFixesInMultiplayer,
28-
value -> config.gameplayFixesInMultiplayer = value
29-
)
30-
.controller(TickBoxControllerBuilder::create)
31-
.build();
32-
33-
for (BugFix.Env env : BugFix.Env.values()) {
34-
var categoryBuilder = ConfigCategory.createBuilder()
35-
.name(Component.translatable(env.getDisplayName()))
36-
.tooltip(Component.translatable(env.getDescriptionKey()));
37-
38-
for (FixCategory fixCategory : FixCategory.values()) {
39-
var groupBuilder = OptionGroup.createBuilder()
40-
.name(Component.translatable(fixCategory.getDisplayName()));
41-
42-
if (fixCategory == FixCategory.GAMEPLAY) {
43-
groupBuilder
44-
.option(gameplayWarning)
45-
.option(gameplayInMultiplayer);
46-
}
47-
48-
config.getBugFixes().forEach((bug, enabled) -> {
49-
if (bug.env() == env && bug.category() == fixCategory) {
50-
var conflicts = bug.getActiveConflicts().stream().map(id -> FabricLoader.getInstance().getModContainer(id).orElseThrow().getMetadata().getName()).toList();
51-
var satisfiesOS = bug.satisfiesOSRequirement();
52-
var errored = DebugifyErrorHandler.hasErrored(bug);
53-
var unavailable = !conflicts.isEmpty() || !satisfiesOS || errored;
54-
55-
var optionBuilder = Option.<Boolean>createBuilder()
56-
.name(Component.literal(bug.bugId()))
57-
.binding(
58-
bug.enabledByDefault(),
59-
() -> config.getBugFixes().get(bug),
60-
value -> config.getBugFixes().replace(bug, value)
61-
)
62-
.customController(opt -> new BugFixController(opt, errored))
63-
.available(!unavailable)
64-
.flag(OptionFlag.GAME_RESTART);
65-
66-
OptionDescription.Builder descriptionBuilder = OptionDescription.createBuilder();
67-
68-
if (errored) {
69-
descriptionBuilder.text(Component.translatable("debugify.error.mixin_error", bug.bugId()).withStyle(ChatFormatting.RED, ChatFormatting.BOLD));
70-
}
71-
72-
for (String conflictMod : conflicts) {
73-
descriptionBuilder.text(Component.translatable("debugify.error.conflict", bug.bugId(), conflictMod).withStyle(ChatFormatting.RED));
74-
}
75-
76-
if (!satisfiesOS)
77-
descriptionBuilder.text(Component.translatable("debugify.error.os", bug.bugId(), Component.translatable(bug.requiredOs().getDisplayName())).withStyle(ChatFormatting.RED));
78-
79-
if (bug.description() != null)
80-
descriptionBuilder.text(Component.literal(bug.description()));
81-
82-
String fixExplanationTooltipKey = "debugify.fix_explanation." + bug.bugId().toLowerCase();
83-
if (Language.getInstance().has(fixExplanationTooltipKey))
84-
descriptionBuilder.text(Component.translatable(fixExplanationTooltipKey).withStyle(ChatFormatting.GRAY));
85-
86-
String fixEffectTooltipKey = "debugify.fix_effect." + bug.bugId().toLowerCase();
87-
if (Language.getInstance().has(fixEffectTooltipKey))
88-
descriptionBuilder.text(Component.translatable(fixEffectTooltipKey).withStyle(ChatFormatting.GOLD));
89-
90-
optionBuilder.description(descriptionBuilder.build());
91-
92-
groupBuilder.option(optionBuilder.build());
93-
}
94-
});
95-
96-
categoryBuilder.group(groupBuilder.build());
97-
}
98-
99-
yacl.category(categoryBuilder.build());
100-
}
101-
102-
yacl.category(ConfigCategory.createBuilder()
103-
.name(Component.translatable("debugify.misc"))
104-
.option(Option.<Boolean>createBuilder()
105-
.name(Component.translatable("debugify.misc.default_disabled"))
106-
.description(OptionDescription.of(Component.translatable("debugify.misc.default_disabled.description")))
107-
.binding(
108-
false,
109-
() -> config.defaultDisabled,
110-
value -> config.defaultDisabled = value
111-
)
112-
.controller(BooleanControllerBuilder::create)
113-
.build())
114-
.build());
115-
116-
return yacl.build().generateScreen(parent);
117-
}
22+
public static Screen createConfigGui(DebugifyConfig config, Screen parent) {
23+
var yacl = YetAnotherConfigLib.createBuilder()
24+
.title(Component.translatable("debugify.name"))
25+
.save(config::save);
26+
27+
var gameplayWarning = LabelOption.create(Component.translatable("debugify.gameplay.warning").withStyle(ChatFormatting.RED));
28+
var gameplayInMultiplayer = Option.<Boolean>createBuilder()
29+
.name(Component.translatable("debugify.gameplay.enable_in_multiplayer"))
30+
.binding(
31+
false,
32+
() -> config.gameplayFixesInMultiplayer,
33+
value -> config.gameplayFixesInMultiplayer = value
34+
)
35+
.controller(TickBoxControllerBuilder::create)
36+
.build();
37+
38+
for (BugFix.Env env : BugFix.Env.values()) {
39+
var categoryBuilder = ConfigCategory.createBuilder()
40+
.name(Component.translatable(env.getDisplayName()))
41+
.tooltip(Component.translatable(env.getDescriptionKey()));
42+
43+
for (FixCategory fixCategory : FixCategory.values()) {
44+
var groupBuilder = OptionGroup.createBuilder()
45+
.name(Component.translatable(fixCategory.getDisplayName()));
46+
47+
if (fixCategory == FixCategory.GAMEPLAY) {
48+
groupBuilder
49+
.option(gameplayWarning)
50+
.option(gameplayInMultiplayer);
51+
}
52+
53+
config.getBugFixes().forEach((bug, enabled) -> {
54+
if (bug.env() == env && bug.category() == fixCategory) {
55+
var conflicts = bug.getActiveConflicts().stream().map(id -> FabricLoader.getInstance().getModContainer(id).orElseThrow().getMetadata().getName()).toList();
56+
var satisfiesOS = bug.satisfiesOSRequirement();
57+
var errored = DebugifyErrorHandler.hasErrored(bug);
58+
var unavailable = !conflicts.isEmpty() || !satisfiesOS || errored;
59+
60+
var optionBuilder = Option.<Boolean>createBuilder()
61+
.name(Component.literal(bug.bugId()))
62+
.binding(
63+
bug.enabledByDefault(),
64+
() -> config.getBugFixes().get(bug),
65+
value -> config.getBugFixes().replace(bug, value)
66+
)
67+
.customController(opt -> new BugFixController(opt, errored))
68+
.available(!unavailable)
69+
.flag(OptionFlag.GAME_RESTART);
70+
71+
OptionDescription.Builder descriptionBuilder = OptionDescription.createBuilder();
72+
73+
if (errored) {
74+
descriptionBuilder.text(Component.translatable("debugify.error.mixin_error", bug.bugId()).withStyle(ChatFormatting.RED, ChatFormatting.BOLD));
75+
}
76+
77+
for (String conflictMod : conflicts) {
78+
descriptionBuilder.text(Component.translatable("debugify.error.conflict", bug.bugId(), conflictMod).withStyle(ChatFormatting.RED));
79+
}
80+
81+
if (!satisfiesOS)
82+
descriptionBuilder.text(Component.translatable("debugify.error.os", bug.bugId(), Component.translatable(bug.requiredOs().getDisplayName())).withStyle(ChatFormatting.RED));
83+
84+
if (bug.description() != null)
85+
descriptionBuilder.text(Component.literal(bug.description()));
86+
87+
String fixExplanationTooltipKey = "debugify.fix_explanation." + bug.bugId().toLowerCase();
88+
if (Language.getInstance().has(fixExplanationTooltipKey))
89+
descriptionBuilder.text(Component.translatable(fixExplanationTooltipKey).withStyle(ChatFormatting.GRAY));
90+
91+
String fixEffectTooltipKey = "debugify.fix_effect." + bug.bugId().toLowerCase();
92+
if (Language.getInstance().has(fixEffectTooltipKey))
93+
descriptionBuilder.text(Component.translatable(fixEffectTooltipKey).withStyle(ChatFormatting.GOLD));
94+
95+
optionBuilder.description(descriptionBuilder.build());
96+
97+
groupBuilder.option(optionBuilder.build());
98+
}
99+
});
100+
101+
categoryBuilder.group(groupBuilder.build());
102+
}
103+
104+
yacl.category(categoryBuilder.build());
105+
}
106+
107+
yacl.category(ConfigCategory.createBuilder()
108+
.name(Component.translatable("debugify.misc"))
109+
.option(Option.<Boolean>createBuilder()
110+
.name(Component.translatable("debugify.misc.default_disabled"))
111+
.description(OptionDescription.of(Component.translatable("debugify.misc.default_disabled.description")))
112+
.binding(
113+
false,
114+
() -> config.defaultDisabled,
115+
value -> config.defaultDisabled = value
116+
)
117+
.controller(BooleanControllerBuilder::create)
118+
.build())
119+
.build());
120+
121+
return yacl.build().generateScreen(parent);
122+
}
118123
}
Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2026 The Debugify Contributors
3+
*
4+
* SPDX-License-Identifier: LGPL-3.0-or-later
5+
*/
16
package dev.isxander.debugify.client.gui;
27

38
import net.fabricmc.loader.api.FabricLoader;
@@ -11,17 +16,17 @@
1116
import java.net.URI;
1217

1318
public class NoYACLScreen extends AlertScreen {
14-
public NoYACLScreen(Screen parent) {
15-
super(
16-
() -> Minecraft.getInstance().gui.setScreen(parent),
17-
Component.translatable("debugify.no_yacl.title").withStyle(ChatFormatting.BOLD),
18-
Component.translatable("debugify.no_yacl.description",
19-
Component.literal("YetAnotherConfigLib").withStyle(style -> style
20-
.withClickEvent(new ClickEvent.OpenUrl(URI.create("https://curseforge.com/minecraft/mc-mods/yacl")))
21-
.applyFormats(ChatFormatting.BLUE, ChatFormatting.UNDERLINE)),
22-
Component.literal(".minecraft/config/debugify.json").withStyle(style -> style
23-
.withClickEvent(new ClickEvent.OpenFile(FabricLoader.getInstance().getConfigDir()))
24-
.applyFormats(ChatFormatting.BLUE, ChatFormatting.UNDERLINE)))
25-
);
26-
}
19+
public NoYACLScreen(Screen parent) {
20+
super(
21+
() -> Minecraft.getInstance().gui.setScreen(parent),
22+
Component.translatable("debugify.no_yacl.title").withStyle(ChatFormatting.BOLD),
23+
Component.translatable("debugify.no_yacl.description",
24+
Component.literal("YetAnotherConfigLib").withStyle(style -> style
25+
.withClickEvent(new ClickEvent.OpenUrl(URI.create("https://curseforge.com/minecraft/mc-mods/yacl")))
26+
.applyFormats(ChatFormatting.BLUE, ChatFormatting.UNDERLINE)),
27+
Component.literal(".minecraft/config/debugify.json").withStyle(style -> style
28+
.withClickEvent(new ClickEvent.OpenFile(FabricLoader.getInstance().getConfigDir()))
29+
.applyFormats(ChatFormatting.BLUE, ChatFormatting.UNDERLINE)))
30+
);
31+
}
2732
}
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2026 The Debugify Contributors
3+
*
4+
* SPDX-License-Identifier: LGPL-3.0-or-later
5+
*/
16
package dev.isxander.debugify.client.helpers.mc118740;
27

38
/**
@@ -8,7 +13,7 @@
813
* @author Moulberry
914
*/
1015
public interface LocalPlayerDuck {
11-
float debugify$getVisualAttackStrengthScale(float partialTick);
12-
void debugify$resetVisualAttackStrengthScale();
13-
void debugify$incrementVisualAttackStrengthScale();
16+
float debugify$getVisualAttackStrengthScale(float partialTick);
17+
void debugify$resetVisualAttackStrengthScale();
18+
void debugify$incrementVisualAttackStrengthScale();
1419
}

0 commit comments

Comments
 (0)