Skip to content

Commit

Permalink
1.20.6
Browse files Browse the repository at this point in the history
Updated for 1.20.6

When replacing totem, the mod now will first use the ones in your inventory instead of your hotbar.
  • Loading branch information
Qetrox committed Jun 11, 2024
1 parent 788e9be commit eaff6bb
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 18 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
}

Expand Down Expand Up @@ -30,14 +30,14 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
it.options.release = 21
}

java {
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

jar {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.2
loader_version=0.14.19
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.3
loader_version=0.15.11

# Mod Properties
mod_version = 1.0
mod_version = 1.1
maven_group = net.qlient
archives_base_name = autototem

# Dependencies
fabric_version=0.79.0+1.19.4
fabric_version=0.99.4+1.20.6
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 5 additions & 6 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -141,15 +144,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -194,10 +197,6 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/net/qlient/autototem/mixin/TotemMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ private void onTotemUse(ItemStack floatingItem, CallbackInfo ci) {
}

private int getTotemSlot(PlayerInventory inventory) {
for (int i = 0; i < inventory.main.size(); i++) {
for (int i = 9; i < inventory.main.size(); i++) { // Check inventory first
ItemStack stack = inventory.main.get(i);
if (!stack.isEmpty() && stack.getItem() == Items.TOTEM_OF_UNDYING) return i;
}
for(int i = 0; i < 9; i++) { // Check hotbar
ItemStack stack = inventory.main.get(i);
if (!stack.isEmpty() && stack.getItem() == Items.TOTEM_OF_UNDYING) return i;
}
Expand Down
Binary file modified src/main/resources/assets/autototem/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "autototem",
"version": "1.19.4",
"version": "1.1",

"name": "Auto Totem",
"description": "Replaces your totem when using one. (Offhand Only)",
Expand Down

0 comments on commit eaff6bb

Please sign in to comment.