Skip to content

Commit b9dc38d

Browse files
committed
1.21.8
Signed-off-by: CyberFlame <cyberflameu@gmail.com>
1 parent 5592d65 commit b9dc38d

File tree

9 files changed

+25
-16
lines changed

9 files changed

+25
-16
lines changed

.idea/compiler.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/viewmodel-changer.main.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/viewmodel-changer.test.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Minecraft_Server.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.11.8'
2+
id 'fabric-loom' version '1.11-SNAPSHOT'
33
id 'maven-publish'
44
// id 'io.sentry.jvm.gradle' version '3.11.1'
55
}

gradle.properties

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# suppress inspection "AlphaUnsortedPropertiesFile" for whole file
22
# Done to increase the memory available to gradle.
33
org.gradle.jvmargs=-Xmx4G
4+
45
# Fabric Properties
56
# check these on https://modmuss50.me/fabric.html
6-
minecraft_version=1.21.5
7-
yarn_mappings=1.21.5+build.1
8-
loader_version=0.16.14
7+
minecraft_version=1.21.8
8+
yarn_mappings=1.21.8+build.1
9+
loader_version=0.17.2
910
# Mod Properties
10-
mod_version=1.10.6
11+
mod_version=1.10.7
1112
maven_group=net.cyberflame
1213
archives_base_name=viewmodel
1314
# Dependencies
1415
# check this on https://modmuss50.me/fabric.html
15-
fabric_version=0.124.0+1.21.5
16+
fabric_version=0.133.4+1.21.8

src/main/java/net/cyberflame/viewmodel/gui/Slider.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,17 @@ private static float round(float value) {
3434

3535
@Override
3636
public final void mouseScrolled(double mx, double my, float incx, float incy) {
37-
float inc = Math.max(incx, incy);
38-
this.setting.setValue(MathHelper.clamp(this.setting.getValue() + inc * 0.1F, this.min, this.max));
37+
// Prefer the axis with the larger magnitude (so negatives are preserved)
38+
float delta = Math.abs(incx) >= Math.abs(incy) ? incx : incy;
39+
if (delta == 0f) return;
40+
41+
// If your scroll direction feels inverted, uncomment the next line:
42+
// delta = -delta;
43+
44+
this.setting.setValue(MathHelper.clamp(this.setting.getValue() + delta * 0.1f, this.min, this.max));
3945
}
4046

47+
4148
@Override
4249
public final void mouseClicked(double mx, double my) {
4350
this.setting.setValue(this.min + (float) ((this.max - this.min) / this.width * (mx - this.x)));

src/main/java/net/cyberflame/viewmodel/gui/ViewmodelScreen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public ViewmodelScreen() {
2424

2525
@Override
2626
public final void init() {
27+
this.objs.clear();
2728
List<Setting<?>> settingsList = Viewmodel.getSettings();
2829
range(0, settingsList.size()).forEachOrdered(i -> {
2930
var setting = settingsList.get(i);
@@ -33,7 +34,7 @@ public final void init() {
3334

3435
@Override
3536
public final void render(DrawContext context, int mouseX, int mouseY, float delta) {
36-
this.renderBackground(context, mouseX, mouseY, delta);
37+
context.fill(0, 0, this.width, this.height, 0xAA000000); // semi-transparent black
3738
this.objs.forEach(obj -> obj.render(context, mouseX, mouseY));
3839
}
3940

src/main/resources/fabric.mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"viewmodel.mixins.json"
2424
],
2525
"depends": {
26-
"fabricloader": ">=0.15.1",
27-
"minecraft": "~1.21.5",
26+
"fabricloader": ">=0.17.2",
27+
"minecraft": "~1.21.8",
2828
"java": ">=21",
2929
"fabric-api": "*",
3030
"fabric-key-binding-api-v1": "*"

0 commit comments

Comments
 (0)