Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'fabric-loom' version '1.14-SNAPSHOT'
id 'maven-publish'
}

Expand Down Expand Up @@ -46,7 +46,7 @@ processResources {
}
}

def targetJavaVersion = 17
def targetJavaVersion = 21
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
Expand All @@ -58,12 +58,15 @@ tasks.withType(JavaCompile).configureEach {
}
}

base {
archivesName.set(property("archives_base_name").toString())
}

java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
archivesBaseName = project.archives_base_name
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
Expand All @@ -72,7 +75,7 @@ java {

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
rename { "${it}_${base.archivesName.get()}"}
}
}

Expand All @@ -91,4 +94,4 @@ publishing {
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
}
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.18
minecraft_version=1.21.2
yarn_mappings=1.21.2+build.1
loader_version=0.18.1

# Mod Properties
mod_version = 1.3
mod_version = 1.3.1
maven_group = dev.drtheo
archives_base_name = sneaky

# Dependencies
modmenu_version=6.1.0-rc.4
cloth_version=10.0.96
modmenu_version=10.0.0
cloth_version=14.0.139
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
public class ClientPlayerEntityMixin {

@Shadow public Input input;

@Shadow @Final protected MinecraftClient client;
@Unique private boolean stickySneak = false;

@Unique private int sneakTime = 0;

/**
Expand All @@ -27,7 +25,7 @@ public class ClientPlayerEntityMixin {
@Overwrite
public boolean isSneaking() {
boolean shouldSneak = ((IMinecraftClientMixin) this.client).sneaky$shouldSneak();
boolean isSneaking = this.input != null && this.input.sneaking;
boolean isSneaking = this.input != null && this.input.playerInput.sneak();

if (SneakyConfig.shouldKeepSneak() && shouldSneak)
this.stickySneak = true;
Expand All @@ -46,10 +44,10 @@ public void tickMovement(CallbackInfo ci) {
if (this.input == null)
return;

if (this.input.sneaking) {
if (this.input.playerInput.sneak()) {
this.sneakTime += 1;
} else {
this.sneakTime = 0;
}
}
}
}