Skip to content

Commit 05e7352

Browse files
committed
Invert heartFlash
1 parent 4bfc998 commit 05e7352

File tree

5 files changed

+31
-29
lines changed

5 files changed

+31
-29
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@
5555

5656
#### General
5757

58+
- Refactored a lot of settings to be reversed of what they were before
59+
- If all settings are disabled should now result in vanilla behaviour
5860
- Simplified a ton of settings (Combined stuff like Sneaking Settings/Fishing Rod Version)
5961

6062
### Server
6163

6264
- Current config info is now sent inside the "info" payload (README for documentation)
6365
- Info payload now sends on server join instead of having to be requested, similar to how it originally was but better
6466
now
65-
- During PLAY JOIN
67+
- During PLAY (JOIN) state

src/main/java/org/visuals/legacy/animatium/config/category/ScreenConfigCategory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
public class ScreenConfigCategory extends Category {
3434
public CameraVersion cameraVersion = CameraVersion.V1_8;
3535
public boolean crosshairInThirdPerson = true;
36-
public boolean heartFlash = true;
36+
public boolean disableHeartFlash = true;
3737
public boolean centerScrollableListWidgets = true;
3838
public boolean listWidgetSelectedBorderColor = true;
3939
public boolean legacyButtonHoverTextColor = true;
@@ -67,7 +67,7 @@ public EntryBundle bundle() {
6767

6868
bundle.enumEntry("cameraVersion", CameraVersion.class);
6969
bundle.booleanEntry("crosshairInThirdPerson");
70-
bundle.booleanEntry("heartFlash");
70+
bundle.booleanEntry("disableHeartFlash");
7171
bundle.booleanEntry("centerScrollableListWidgets");
7272
bundle.booleanEntry("listWidgetSelectedBorderColor");
7373
bundle.booleanEntry("legacyButtonHoverTextColor");

src/main/java/org/visuals/legacy/animatium/mixins/v1/gui/MixinInGameHud.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@
4141

4242
@Mixin(Gui.class)
4343
public abstract class MixinInGameHud {
44-
@WrapOperation(method = "renderCrosshair", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/CameraType;isFirstPerson()Z"))
45-
private boolean animatium$crosshairInThirdPerson(CameraType instance, Operation<Boolean> original) {
46-
if (Animatium.isEnabled() && AnimatiumConfig.instance().screen.crosshairInThirdPerson) {
47-
return true;
48-
} else {
49-
return original.call(instance);
50-
}
51-
}
44+
@WrapOperation(method = "renderCrosshair", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/CameraType;isFirstPerson()Z"))
45+
private boolean animatium$crosshairInThirdPerson(CameraType instance, Operation<Boolean> original) {
46+
if (Animatium.isEnabled() && AnimatiumConfig.instance().screen.crosshairInThirdPerson) {
47+
return true;
48+
} else {
49+
return original.call(instance);
50+
}
51+
}
5252

53-
@WrapWithCondition(method = "renderCrosshair", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 2))
54-
private boolean animatium$fixHighAttackSpeedIndicator(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l, @Local float f) {
55-
if (AnimatiumConfig.instance().fixes.fixHighAttackSpeedIndicator) {
56-
return (int) (f * 17.0F) != 0;
57-
} else {
58-
return true;
59-
}
60-
}
53+
@WrapWithCondition(method = "renderCrosshair", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 2))
54+
private boolean animatium$fixHighAttackSpeedIndicator(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l, @Local float f) {
55+
if (AnimatiumConfig.instance().fixes.fixHighAttackSpeedIndicator) {
56+
return (int) (f * 17.0F) != 0;
57+
} else {
58+
return true;
59+
}
60+
}
6161

62-
@WrapWithCondition(method = "renderHearts", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/Gui;renderHeart(Lnet/minecraft/client/gui/GuiGraphics;Lnet/minecraft/client/gui/Gui$HeartType;IIZZZ)V"))
63-
private boolean animatium$heartFlash(Gui instance, GuiGraphics guiGraphics, Gui.HeartType type, int x, int y, boolean hardcore, boolean blinking, boolean half) {
64-
return !Animatium.isEnabled() || AnimatiumConfig.instance().screen.heartFlash || !blinking || type == Gui.HeartType.CONTAINER;
65-
}
62+
@WrapWithCondition(method = "renderHearts", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/Gui;renderHeart(Lnet/minecraft/client/gui/GuiGraphics;Lnet/minecraft/client/gui/Gui$HeartType;IIZZZ)V"))
63+
private boolean animatium$heartFlash(Gui instance, GuiGraphics guiGraphics, Gui.HeartType type, int x, int y, boolean hardcore, boolean blinking, boolean half) {
64+
return !Animatium.isEnabled() || !AnimatiumConfig.instance().screen.disableHeartFlash || !blinking || type == Gui.HeartType.CONTAINER;
65+
}
6666
}

src/main/java/org/visuals/legacy/animatium/util/config/Version.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public enum Version {
8787

8888
final ScreenConfigCategory screen = config.screen;
8989
screen.crosshairInThirdPerson = true;
90-
screen.heartFlash = true;
90+
screen.disableHeartFlash = true;
9191
screen.centerScrollableListWidgets = true;
9292
screen.listWidgetSelectedBorderColor = true;
9393
screen.legacyButtonHoverTextColor = true;
@@ -192,7 +192,7 @@ public enum Version {
192192

193193
final ScreenConfigCategory screen = config.screen;
194194
screen.crosshairInThirdPerson = true;
195-
screen.heartFlash = false;
195+
screen.disableHeartFlash = false;
196196
screen.centerScrollableListWidgets = false;
197197
screen.listWidgetSelectedBorderColor = true;
198198
screen.legacyButtonHoverTextColor = true;
@@ -311,7 +311,7 @@ public enum Version {
311311

312312
final ScreenConfigCategory screen = config.screen;
313313
screen.crosshairInThirdPerson = false;
314-
screen.heartFlash = false;
314+
screen.disableHeartFlash = false;
315315
screen.centerScrollableListWidgets = false;
316316
screen.listWidgetSelectedBorderColor = false;
317317
screen.legacyButtonHoverTextColor = false;

src/main/resources/assets/animatium/lang/en_us.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
"animatium.enum.CameraVersion.V1_8": "1.8 and below",
4949
"animatium.crosshairInThirdPerson": "[1.8] Show crosshair in third-person",
5050
"animatium.crosshairInThirdPerson.description": "Show crosshair whilst in thirdperson like in <=1.8.x.",
51-
"animatium.heartFlash": "[1.7] Toggle hearts flashing when taking damage",
52-
"animatium.heartFlash.description": "Enable/disable heart blinking like in <=1.7.x.",
51+
"animatium.disableHeartFlash": "[1.7] Disable hearts flashing when taking damage",
52+
"animatium.disableHeartFlash.description": "Disables the heart texture blinking like in <=1.7.x.",
5353
"animatium.centerScrollableListWidgets": "[1.7] Center scrollable list widgets",
5454
"animatium.centerScrollableListWidgets.description": "Center scrollable list widgets like <=1.7.x.",
5555
"animatium.listWidgetSelectedBorderColor": "[1.15] List widget selected border color",
@@ -241,7 +241,7 @@
241241
"animatium.oldCloudRendering.description": "Brings back the recently-old cloud rendering from <=1.21.5.",
242242
"animatium.alwaysSteveModel": "[1.7] Always Steve Model",
243243
"animatium.alwaysSteveModel.description": "Forces all player models to be the steve type like in <=1.7.x.",
244-
"animatium.fastGrass": "[1.7] Fast Grass",
244+
"animatium.fastGrass": "[1.7-fast] Fast Grass",
245245
"animatium.fastGrass.description": "Brings back the non-biome-tinted grass side texture from <=1.7.x.",
246246
"animatium.oldY0Height": "[1.16] Old Y0 Height",
247247
"animatium.oldY0Height.description": "Changes the minY of the world back to 0 like it was in <=1.16.5.",

0 commit comments

Comments
 (0)