Skip to content

Commit c8b3790

Browse files
committed
chore: bump 26.3 to snapshot-4
GLFW → SDL
1 parent 71822ff commit c8b3790

8 files changed

Lines changed: 27 additions & 12 deletions

File tree

common/src/main/java/net/xolt/freecam/config/ModBindings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
import java.util.stream.Stream;
1515

1616
import static net.xolt.freecam.config.keys.FreecamKeyMappingBuilder.builder;
17-
import static org.lwjgl.glfw.GLFW.GLFW_KEY_F4;
17+
import static org.lwjgl.sdl.SDLScancode.SDL_SCANCODE_F4;
1818

1919
public enum ModBindings {
2020

2121
KEY_TOGGLE(() -> builder("toggle")
2222
.action(Freecam::toggle)
2323
.holdAction(Freecam::activateTripodHandler)
24-
.defaultKey(GLFW_KEY_F4)
24+
.defaultKey(SDL_SCANCODE_F4)
2525
.build()),
2626
KEY_CONTROL_PLAYER(() -> builder("controlPlayer.toggle")
2727
.action(Freecam::switchControls)

common/src/main/java/net/xolt/freecam/config/keys/FreecamKeyMappingBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import com.mojang.blaze3d.platform.InputConstants;
44

5-
import static org.lwjgl.glfw.GLFW.GLFW_KEY_UNKNOWN;
5+
import static org.lwjgl.sdl.SDLScancode.SDL_SCANCODE_UNKNOWN;
66

77
public class FreecamKeyMappingBuilder {
88
private final String translationKey;
9-
private InputConstants.Type type = InputConstants.Type.KEYSYM;
10-
private int keyCode = GLFW_KEY_UNKNOWN;
9+
private InputConstants.Type type = InputConstants.Type.KEYBOARD;
10+
private int keyCode = SDL_SCANCODE_UNKNOWN;
1111
private Runnable action;
1212
private HoldAction holdAction;
1313
private long maxTicks = 10;

common/src/main/java/net/xolt/freecam/tripod/TripodSlot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package net.xolt.freecam.tripod;
22

3-
import static org.lwjgl.glfw.GLFW.GLFW_KEY_0;
3+
import static org.lwjgl.sdl.SDLScancode.SDL_SCANCODE_0;
44

55
public enum TripodSlot {
66
NONE, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE;
@@ -25,7 +25,7 @@ public static TripodSlot valueOf(int number) throws IndexOutOfBoundsException {
2525
}
2626

2727
public static TripodSlot ofKeyCode(int keyCode) {
28-
int number = keyCode - GLFW_KEY_0;
28+
int number = keyCode - SDL_SCANCODE_0;
2929
return inRange(number) ? valueOfUnsafe(number) : NONE;
3030
}
3131

common/src/main/java/net/xolt/freecam/util/FreeCamera.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ public MobEffectInstance getEffect(@NotNull Holder<MobEffect> effect) {
191191
// Prevents pistons from moving FreeCamera when collision.ignoreAll is enabled.
192192
@Override
193193
public @NotNull PushReaction getPistonPushReaction() {
194-
return ModConfig.get().ignoreAllCollision() ? PushReaction.IGNORE : PushReaction.NORMAL;
194+
if (ModConfig.get().ignoreAllCollision()) {
195+
//~ if >=26.3-0 IGNORE -> IGNORE_ENTITY
196+
return PushReaction.IGNORE_ENTITY;
197+
}
198+
return super.getPistonPushReaction();
195199
}
196200

197201
// Prevents collision with solid entities (shulkers, boats)

fabric/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ dependencies {
5858
exclude(module = "fabric-loader")
5959
}
6060

61-
modImplementation("com.terraformersmc:modmenu:${meta.deps["modmenu"]}") {
61+
create("com.terraformersmc:modmenu:${meta.deps["modmenu"]}") {
6262
exclude(module = "fabric-loader")
63+
}.let {
64+
// FIXME: compile only until a 26.3 build is available
65+
// Consider fetching via JitPack
66+
if (sc.current.parsed >= "26.3-0") modCompileOnly(it)
67+
else modImplementation(it)
6368
}
6469

6570
sc.node.sibling("cloth-config")?.let {

stonecutter.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ stonecutter parameters {
6565
}
6666

6767
replacements {
68+
string(current.parsed >= "26.3-0") {
69+
replace("InputConstants.Type.KEYSYM", "InputConstants.Type.KEYBOARD")
70+
replace("org.lwjgl.glfw.GLFW.GLFW_KEY_", "org.lwjgl.sdl.SDLScancode.SDL_SCANCODE_")
71+
replace("GLFW_KEY_", "SDL_SCANCODE_")
72+
}
6873
string(current.parsed >= "26.2") {
6974
replace("renderHandsWithItems", "submitHandsWithItems")
7075
}

stonecutter.properties.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Fabric: https://fabricmc.net/develop
1414
# NeoForge: https://projects.neoforged.net/neoforged/neoforge
1515
# Cloth Config: https://maven.shedaniel.me/me/shedaniel/cloth/cloth-config-fabric
16-
# ModMenu: https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu
16+
# ModMenu: https://maven.terraformersmc.com/#browse/browse:maven-terraformers:com%2Fterraformersmc%2Fmodmenu
1717

1818

1919
[relationship]
@@ -33,9 +33,10 @@ reqs.mc = "26.3.x-0"
3333

3434
deps.cloth = "26.2.155"
3535
reqs.cloth = "~26.3"
36+
# TODO: https://github.com/TerraformersMC/ModMenu/pull/1054
3637
deps.modmenu = "20.0.1"
3738

38-
deps.fabric_api = "0.154.3+26.3"
39+
deps.fabric_api = "0.155.1+26.3"
3940
reqs.fabric_loader = ">=0.18.0"
4041

4142
deps.neoforge_pr = ""

stonecutter.settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ vcs = "26.3"
66

77
# Gradle projects to build for the corresponding Minecraft version.
88
[versions]
9-
"26.3:26.3-snapshot-3" = ["common", "fabric"]
9+
"26.3:26.3-snapshot-4" = ["common", "fabric"]
1010
"26.2" = ["cloth-config", "common", "fabric", "neoforge"]
1111
"26.1:26.1.2" = ["cloth-config", "common", "fabric", "neoforge"]
1212
"1.21.11" = ["cloth-config", "common", "fabric", "neoforge"]

0 commit comments

Comments
 (0)