Skip to content

Commit db2343b

Browse files
committed
Added Lowfire
1 parent 45e636c commit db2343b

File tree

12 files changed

+113
-9
lines changed

12 files changed

+113
-9
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ org.gradle.jvmargs=-Xmx1G
33
org.gradle.parallel=true
44

55
# SimpleClient
6-
simpleclient_version=0.1.4
6+
simpleclient_version=0.1.5

simpleclient-1.19.4/src/main/java/simpleclient/feature/FeatureManagerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ public void init() {
1818
});
1919
addFeature(new FPS());
2020
addFeature(new Fullbright());
21+
addFeature(new Lowfire());
22+
addFeature(new Motionblur());
2123
addFeature(new PerformanceBoost());
2224
addFeature(new Ping());
23-
addFeature(new Motionblur());
2425
addFeature(new Zoom());
2526
super.init();
2627
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package simpleclient.feature;
2+
3+
import com.google.gson.JsonObject;
4+
import net.minecraft.network.chat.Component;
5+
import simpleclient.feature.config.FloatConfigEntry;
6+
7+
public class Lowfire extends EnableableFeature {
8+
public static boolean ENABLED = false;
9+
public static float HEIGHT = 0;
10+
private final FloatConfigEntry height = new FloatConfigEntry("height", Component.translatable("simpleclient.lowfire.height"), 0.25F, value -> Component.literal(String.valueOf((float) (int) (value * 200 - 50) / 100)));
11+
12+
public Lowfire() {
13+
super(FeatureType.LOWFIRE);
14+
addConfigEntry(height);
15+
refresh();
16+
}
17+
18+
public void refresh() {
19+
ENABLED = isEnabled();
20+
HEIGHT = getConfigValue(height);
21+
}
22+
23+
@Override
24+
public void setData(JsonObject data) {
25+
super.setData(data);
26+
refresh();
27+
}
28+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package simpleclient.mixin;
2+
3+
import com.mojang.blaze3d.vertex.PoseStack;
4+
import net.minecraft.client.Minecraft;
5+
import net.minecraft.client.renderer.ScreenEffectRenderer;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.injection.At;
8+
import org.spongepowered.asm.mixin.injection.Inject;
9+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10+
import simpleclient.feature.Lowfire;
11+
12+
@Mixin(ScreenEffectRenderer.class)
13+
public class ScreenEffectRendererMixin {
14+
@Inject(at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;translate(FFF)V"), method = "renderFire")
15+
private static void onRenderFireOverlay(Minecraft minecraft, PoseStack poseStack, CallbackInfo ci) {
16+
if (Lowfire.ENABLED) poseStack.translate(0.0, Lowfire.HEIGHT * 1.75 - 0.5, 0.0);
17+
}
18+
}

simpleclient-1.19.4/src/main/resources/simpleclient.mixins.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
"mixins": [
77
],
88
"client": [
9-
"GameRendererMixin",
10-
"GuiMixin",
119
"performance.LevelRendererMixin",
1210
"performance.OptionsMixin",
1311
"performance.SharedConstantsMixin",
14-
"OptionsMixin"
12+
"GameRendererMixin",
13+
"GuiMixin",
14+
"OptionsMixin",
15+
"ScreenEffectRendererMixin"
1516
],
1617
"injectors": {
1718
"defaultRequire": 1

simpleclient-1.20/src/main/java/simpleclient/feature/FeatureManagerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ public void init() {
1818
});
1919
addFeature(new FPS());
2020
addFeature(new Fullbright());
21+
addFeature(new Lowfire());
22+
addFeature(new Motionblur());
2123
addFeature(new PerformanceBoost());
2224
addFeature(new Ping());
23-
addFeature(new Motionblur());
2425
addFeature(new Zoom());
2526
super.init();
2627
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package simpleclient.feature;
2+
3+
import com.google.gson.JsonObject;
4+
import ladysnake.satin.api.event.ShaderEffectRenderCallback;
5+
import ladysnake.satin.api.managed.ManagedShaderEffect;
6+
import ladysnake.satin.api.managed.ShaderEffectManager;
7+
import net.minecraft.network.chat.Component;
8+
import net.minecraft.resources.ResourceLocation;
9+
import simpleclient.feature.config.FloatConfigEntry;
10+
import simpleclient.feature.config.PercentConfigEntry;
11+
12+
public class Lowfire extends EnableableFeature {
13+
public static boolean ENABLED = false;
14+
public static float HEIGHT = 0;
15+
private final FloatConfigEntry height = new FloatConfigEntry("height", Component.translatable("simpleclient.lowfire.height"), 0.25F, value -> Component.literal(String.valueOf((float) (int) (value * 200 - 50) / 100)));
16+
17+
public Lowfire() {
18+
super(FeatureType.LOWFIRE);
19+
addConfigEntry(height);
20+
refresh();
21+
}
22+
23+
public void refresh() {
24+
ENABLED = isEnabled();
25+
HEIGHT = getConfigValue(height);
26+
}
27+
28+
@Override
29+
public void setData(JsonObject data) {
30+
super.setData(data);
31+
refresh();
32+
}
33+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package simpleclient.mixin;
2+
3+
import com.mojang.blaze3d.vertex.PoseStack;
4+
import net.minecraft.client.Minecraft;
5+
import net.minecraft.client.renderer.ScreenEffectRenderer;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.injection.At;
8+
import org.spongepowered.asm.mixin.injection.Inject;
9+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10+
import simpleclient.feature.Lowfire;
11+
12+
@Mixin(ScreenEffectRenderer.class)
13+
public class ScreenEffectRendererMixin {
14+
@Inject(at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;translate(FFF)V"), method = "renderFire")
15+
private static void onRenderFireOverlay(Minecraft minecraft, PoseStack poseStack, CallbackInfo ci) {
16+
if (Lowfire.ENABLED) poseStack.translate(0.0, Lowfire.HEIGHT * 1.75 - 0.5, 0.0);
17+
}
18+
}

simpleclient-1.20/src/main/resources/simpleclient.mixins.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
"mixins": [
77
],
88
"client": [
9-
"GameRendererMixin",
10-
"GuiMixin",
119
"performance.LevelRendererMixin",
1210
"performance.OptionsMixin",
1311
"performance.SharedConstantsMixin",
14-
"OptionsMixin"
12+
"GameRendererMixin",
13+
"GuiMixin",
14+
"OptionsMixin",
15+
"ScreenEffectRendererMixin"
1516
],
1617
"injectors": {
1718
"defaultRequire": 1

simpleclient-core/src/main/java/simpleclient/feature/FeatureType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
public enum FeatureType {
44
FPS("fps", "FPS"),
55
FULLBRIGHT("fullbright", "Fullbright"),
6+
LOWFIRE("lowfire", "Lowfire"),
67
PERFORMANCE_BOOST("performance_boost", "Performance Boost"),
78
PING("ping", "Ping"),
89
MOTIONBLUR("motionblur", "Motionblur"),

0 commit comments

Comments
 (0)