Skip to content

Commit 4ba36af

Browse files
committed
refactor
1 parent fe641ed commit 4ba36af

31 files changed

Lines changed: 318 additions & 303 deletions

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build mod jar
22

3-
on: [workflow_dispatch, push]
3+
on: [ workflow_dispatch, push ]
44

55
permissions:
66
contents: read

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ You can obtain Celeritas from this AutoBuild repository maintained by kappa-main
1212

1313
## Description
1414

15-
Celeritas Extra is a comprehensive unofficial backport of Sodium Extra/Embeddium Extra, specifically targeting Celeritas 1.12.2, along with several additional features.
15+
Celeritas Extra is a comprehensive unofficial backport of Sodium Extra/Embeddium Extra, specifically targeting Celeritas
16+
1.12.2, along with several additional features.
1617

1718
## Requirements
1819

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'maven-publish'
55
id 'com.gradleup.shadow' version '9.3.0'
66
id 'xyz.wagyourtail.unimined' version '1.4.10-kappa'
7-
id 'net.kyori.blossom' version '2.2.0'
7+
id 'net.kyori.blossom' version '2.2.0'
88
}
99

1010
apply from: 'gradle/scripts/helpers.gradle'

src/main/java/jp/s12kuma01/celeritasextra/CeleritasExtraMod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.taumc.celeritas.api.OptionGUIConstructionEvent;
1111

1212
@Mod(modid = CeleritasExtraMod.MOD_ID, name = CeleritasExtraMod.MOD_NAME, version = CeleritasExtraMod.VERSION,
13-
clientSideOnly = true, acceptableRemoteVersions = "*")
13+
clientSideOnly = true, acceptableRemoteVersions = "*")
1414
public class CeleritasExtraMod {
1515
public static final String MOD_ID = "celeritasextra";
1616
public static final String MOD_NAME = "Celeritas Extra";

src/main/java/jp/s12kuma01/celeritasextra/client/gui/CeleritasExtraGameOptionPages.java

Lines changed: 73 additions & 73 deletions
Large diffs are not rendered by default.

src/main/java/jp/s12kuma01/celeritasextra/client/gui/CeleritasExtraGameOptions.java

Lines changed: 84 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -19,71 +19,12 @@ public class CeleritasExtraGameOptions {
1919
private static final String CAT_DETAIL = "detail";
2020
private static final String CAT_RENDER = "render";
2121
private static final String CAT_EXTRA = "extra";
22-
23-
/**
24-
* Overlay corner positions for FPS/coordinate display
25-
*/
26-
public enum OverlayCorner {
27-
TOP_LEFT("celeritasextra.option.overlay_corner.top_left"),
28-
TOP_RIGHT("celeritasextra.option.overlay_corner.top_right"),
29-
BOTTOM_LEFT("celeritasextra.option.overlay_corner.bottom_left"),
30-
BOTTOM_RIGHT("celeritasextra.option.overlay_corner.bottom_right");
31-
32-
private final String translationKey;
33-
34-
OverlayCorner(String translationKey) {
35-
this.translationKey = translationKey;
36-
}
37-
38-
public String getLocalizedName() {
39-
return I18n.format(this.translationKey);
40-
}
41-
}
42-
43-
/**
44-
* Text contrast options for overlay readability
45-
*/
46-
public enum TextContrast {
47-
NONE("celeritasextra.option.text_contrast.none"),
48-
BACKGROUND("celeritasextra.option.text_contrast.background"),
49-
SHADOW("celeritasextra.option.text_contrast.shadow");
50-
51-
private final String translationKey;
52-
53-
TextContrast(String translationKey) {
54-
this.translationKey = translationKey;
55-
}
56-
57-
public String getLocalizedName() {
58-
return I18n.format(this.translationKey);
59-
}
60-
}
61-
62-
/**
63-
* Fog type options for mod compatibility
64-
*/
65-
public enum FogType {
66-
DEFAULT("celeritasextra.option.fog_type.default"),
67-
OFF("celeritasextra.option.fog_type.off");
68-
69-
private final String translationKey;
70-
71-
FogType(String translationKey) {
72-
this.translationKey = translationKey;
73-
}
74-
75-
public String getLocalizedName() {
76-
return I18n.format(this.translationKey);
77-
}
78-
}
79-
80-
private Configuration config;
81-
8222
public final AnimationSettings animationSettings = new AnimationSettings();
8323
public final ParticleSettings particleSettings = new ParticleSettings();
8424
public final DetailSettings detailSettings = new DetailSettings();
8525
public final RenderSettings renderSettings = new RenderSettings();
8626
public final ExtraSettings extraSettings = new ExtraSettings();
27+
private Configuration config;
8728

8829
public static CeleritasExtraGameOptions load(File file) {
8930
CeleritasExtraGameOptions options = new CeleritasExtraGameOptions();
@@ -273,6 +214,63 @@ public void writeChanges() {
273214
config.save();
274215
}
275216

217+
/**
218+
* Overlay corner positions for FPS/coordinate display
219+
*/
220+
public enum OverlayCorner {
221+
TOP_LEFT("celeritasextra.option.overlay_corner.top_left"),
222+
TOP_RIGHT("celeritasextra.option.overlay_corner.top_right"),
223+
BOTTOM_LEFT("celeritasextra.option.overlay_corner.bottom_left"),
224+
BOTTOM_RIGHT("celeritasextra.option.overlay_corner.bottom_right");
225+
226+
private final String translationKey;
227+
228+
OverlayCorner(String translationKey) {
229+
this.translationKey = translationKey;
230+
}
231+
232+
public String getLocalizedName() {
233+
return I18n.format(this.translationKey);
234+
}
235+
}
236+
237+
/**
238+
* Text contrast options for overlay readability
239+
*/
240+
public enum TextContrast {
241+
NONE("celeritasextra.option.text_contrast.none"),
242+
BACKGROUND("celeritasextra.option.text_contrast.background"),
243+
SHADOW("celeritasextra.option.text_contrast.shadow");
244+
245+
private final String translationKey;
246+
247+
TextContrast(String translationKey) {
248+
this.translationKey = translationKey;
249+
}
250+
251+
public String getLocalizedName() {
252+
return I18n.format(this.translationKey);
253+
}
254+
}
255+
256+
/**
257+
* Fog type options for mod compatibility
258+
*/
259+
public enum FogType {
260+
DEFAULT("celeritasextra.option.fog_type.default"),
261+
OFF("celeritasextra.option.fog_type.off");
262+
263+
private final String translationKey;
264+
265+
FogType(String translationKey) {
266+
this.translationKey = translationKey;
267+
}
268+
269+
public String getLocalizedName() {
270+
return I18n.format(this.translationKey);
271+
}
272+
}
273+
276274
// Settings classes
277275
public static class AnimationSettings {
278276
public boolean animation = true;
@@ -327,23 +325,37 @@ public boolean isParticleEnabled(int particleId) {
327325
if (!particles) return false;
328326

329327
switch (particleId) {
330-
case 0: case 1: case 2:
328+
case 0:
329+
case 1:
330+
case 2:
331331
return explosion;
332332
case 3:
333333
return fireworks;
334-
case 4: case 5: case 6: case 39:
334+
case 4:
335+
case 5:
336+
case 6:
337+
case 39:
335338
return water;
336-
case 7: case 8:
339+
case 7:
340+
case 8:
337341
return suspended;
338-
case 9: case 10:
342+
case 9:
343+
case 10:
339344
return crit;
340-
case 11: case 12:
345+
case 11:
346+
case 12:
341347
return smoke;
342-
case 13: case 14: case 15: case 16: case 17:
348+
case 13:
349+
case 14:
350+
case 15:
351+
case 16:
352+
case 17:
343353
return spell;
344-
case 18: case 19:
354+
case 18:
355+
case 19:
345356
return drip;
346-
case 20: case 21:
357+
case 20:
358+
case 21:
347359
return villager;
348360
case 22:
349361
return townAura;
@@ -353,13 +365,15 @@ public boolean isParticleEnabled(int particleId) {
353365
return portal;
354366
case 25:
355367
return enchantmentTable;
356-
case 26: case 27:
368+
case 26:
369+
case 27:
357370
return flame;
358371
case 29:
359372
return cloud;
360373
case 30:
361374
return redstone;
362-
case 31: case 32:
375+
case 31:
376+
case 32:
363377
return snowball;
364378
case 33:
365379
return slime;

src/main/java/jp/s12kuma01/celeritasextra/client/gui/CeleritasExtraHud.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ public static void onRenderOverlay(RenderGameOverlayEvent.Text event) {
8585

8686
// Calculate starting Y position based on corner
8787
boolean isBottom = corner == CeleritasExtraGameOptions.OverlayCorner.BOTTOM_LEFT ||
88-
corner == CeleritasExtraGameOptions.OverlayCorner.BOTTOM_RIGHT;
88+
corner == CeleritasExtraGameOptions.OverlayCorner.BOTTOM_RIGHT;
8989
boolean isRight = corner == CeleritasExtraGameOptions.OverlayCorner.TOP_RIGHT ||
90-
corner == CeleritasExtraGameOptions.OverlayCorner.BOTTOM_RIGHT;
90+
corner == CeleritasExtraGameOptions.OverlayCorner.BOTTOM_RIGHT;
9191

9292
int y = isBottom ? screenHeight - fontRenderer.FONT_HEIGHT - 2 : 2;
9393

src/main/java/jp/s12kuma01/celeritasextra/core/CeleritasExtraCore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* Core loading plugin for Celeritas Extra.
1010
* Required for early class loading to ensure mixins can be applied to Block classes.
11-
*
11+
* <p>
1212
* Note: MixinBooter's IEarlyMixinLoader is deprecated in CleanroomLoader.
1313
* Mixin configs are loaded via the MixinConfigs manifest attribute instead.
1414
*/

src/main/java/jp/s12kuma01/celeritasextra/mixin/animation/MixinTextureMap.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public abstract class MixinTextureMap {
3434
* Wrap the updateAnimation call on individual sprites to control which ones should animate
3535
*/
3636
@WrapOperation(
37-
method = "updateAnimations",
38-
at = @At(
39-
value = "INVOKE",
40-
target = "Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;updateAnimation()V"
41-
)
37+
method = "updateAnimations",
38+
at = @At(
39+
value = "INVOKE",
40+
target = "Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;updateAnimation()V"
41+
)
4242
)
4343
private void celeritasExtra$controlIndividualAnimations(TextureAtlasSprite sprite, Operation<Void> original) {
4444
// Check if animations are globally disabled
@@ -92,37 +92,37 @@ public abstract class MixinTextureMap {
9292

9393
// Water textures
9494
map.put(
95-
() -> CeleritasExtraClientMod.options().animationSettings.water,
96-
List.of("water_still", "water_flow")
95+
() -> CeleritasExtraClientMod.options().animationSettings.water,
96+
List.of("water_still", "water_flow")
9797
);
9898

9999
// Lava textures
100100
map.put(
101-
() -> CeleritasExtraClientMod.options().animationSettings.lava,
102-
List.of("lava_still", "lava_flow")
101+
() -> CeleritasExtraClientMod.options().animationSettings.lava,
102+
List.of("lava_still", "lava_flow")
103103
);
104104

105105
// Portal textures
106106
map.put(
107-
() -> CeleritasExtraClientMod.options().animationSettings.portal,
108-
List.of("portal")
107+
() -> CeleritasExtraClientMod.options().animationSettings.portal,
108+
List.of("portal")
109109
);
110110

111111
// Fire textures
112112
map.put(
113-
() -> CeleritasExtraClientMod.options().animationSettings.fire,
114-
List.of("fire_layer_0", "fire_layer_1")
113+
() -> CeleritasExtraClientMod.options().animationSettings.fire,
114+
List.of("fire_layer_0", "fire_layer_1")
115115
);
116116

117117
// Block animations (various animated blocks)
118118
map.put(
119-
() -> CeleritasExtraClientMod.options().animationSettings.blockAnimations,
120-
List.of(
121-
"magma",
122-
"sea_lantern",
123-
"prismarine",
124-
"kelp"
125-
)
119+
() -> CeleritasExtraClientMod.options().animationSettings.blockAnimations,
120+
List.of(
121+
"magma",
122+
"sea_lantern",
123+
"prismarine",
124+
"kelp"
125+
)
126126
);
127127

128128
return map;

src/main/java/jp/s12kuma01/celeritasextra/mixin/biome_colors/MixinBiomeColorHelper.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
/**
1111
* Biome color control - disable biome-specific colors
1212
* Port of embeddium-extra's biome_colors.MixinBiomeColors
13-
*
13+
* <p>
1414
* In 1.20.1: BiomeColors class
1515
* In 1.12.2: BiomeColorHelper class
16-
*
16+
* <p>
1717
* Default colors:
1818
* - Grass: 9551193 (0x91BD59)
1919
* - Water: 4159204 (0x3F76E4)
@@ -26,9 +26,9 @@ public class MixinBiomeColorHelper {
2626
* Override grass color with default value when biome colors are disabled
2727
*/
2828
@Inject(
29-
method = "getGrassColorAtPos",
30-
at = @At("RETURN"),
31-
cancellable = true
29+
method = "getGrassColorAtPos",
30+
at = @At("RETURN"),
31+
cancellable = true
3232
)
3333
private static void overrideGrassColor(CallbackInfoReturnable<Integer> cir) {
3434
if (!CeleritasExtraClientMod.options().detailSettings.biomeColors) {
@@ -40,9 +40,9 @@ private static void overrideGrassColor(CallbackInfoReturnable<Integer> cir) {
4040
* Override water color with default value when biome colors are disabled
4141
*/
4242
@Inject(
43-
method = "getWaterColorAtPos",
44-
at = @At("RETURN"),
45-
cancellable = true
43+
method = "getWaterColorAtPos",
44+
at = @At("RETURN"),
45+
cancellable = true
4646
)
4747
private static void overrideWaterColor(CallbackInfoReturnable<Integer> cir) {
4848
if (!CeleritasExtraClientMod.options().detailSettings.biomeColors) {
@@ -54,9 +54,9 @@ private static void overrideWaterColor(CallbackInfoReturnable<Integer> cir) {
5454
* Override foliage color with default value when biome colors are disabled
5555
*/
5656
@Inject(
57-
method = "getFoliageColorAtPos",
58-
at = @At("RETURN"),
59-
cancellable = true
57+
method = "getFoliageColorAtPos",
58+
at = @At("RETURN"),
59+
cancellable = true
6060
)
6161
private static void overrideFoliageColor(CallbackInfoReturnable<Integer> cir) {
6262
if (!CeleritasExtraClientMod.options().detailSettings.biomeColors) {

0 commit comments

Comments
 (0)