Skip to content

Commit

Permalink
Change flame height (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
LifeIsAParadox authored Oct 18, 2023
1 parent 00340f5 commit 38f3ec2
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ public static class General {
@SerialEntry
public TeleportOverlay teleportOverlay = new TeleportOverlay();

@SerialEntry
public FlameOverlay flameOverlay = new FlameOverlay();

@SerialEntry
public List<Integer> lockedSlots = new ArrayList<>();

Expand Down Expand Up @@ -391,6 +394,14 @@ public static class TeleportOverlay {
public boolean enableWitherImpact = true;
}

public static class FlameOverlay {
@SerialEntry
public float flameHeight = 0f;

@SerialEntry
public float flameOpacity = 0f;
}

public enum Direction {
HORIZONTAL, VERTICAL;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,26 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig
.controller(ConfigUtils::createBooleanController)
.build())
.build())

//Flame Overlay
.group(OptionGroup.createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.flameOverlay"))
.collapsed(true)
.option(Option.<Float>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.flameOverlay.flameHeight"))
.binding(defaults.general.flameOverlay.flameHeight,
() -> config.general.flameOverlay.flameHeight,
newValue -> config.general.flameOverlay.flameHeight = newValue)
.controller(opt -> FloatSliderControllerBuilder.create(opt).range(0.0f, 0.5f).step(0.01f))
.build())
.option(Option.<Float>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.flameOverlay.flameOpacity"))
.binding(defaults.general.flameOverlay.flameOpacity,
() -> config.general.flameOverlay.flameOpacity,
newValue -> config.general.flameOverlay.flameOpacity = newValue)
.controller(opt -> FloatSliderControllerBuilder.create(opt).range(0.0f, 0.8f).step(0.1f))
.build())
.build())
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package de.hysky.skyblocker.mixin;

import de.hysky.skyblocker.config.SkyblockerConfigManager;
import net.minecraft.client.gui.hud.InGameOverlayRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

@Mixin(InGameOverlayRenderer.class)
public class InGameOverlayRendererMixin {

@ModifyArg(method = "renderFireOverlay", index = 2, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/BufferBuilder;vertex(Lorg/joml/Matrix4f;FFF)Lnet/minecraft/client/render/VertexConsumer;"))
private static float configureFlameHeight(float y) {
return y - SkyblockerConfigManager.get().general.flameOverlay.flameHeight;
}

@ModifyArg(method = "renderFireOverlay", index = 3, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/VertexConsumer;color(FFFF)Lnet/minecraft/client/render/VertexConsumer;"))
private static float configureFlameOpacity(float opacity) {
return opacity - SkyblockerConfigManager.get().general.flameOverlay.flameOpacity;
}

}
3 changes: 3 additions & 0 deletions src/main/resources/assets/skyblocker/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
"text.autoconfig.skyblocker.option.general.teleportOverlay.enableEtherTransmission": "Enable Ether Transmission Overlay",
"text.autoconfig.skyblocker.option.general.teleportOverlay.enableSinrecallTransmission": "Enable Sinrecall Transmission Overlay",
"text.autoconfig.skyblocker.option.general.teleportOverlay.enableWitherImpact": "Enable Wither Impact Overlay",
"text.autoconfig.skyblocker.option.general.flameOverlay": "Flame Overlay",
"text.autoconfig.skyblocker.option.general.flameOverlay.flameHeight": "Flame Height",
"text.autoconfig.skyblocker.option.general.flameOverlay.flameOpacity": "Flame Opacity",
"skyblocker.itemTooltip.nullMessage": "§b[§6Skyblocker§b] §cItem price information on tooltip will renew in max 60 seconds. If not, check latest.log",
"skyblocker.itemTooltip.noData": "§cNo Data",

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/skyblocker.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"GenericContainerScreenHandlerMixin",
"HandledScreenMixin",
"InGameHudMixin",
"InGameOverlayRendererMixin",
"InventoryScreenMixin",
"ItemMixin",
"ItemStackMixin",
Expand Down

0 comments on commit 38f3ec2

Please sign in to comment.