Compare commits
No commits in common. "bd1f4889bccb980dd7bffa8d5b27a8ad415deb0b" and "cc92ab41fe410bcb0f04c6ae381f6848a5f8b053" have entirely different histories.
bd1f4889bc
...
cc92ab41fe
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
matrix:
|
||||
# Use these Java versions
|
||||
java: [
|
||||
21, # Minimum supported by Minecraft
|
||||
17, # Minimum supported by Minecraft
|
||||
]
|
||||
# and run on both Linux and Windows
|
||||
os: [ubuntu-20.04, windows-latest]
|
||||
@ -32,8 +32,8 @@ jobs:
|
||||
- name: build
|
||||
run: ./gradlew build
|
||||
- name: capture build artifacts
|
||||
if: ${{ runner.os == 'Linux' }}
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ runner.os == 'Linux' && matrix.java == '16' }} # Only upload artifacts built from latest java on one OS
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Artifacts
|
||||
path: build/libs/
|
||||
|
||||
12
README.md
12
README.md
@ -2,17 +2,13 @@
|
||||
|
||||
# Save Coordinates Fabric Mod
|
||||
|
||||
<img src = "https://img.shields.io/github/v/release/cool-mist/SaveCoordinates?style=flat-square" />
|
||||
<a href = "https://www.curseforge.com/minecraft/mc-mods/savecoordinates/files"><img src = "http://cf.way2muchnoise.eu/versions/savecoordinates.svg"/> </a>
|
||||
<img src = "https://img.shields.io/github/v/release/cool-mist/SaveCoordinates?style=flat-square" /> <a href = "https://www.curseforge.com/minecraft/mc-mods/savecoordinates/files"><img src = "http://cf.way2muchnoise.eu/versions/savecoordinates.svg"/> </a>
|
||||
|
||||
## Dependencies
|
||||
|
||||
This mod|Minecraft|[Fabric API](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files)|[Mod Menu](https://www.curseforge.com/minecraft/mc-mods/modmenu/files) (optional)
|
||||
--|--|--|--
|
||||
**1.21.4-1.5.0**|**1.21.5+**|*0.119.2+1.21.4**|**13.0.3**
|
||||
1.20.1-1.4.1|1.20.1+|0.85.0+1.20.1|7.1.0
|
||||
1.19.2-1.3.1|1.19.2+|0.60.0+1.19.2|4.1.0
|
||||
1.18.1-1.3.0|1.18.x|0.44.0+1.18|3.0.0
|
||||
**1.18.1-1.3.0**|1.18.x|0.44.0+1.18|3.0.0
|
||||
1.17.1-1.2.1|1.17.1|0.41.0+1.17|2.0.14
|
||||
1.17-1.1.1 |1.17.1|0.34.9+1.17+|2.0.2
|
||||
1.17-1.1.1 |1.17|0.34.9+1.17+|2.0.0-beta.7+
|
||||
@ -51,3 +47,7 @@ This mod|Minecraft|[Fabric API](https://www.curseforge.com/minecraft/mc-mods/fab
|
||||
- This is reachable through mod menu as well when available.
|
||||
|
||||
<hr/>
|
||||
|
||||
## Discord
|
||||
|
||||
https://discord.gg/9xnv2gQbJt
|
||||
|
||||
33
build.gradle
33
build.gradle
@ -1,21 +1,21 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '1.10-SNAPSHOT'
|
||||
id 'fabric-loom' version '0.10-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = project.mod_version
|
||||
group = project.maven_group
|
||||
|
||||
base {
|
||||
archivesName = project.archives_base_name
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "CottonMC"
|
||||
url = "https://server.bbkr.space/artifactory/libs-release"
|
||||
}
|
||||
|
||||
|
||||
maven {
|
||||
name = "TerraformersMC"
|
||||
url = "https://maven.terraformersmc.com/releases"
|
||||
@ -39,40 +39,37 @@ processResources {
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.version
|
||||
}
|
||||
|
||||
|
||||
exclude("**/icon.pdn")
|
||||
exclude("**/icon400.png")
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnit()
|
||||
maxHeapSize = '1G'
|
||||
}
|
||||
|
||||
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
|
||||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
||||
// If Javadoc is generated, this must be specified in that task too.
|
||||
it.options.encoding = "UTF-8"
|
||||
|
||||
it.options.release = 21
|
||||
|
||||
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
|
||||
it.options.release = 17
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
|
||||
jar {
|
||||
inputs.property "archivesName", project.base.archivesName
|
||||
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${project.archivesBaseName}"}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnit()
|
||||
maxHeapSize = '1G'
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
|
||||
@ -1,17 +1,23 @@
|
||||
# Done to increase the memory available to gradle.
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
mod_version = 1.21.4-1.5.0
|
||||
maven_group = me.neophyte.mods.savecoords
|
||||
archives_base_name = save-coordinates
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
minecraft_version=1.18.1
|
||||
yarn_mappings=1.18.1+build.1
|
||||
loader_version=0.12.12
|
||||
|
||||
# Lookup versions from https://fabricmc.net/develop/
|
||||
minecraft_version=1.21.4
|
||||
yarn_mappings=1.21.4+build.8
|
||||
loader_version=0.16.10
|
||||
fabric_version=0.119.2+1.21.4
|
||||
# Mod Properties
|
||||
mod_version = 1.18.1-1.3.0
|
||||
maven_group = me.neophyte.mods.savecoords
|
||||
archives_base_name = save-coordinates
|
||||
|
||||
# https://github.com/CottonMC/LibGui/wiki/Setup
|
||||
libgui_version=12.0.1+1.21.2
|
||||
# https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu/
|
||||
modmenu_version=13.0.3
|
||||
# Dependencies
|
||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
fabric_version=0.44.0+1.18
|
||||
|
||||
# https://github.com/CottonMC/LibGui/wiki/Setup
|
||||
libgui_version=5.1.0+1.18
|
||||
|
||||
#https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu/
|
||||
modmenu_version=3.0.0
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,7 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
284
gradlew
vendored
284
gradlew
vendored
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@ -15,103 +15,69 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# 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
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
@ -121,9 +87,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@ -132,120 +98,88 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
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=SC2039,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=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# 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, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
||||
@ -5,7 +5,7 @@ import me.neophyte.mods.savecoords.gui.impl.DIContainer;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
public class SaveCoordinatesClient implements ClientModInitializer {
|
||||
|
||||
@ -35,7 +35,7 @@ public class SaveCoordinatesClient implements ClientModInitializer {
|
||||
translationKey = TranslationKeys.TOOLTIP_PING_ENABLED;
|
||||
}
|
||||
|
||||
MinecraftClient.getInstance().player.sendMessage(Text.translatable(translationKey), true);
|
||||
MinecraftClient.getInstance().player.sendMessage(new TranslatableText(translationKey), true);
|
||||
}
|
||||
|
||||
while(pingKeyBinding.wasPressed()) {
|
||||
|
||||
@ -15,7 +15,9 @@ import me.neophyte.mods.savecoords.IKeyBinds.IKeyBinding;
|
||||
import me.neophyte.mods.savecoords.gui.IRootPanel;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.InputUtil.Type;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
// TODO:
|
||||
// Clean the mess below on order of event handling
|
||||
@ -31,9 +33,9 @@ class ConfigViewHandler extends ViewHandlerBase<List<IKeyBinding>> {
|
||||
private ConfigListPanel listPanel;
|
||||
|
||||
public ConfigViewHandler() {
|
||||
this.saveButton = new WButton(Text.translatable(TranslationKeys.MENU_SAVE));
|
||||
this.backButton = new WButton(Text.translatable(TranslationKeys.MENU_BACK));
|
||||
this.resetButton = new WButton(Text.translatable(TranslationKeys.MENU_RESET));
|
||||
this.saveButton = new WButton(new TranslatableText(TranslationKeys.MENU_SAVE));
|
||||
this.backButton = new WButton(new TranslatableText(TranslationKeys.MENU_BACK));
|
||||
this.resetButton = new WButton(new TranslatableText(TranslationKeys.MENU_RESET));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -215,9 +217,9 @@ class ConfigViewHandler extends ViewHandlerBase<List<IKeyBinding>> {
|
||||
private int code;
|
||||
|
||||
ConfigItemPanel() {
|
||||
this.configLabel = new WLabel(Text.of(""));
|
||||
this.configLabel = new WLabel("");
|
||||
this.configButton = new WButton();
|
||||
this.resetButton = new WButton(Text.translatable(TranslationKeys.MENU_RESET));
|
||||
this.resetButton = new WButton(new TranslatableText(TranslationKeys.MENU_RESET));
|
||||
}
|
||||
|
||||
void setInitialConfig(IKeyBinding config) {
|
||||
@ -275,7 +277,7 @@ class ConfigViewHandler extends ViewHandlerBase<List<IKeyBinding>> {
|
||||
|
||||
private void updateWidgetData(Type type, int code) {
|
||||
if(focussing) {
|
||||
this.configButton.setLabel(Text.of("_"));
|
||||
this.configButton.setLabel(new LiteralText("_"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import me.neophyte.mods.savecoords.IFileStore;
|
||||
import me.neophyte.mods.savecoords.TranslationKeys;
|
||||
import me.neophyte.mods.savecoords.model.PlayerRawPosition;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
public class CurrentPositionPingOperation extends PingPositionOperation{
|
||||
|
||||
@ -28,7 +28,7 @@ public class CurrentPositionPingOperation extends PingPositionOperation{
|
||||
if (enabled) {
|
||||
super.executeOperation(fileStore, position);
|
||||
} else {
|
||||
MinecraftClient.getInstance().player.sendMessage(Text.translatable(TranslationKeys.TOOLTIP_PING_LOCK),
|
||||
MinecraftClient.getInstance().player.sendMessage(new TranslatableText(TranslationKeys.TOOLTIP_PING_LOCK),
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,8 @@ import me.neophyte.mods.savecoords.model.PlayerPosition;
|
||||
import me.neophyte.mods.savecoords.model.PlayerRawPosition;
|
||||
import me.neophyte.mods.savecoords.model.PositionMetadata;
|
||||
import me.neophyte.mods.savecoords.util.ResourceUtils;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
class DefaultViewHandler extends ViewHandlerBase<PlayerPosition> {
|
||||
|
||||
@ -172,7 +173,7 @@ class DefaultViewHandler extends ViewHandlerBase<PlayerPosition> {
|
||||
}
|
||||
|
||||
private WWidget CreateLabelForCoordinate(String label) {
|
||||
WButton labelButton = new WButton(Text.of(label));
|
||||
WButton labelButton = new WButton(new LiteralText(label));
|
||||
labelButton.setEnabled(false);
|
||||
return labelButton;
|
||||
}
|
||||
@ -186,7 +187,7 @@ class DefaultViewHandler extends ViewHandlerBase<PlayerPosition> {
|
||||
}
|
||||
|
||||
private WTextField CreateLocationField(PlayerPosition existingPosition) {
|
||||
WTextField location = new WTextField(Text.translatable(TranslationKeys.MENU_LOCATION));
|
||||
WTextField location = new WTextField(new TranslatableText(TranslationKeys.MENU_LOCATION));
|
||||
|
||||
if (existingPosition != null) {
|
||||
location.setText(existingPosition.getLocationName());
|
||||
@ -198,7 +199,7 @@ class DefaultViewHandler extends ViewHandlerBase<PlayerPosition> {
|
||||
}
|
||||
|
||||
private WTextField CreateNotesField(PlayerPosition existingPosition) {
|
||||
WTextField notes = new WTextField(Text.translatable(TranslationKeys.MENU_NOTES));
|
||||
WTextField notes = new WTextField(new TranslatableText(TranslationKeys.MENU_NOTES));
|
||||
|
||||
if (existingPosition != null && existingPosition.getPositionMetadata() != null) {
|
||||
notes.setText(existingPosition.getPositionMetadata().getNotes());
|
||||
@ -208,7 +209,7 @@ class DefaultViewHandler extends ViewHandlerBase<PlayerPosition> {
|
||||
}
|
||||
|
||||
private WTextField CreateWorldField(String defaultWorld) {
|
||||
WTextField world = new WTextField(Text.translatable(TranslationKeys.MENU_WORLD_NAME));
|
||||
WTextField world = new WTextField(new TranslatableText(TranslationKeys.MENU_WORLD_NAME));
|
||||
world.setMaxLength(7);
|
||||
world.setText(defaultWorld);
|
||||
return world;
|
||||
@ -221,6 +222,6 @@ class DefaultViewHandler extends ViewHandlerBase<PlayerPosition> {
|
||||
}
|
||||
|
||||
private WButton CreateButton(String translationKey) {
|
||||
return new WButton(Text.translatable(translationKey));
|
||||
return new WButton(new TranslatableText(translationKey));
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import me.neophyte.mods.savecoords.IDimensionAware;
|
||||
import me.neophyte.mods.savecoords.IDimensionAware.IDimension;
|
||||
import me.neophyte.mods.savecoords.model.PlayerRawPosition;
|
||||
import me.neophyte.mods.savecoords.util.PartialCircularList;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.LiteralText;
|
||||
|
||||
public class DimensionButton extends WButton {
|
||||
|
||||
@ -27,13 +27,13 @@ public class DimensionButton extends WButton {
|
||||
IDimension currentDimension = allDimensions.current();
|
||||
|
||||
sprite.setImage(currentDimension.getSpriteIdentifier());
|
||||
setLabel(Text.of(currentDimension.getName()));
|
||||
setLabel(new LiteralText(currentDimension.getName()));
|
||||
|
||||
setOnClick(() -> {
|
||||
allDimensions.next();
|
||||
IDimension current = getDimension();
|
||||
sprite.setImage(current.getSpriteIdentifier());
|
||||
setLabel(Text.of(current.getName()));
|
||||
setLabel(new LiteralText(current.getName()));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -19,7 +19,8 @@ import me.neophyte.mods.savecoords.gui.IRootPanel;
|
||||
import me.neophyte.mods.savecoords.model.PlayerPosition;
|
||||
import me.neophyte.mods.savecoords.model.PlayerRawPosition;
|
||||
import me.neophyte.mods.savecoords.util.ResourceUtils;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
class ListViewHandler extends ViewHandlerBase<Void> {
|
||||
|
||||
@ -57,7 +58,7 @@ class ListViewHandler extends ViewHandlerBase<Void> {
|
||||
}
|
||||
|
||||
private WButton createBackButton() {
|
||||
return new WButton(Text.translatable(TranslationKeys.MENU_BACK));
|
||||
return new WButton(new TranslatableText(TranslationKeys.MENU_BACK));
|
||||
}
|
||||
|
||||
private WListPanel<PlayerPosition, CoordinatesListItemPanel> createListPanel(List<PlayerPosition> positions) {
|
||||
@ -121,14 +122,14 @@ class ListViewHandler extends ViewHandlerBase<Void> {
|
||||
this.netherCalculator = netherCalculator;
|
||||
this.coordinateConvertState = true;
|
||||
|
||||
this.coordinates = new WLabel(Text.of(""));
|
||||
this.location = new WLabel(Text.of(""));
|
||||
this.world = new WLabel(Text.of(""));
|
||||
this.coordinates = new WLabel("");
|
||||
this.location = new WLabel("");
|
||||
this.world = new WLabel("");
|
||||
this.icon = new WSprite(ResourceUtils.getIdentifier("close"));
|
||||
this.deleteButton = createDeleteButton();
|
||||
this.detailButton = new WButton(Text.of(""));
|
||||
this.pingButton = new WButton(Text.of(""));
|
||||
this.convertButton = new WButton(Text.of(""));
|
||||
this.detailButton = new WButton(new LiteralText(""));
|
||||
this.pingButton = new WButton(new LiteralText(""));
|
||||
this.convertButton = new WButton(new LiteralText(""));
|
||||
|
||||
this.pingButton.setIcon(ResourceUtils.createPingIcon());
|
||||
this.detailButton.setIcon(ResourceUtils.createDetailsIcon());
|
||||
@ -156,17 +157,17 @@ class ListViewHandler extends ViewHandlerBase<Void> {
|
||||
}
|
||||
|
||||
private WButton createDeleteButton() {
|
||||
TexturedButton button = new TexturedButton(Text.of("x"));
|
||||
TexturedButton button = new TexturedButton(new LiteralText("x"));
|
||||
button.setTexture(ResourceUtils.getIdentifier("close"));
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
void setPosition(PlayerPosition position) {
|
||||
this.location.setText(Text.of(position.getLocationName()));
|
||||
this.location.setText(new LiteralText(position.getLocationName()));
|
||||
this.location.setColor(0x3939ac);
|
||||
if (position.getPositionMetadata() != null) {
|
||||
this.world.setText(Text.of("[" + position.getPositionMetadata().getWorldName() + "]"));
|
||||
this.world.setText(new LiteralText("[" + position.getPositionMetadata().getWorldName() + "]"));
|
||||
this.world.setColor(0xb80000);
|
||||
}
|
||||
|
||||
@ -182,7 +183,7 @@ class ListViewHandler extends ViewHandlerBase<Void> {
|
||||
|
||||
this.icon.setImage(ResourceUtils.getIdentifier(position.getWorldDimension()));
|
||||
this.coordinates
|
||||
.setText(Text.of(position.getX() + ", " + position.getY() + ", " + position.getZ()));
|
||||
.setText(new LiteralText(position.getX() + ", " + position.getY() + ", " + position.getZ()));
|
||||
this.convertButton.setOnClick(() -> setRawPosition(netherCalculator.convert(position)));
|
||||
this.pingButton.setOnClick(() -> onPing.accept(position));
|
||||
this.coordinateConvertState = !coordinateConvertState;
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.function.Supplier;
|
||||
import me.neophyte.mods.savecoords.IFileStore;
|
||||
import me.neophyte.mods.savecoords.model.PlayerRawPosition;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
class PingPositionOperation extends ViewOperationBase<PlayerRawPosition> {
|
||||
|
||||
@ -16,6 +15,6 @@ class PingPositionOperation extends ViewOperationBase<PlayerRawPosition> {
|
||||
@SuppressWarnings("resource")
|
||||
@Override
|
||||
protected void executeOperation(IFileStore fileStore, PlayerRawPosition position) throws Exception {
|
||||
MinecraftClient.getInstance().player.sendMessage(Text.of(position.toString()), true);
|
||||
MinecraftClient.getInstance().player.sendChatMessage(position.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ package me.neophyte.mods.savecoords.gui.impl;
|
||||
import io.github.cottonmc.cotton.gui.client.ScreenDrawing;
|
||||
import io.github.cottonmc.cotton.gui.widget.WButton;
|
||||
import io.github.cottonmc.cotton.gui.widget.data.HorizontalAlignment;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
@ -21,7 +20,7 @@ public class TexturedButton extends WButton {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(DrawContext matrices, int x, int y, int mouseX, int mouseY) {
|
||||
public void paint(MatrixStack matrices, int x, int y, int mouseX, int mouseY) {
|
||||
super.paint(matrices, x, y, mouseX, mouseY);
|
||||
|
||||
if (texture != null) {
|
||||
|
||||
@ -18,6 +18,7 @@ import net.minecraft.client.option.KeyBinding;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import net.minecraft.client.util.InputUtil.Type;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
class KeyBinds implements IKeyBinds {
|
||||
|
||||
@ -119,7 +120,7 @@ class KeyBinds implements IKeyBinds {
|
||||
|
||||
@Override
|
||||
public Text getNameLocalizedText() {
|
||||
return Text.translatable(getTranslationKey());
|
||||
return new TranslatableText(getTranslationKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -39,6 +39,6 @@ public class IdentifiersCache {
|
||||
}
|
||||
|
||||
private static Identifier createIdentifier(String file) {
|
||||
return Identifier.of("savecoords", "textures/gui/" + file + ".png");
|
||||
return new Identifier("savecoords", "textures/gui/" + file + ".png");
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
"contact": {
|
||||
"homepage": "https://github.com/cool-mist/SaveCoordinates",
|
||||
"sources": "https://github.com/cool-mist/SaveCoordinates",
|
||||
"issues": "https://github.com/cool-mist/SaveCoordinates/issues"
|
||||
"issues" : "https://github.com/cool-mist/SaveCoordinates/issues"
|
||||
},
|
||||
"license": "LGPLv3",
|
||||
"icon": "assets/savecoords/icon.png",
|
||||
@ -25,12 +25,12 @@
|
||||
},
|
||||
"mixins": [],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.9",
|
||||
"fabricloader": ">=0.11.3",
|
||||
"fabric": "*",
|
||||
"minecraft": "1.21.x",
|
||||
"java": ">=21"
|
||||
"minecraft": "1.18.x",
|
||||
"java": ">=17"
|
||||
},
|
||||
"suggests": {
|
||||
"another-mod": "modmenu"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user