[docs] Add page on changes between pack format versions
This commit is contained in:
parent
f319a25aaf
commit
2e4cc36303
14
build.gradle
14
build.gradle
|
@ -24,9 +24,11 @@ dependencies {
|
|||
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
|
||||
modImplementation("com.terraformersmc:modmenu:3.0.1")
|
||||
include modImplementation("com.github.MeteorDevelopment:starscript:0.1.5")
|
||||
modApi("me.shedaniel.cloth:cloth-config-fabric:6.0.42")
|
||||
modCompileOnly "io.vram:frex-fabric-mc118:+"
|
||||
include modImplementation("com.github.MeteorDevelopment:starscript:0.1.9")
|
||||
modApi("me.shedaniel.cloth:cloth-config-fabric:6.2.57") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
// modCompileOnly "io.vram:frex-fabric-mc118:+"
|
||||
include modImplementation("io.gitlab.jfronny.libjf:libjf-data-manipulation-v0:${project.jfapi_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
|
@ -37,9 +39,9 @@ dependencies {
|
|||
testImplementation('org.junit.jupiter:junit-jupiter:5.8.2')
|
||||
|
||||
//Canvas for FREX testing
|
||||
modRuntimeOnly("io.vram:canvas-fabric-mc118:+") {
|
||||
exclude(group: "me.shedaniel.cloth")
|
||||
}
|
||||
// modRuntimeOnly("io.vram:canvas-fabric-mc118:+") {
|
||||
// exclude(group: "me.shedaniel.cloth")
|
||||
// }
|
||||
|
||||
//DashLoader "compatibility"
|
||||
//modImplementation ('net.oskarstrom:DashLoader:2.1-dev7') {
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# Debugging
|
||||
If you run into issues with respackopts and cannot find a solution here,
|
||||
you may contact me through my discord server (look at the mod page)
|
||||
|
||||
### Look at the config file
|
||||
Respackopts stores configurations next to their corresponding resource packs (`some pack.zip.rpo` usually)
|
||||
|
||||
This file contains all applied config options as saved by respackopts.
|
||||
|
||||
### Dump the internal representation
|
||||
Running `/rpo dump config` will dump all data available about the enabled packs, including their config options (but not individual configurations like .rpo files)
|
||||
|
||||
You can use this if a conf.json isn't working as expected
|
||||
|
||||
### Dump GLSL code
|
||||
You can run the command `/rpo dump glsl` to dump the shader code generated by respackopts to a file.
|
||||
|
||||
I recommend reading through it if your shader is misbehaving.
|
||||
The content imported to your shader by the integrations will equal the dumped code.
|
||||
|
||||
### Verify that the option you are using exists
|
||||
One common issue is that you removed an option but still use it somewhere.
|
||||
The log will usually reference that option and the source.
|
||||
|
||||
### Ensure you are using the correct dots
|
||||
Ensure conditions follow one of the following conventions.
|
||||
Using dots, colons or commas where they don't belong will break your pack:
|
||||
|
||||
- `<pack id>:<entry id>`, eg `breeze16:bushyLeaves.full`
|
||||
- `<entry id>`, eg `bushyLeaves.full`
|
||||
|
||||
### Avoid infinite loops
|
||||
Ensure that you do not reference an original file or a previous fallback from a fallback.
|
||||
Respackopts WILL crash if it runs into an infinite loop!
|
|
@ -0,0 +1,55 @@
|
|||
# Changes between versions
|
||||
The `version` specified in your pack.json refers to a rpo format version.
|
||||
A new rpo format version will be added whenever a change might break previous packs,
|
||||
which will continue to use the old version.
|
||||
|
||||
This page lists the changes relevant to pack developers between versions and migrations (if needed)
|
||||
|
||||
### v1
|
||||
Corresponds to version 1.0 - 1.4.4
|
||||
|
||||
- FREX Shader support
|
||||
- Enum entries (no key translation yet)
|
||||
- `respackopts.category.<pack>` to `respackopts.title.<pack>`
|
||||
- Replace dots with underscores in frex definitions
|
||||
- basic .rpo format
|
||||
- `respackopts_loaded` in FREX shaders
|
||||
- Slider support (`{"min": value, "default": value, "max": value}`)
|
||||
- Tooltips: `respackopts.tooltip.<pack>.<entry>`
|
||||
- Boolean conditions (and, or, nor, xor, equals): `{"<type>":[<entry 1>, <entry 2>]}`
|
||||
|
||||
### v2
|
||||
Corresponds to version 2.0.0 - 2.2.0
|
||||
|
||||
- Removed LibCD compat
|
||||
- Enum: define enum entries as booleans if they are selected, not their numerical value
|
||||
- Further shader entry name sanitization
|
||||
|
||||
### v3
|
||||
Corresponds to version 2.3.0
|
||||
|
||||
- `respackopts.title.<pack>` to `rpo.<pack>`
|
||||
- `respackopts.field.<pack>.<entry>` to `rpo.<pack>.<entry>`
|
||||
- `respackopts.tooltip.<pack>.<entry>` to `rpo.tooltip.<pack>.<entry>`
|
||||
|
||||
### v4
|
||||
Corresponds to version 2.4.0 - 2.5.0
|
||||
|
||||
- Resource expansion support
|
||||
- Directory .rpo support
|
||||
- Allow using singular names and allow using a single entry instead of an array (`fallbacks` to `fallback`, `conditions` to `condition`, `expansions` to `expansion`)
|
||||
- Remove requirement for specifying pack id in conditions: `<pack>:some.entry` to `some.entry`
|
||||
|
||||
### v5
|
||||
Corresponds to version 2.6.0 - 2.7.1
|
||||
|
||||
- Pack capabilities, no longer includes DirFilter for new packs by default
|
||||
- Add /rpo command for debugging
|
||||
|
||||
### v6
|
||||
Corresponds to version 2.7.2 - 2.9.1
|
||||
|
||||
- allow specifying entries as objects with additional properties (`type`, `default`, `reloadType`)
|
||||
- Fabulous shader support
|
||||
- additional StarScript properties
|
||||
- OPEN_ROOT support (allows custom icon.pngs among other things)
|
|
@ -28,4 +28,23 @@ You will need to navigate to the file you would like to toggle inside your resou
|
|||
}
|
||||
```
|
||||
|
||||
### Another way to do this:
|
||||
Respackopts supports specifying multiple possible fallbacks when configuring single files.
|
||||
You can use this functionality as follows:
|
||||
```json
|
||||
{
|
||||
"condition": "<pack id>:<entry name>",
|
||||
"fallbacks": [
|
||||
"location/of/the/file",
|
||||
"assets/minecraft/textures/example/alternate.png"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"condition": "examplePack:someTexture"
|
||||
}
|
||||
```
|
||||
|
||||
See [Toggle Files ](./ToggleFiles.md) to see how to just disable files.
|
||||
|
|
|
@ -5,10 +5,5 @@ However, the quality of the documentation here is worse.
|
|||
## Migration status
|
||||
| Page | Status |
|
||||
| --- | --- |
|
||||
| [home](home.md) | done |
|
||||
| [adding_entries](adding_entries.md) | done |
|
||||
| [canvas](canvas.md) | done |
|
||||
| [conditional](conditional.md) | TODO explain advanced conditions/condition arrays |
|
||||
| [expand](expand.md) | TODO |
|
||||
| [fallbacks](fallbacks.md) | TODO: explain multiple fallbacks for files |
|
||||
| [how_it_works](how_it_works.md) | deliberately left out |
|
||||
| [expand](expand.md) | TODO |
|
|
@ -1,44 +0,0 @@
|
|||
# Adding entries
|
||||
Entry names may only contain normal characters (a-z and uppercase). Anything else will still work but may cause unexpected behavior.
|
||||
You may use the translation system of minecraft to localize names and display more characters.
|
||||
# Adding translations/tooltips
|
||||
To add translations, better names or tooltips, you need to supply a language file (`en_us.json` for example)
|
||||
Normal translations for entries will be named `rpo.<your pack>.<entry>`
|
||||
You can also add tooltips with `rpo.tooltip.<your pack>.<entry>`
|
||||
# Adding an entry
|
||||
## Toggle/Boolean
|
||||
To add a boolean entry, add code like this: `"entryName": true` (You can also set it to `false`) inside your `conf` block
|
||||
## Number box
|
||||
A number box follows the same principle as a boolean: `"entryName": 10.8` is a possible entry.
|
||||
## Slider
|
||||
A slider is slightly more complicated as a minimum and a maximum need to be defined. Sliders also only support whole numbers.
|
||||
Example:
|
||||
```json
|
||||
"entryName": {
|
||||
"min": 15,
|
||||
"default": 16,
|
||||
"max": 20
|
||||
}
|
||||
```
|
||||
A slider will only be shown if the value names inside the block are exactly the same, otherwise this will be treated as a category.
|
||||
## Select from list
|
||||
To allow users to select one entry from a list, you can use a json array with string entries. Numbers/etc are not supported.
|
||||
Example:
|
||||
```json
|
||||
"entryName": [
|
||||
"option_one",
|
||||
"option_two",
|
||||
"option_three"
|
||||
]
|
||||
```
|
||||
## Categories
|
||||
A category is a normal json object. It can contain entries of any type, including other categories.
|
||||
Example:
|
||||
```json
|
||||
"entryName": {
|
||||
"someEntry": true,
|
||||
"someOtherEntry": 15
|
||||
}
|
||||
```
|
||||
# Example
|
||||
You can find an example pack configuration [here](https://gitlab.com/jfmods/respackopts/-/blob/master/run/resourcepacks/lumi/assets/respackopts/conf.json)
|
|
@ -1,18 +0,0 @@
|
|||
# Canvas
|
||||
To use respackopts in your shader, you can `#include respackopts:config_supplier`
|
||||
This will import sanitized entries for all packs.
|
||||
You may access them as `<id>_<entry>` or `<id>_<category>_<entry>`
|
||||
Entries will be expressed as follows:
|
||||
| Type | Type in shader |
|
||||
--|--
|
||||
| Boolean | Will either be `#define`d or not, use `#ifdef` |
|
||||
| Numeric | Will be defined as a number you can use directly |
|
||||
| Enum | First, a number entry will be `#define`d. You may check if a specific value is selected via `<id>_<entry>_<value>` which will be handled like booleans |
|
||||
|
||||
If respackopts is not present, the `#include` will not break the code,
|
||||
though you may want to define default values yourself.
|
||||
You can check whether the config supplier is properly imported through `#ifdef respackopts_loaded`
|
||||
|
||||
## V1 enums
|
||||
In respackopts v1 shaders, enums values are expressed by their ints and need to be
|
||||
compared to the value of the main entry.
|
|
@ -1,23 +0,0 @@
|
|||
# Fallback resources
|
||||
You can select an option by providing a fallback in addition to conditions.
|
||||
If the conditions are not met, fallbacks will be used. If the first callback can't be used,
|
||||
A later one will be tried. If none can be used, the resource will be ignored.
|
||||
## Example
|
||||
```json
|
||||
{
|
||||
"conditions": [
|
||||
{
|
||||
"not": [
|
||||
"example:useAlternate"
|
||||
]
|
||||
}
|
||||
],
|
||||
"fallbacks": [
|
||||
"assets/minecraft/lang/en_us_alternate.json"
|
||||
]
|
||||
|
||||
}
|
||||
```
|
||||
## Multiple alternatives
|
||||
A fallback resource may provide their own conditions or fallbacks which will also be considered
|
||||
and can be used to allow users to select one of multiple resources
|
|
@ -1,31 +0,0 @@
|
|||
# Getting started
|
||||
|
||||
Before you can start using respackopts, you will need to create a respackopts conf file for your pack.
|
||||
This file will be located in `/assets/respackopts/conf.json` of your resource pack (or `/data/respackopts/conf.json` if you are creating a data pack).
|
||||
You will need to create the respackopts dir yourself. The basic layout is as follows:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "<An identifier for your resource pack>",
|
||||
"version": 3,
|
||||
"conf": {
|
||||
// Your config screen
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Please note that the id as well as any entry should be written in camelCase, while this is technically not required,
|
||||
I would still recommend it. You add entries by simply putting them inside the "conf" block.
|
||||
More details of what entries are supported may be found [here](https://gitlab.com/jfmods/respackopts/-/wikis/adding_entries)
|
||||
Once you have created your config screen, you will need to actually use the entries you defined.
|
||||
How that is done depends on where you will use them. Generally you can:
|
||||
|
||||
* [Enable/Disable certain resources](https://gitlab.com/jfmods/respackopts/-/wikis/conditional) (Example: toggleable texture)
|
||||
* [Select one of multiple alternative resources](https://gitlab.com/jfmods/respackopts/-/wikis/fallbacks) (Example: select one of many texures)
|
||||
* [Use values in canvas/frex shaders](https://gitlab.com/jfmods/respackopts/-/wikis/canvas)
|
||||
* [Replace content in a file based on your config](https://gitlab.com/jfmods/respackopts/-/wikis/expand)
|
||||
|
||||
If you are interested in how respackopts works or what changed between versions, you can look [here](https://gitlab.com/jfmods/respackopts/-/wikis/how_it_works)
|
||||
|
||||
## Tricks
|
||||
* Since vanilla minecraft ignores .rpo files, you can use them to load files only if rpo is present by using `"conditions": ["false"]` and a fallback texture (`"true"` is also a key that is always defined in conditional resources)
|
|
@ -1,16 +0,0 @@
|
|||
# How it works
|
||||
## Format changes
|
||||
### V1 to V2
|
||||
The way enums are expressed for canvas shaders was changed,
|
||||
now values are no longer constant numbers but instead booleans expressing whether they are selected.
|
||||
|
||||
## A quick tour
|
||||
In ResourcePackManagerMixin, the conf.json will be parsed and saved to a map in the main class.
|
||||
Now, whenever a resource is accessed, the mixins under conditions/ will check if a .rpo file exists
|
||||
for the current resource and parse it if that is the case.
|
||||
If a resource is "hidden", openFile will throw a FileNotFoundException and containsFile will return false,
|
||||
essentialy preventing the game from even knowing the resource exists.
|
||||
|
||||
## Canvas integration
|
||||
Grondag implemented an API into frex to allow RPO to supply a custom shader file which other may include,
|
||||
the code is generated by each individual entry class.
|
|
@ -1,12 +1,11 @@
|
|||
org.gradle.jvmargs=-Xmx2G
|
||||
# https://fabricmc.net/develop/
|
||||
minecraft_version=1.18.1
|
||||
yarn_mappings=build.22
|
||||
loader_version=0.12.12
|
||||
minecraft_version=22w07a
|
||||
yarn_mappings=build.2
|
||||
loader_version=0.13.2
|
||||
maven_group=io.gitlab.jfronny
|
||||
archives_base_name=respackopts
|
||||
fabric_version=0.46.2+1.18
|
||||
jfapi_version=2.2.0
|
||||
fabric_version=0.47.2+1.18.2
|
||||
jfapi_version=2.4.0-1645119407
|
||||
|
||||
modrinth_id=TiF5QWZY
|
||||
modrinth_required_dependencies=JPP6w2U1
|
||||
|
|
Binary file not shown.
|
@ -1,5 +0,0 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
|
@ -1,234 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# 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/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# 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
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${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
|
||||
|
||||
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 ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
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
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
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
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
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 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" )
|
||||
|
||||
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
|
||||
done
|
||||
fi
|
||||
|
||||
# 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
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# 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' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
|
@ -1,89 +0,0 @@
|
|||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
11
mkdocs.yml
11
mkdocs.yml
|
@ -14,19 +14,16 @@ nav:
|
|||
- 'MainConfig.md'
|
||||
- 'AdvancedConfig.md'
|
||||
- 'Translations.md'
|
||||
- 'Debugging.md'
|
||||
- 'Select files':
|
||||
- 'ToggleFiles.md'
|
||||
- 'ToggleFilesWithFallback.md'
|
||||
- 'MultipleFileSelection.md'
|
||||
- 'Integrations':
|
||||
- 'Additional':
|
||||
- 'Shaders.md'
|
||||
- 'FabricResourceConditions.md'
|
||||
- 'Migrations.md'
|
||||
- 'Old wiki':
|
||||
- About: 'old/README.md'
|
||||
- home: 'old/home.md'
|
||||
- adding_entries: 'old/adding_entries.md'
|
||||
- canvas: 'old/canvas.md'
|
||||
- conditional: 'old/conditional.md'
|
||||
- expand: 'old/expand.md'
|
||||
- fallbacks: 'old/fallbacks.md'
|
||||
- how_it_works: 'old/how_it_works.md'
|
||||
- expand: 'old/expand.md'
|
|
@ -11,7 +11,7 @@ public class FileExpansionProvider {
|
|||
public static synchronized InputStream replace(InputStream is, Map<String, Script> expansions) throws IOException {
|
||||
String s = new String(is.readAllBytes());
|
||||
for (Map.Entry<String, Script> entry : expansions.entrySet()) {
|
||||
s = s.replace("${" + entry.getKey() + "}", Respackopts.STAR_SCRIPT.run(entry.getValue()));
|
||||
s = s.replace("${" + entry.getKey() + "}", Respackopts.STAR_SCRIPT.run(entry.getValue()).toString());
|
||||
}
|
||||
return new ByteArrayInputStream(s.getBytes());
|
||||
}
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
package io.gitlab.jfronny.respackopts.integration;
|
||||
|
||||
import io.gitlab.jfronny.respackopts.Respackopts;
|
||||
import io.vram.frex.api.config.ShaderConfig;
|
||||
//import io.vram.frex.api.config.ShaderConfig;
|
||||
|
||||
//TODO re-enable for release
|
||||
public class FrexCompat {
|
||||
private static boolean initial = true;
|
||||
public static void onInitializeFrex() {
|
||||
ShaderConfig.registerShaderConfigSupplier(Respackopts.RPO_SHADER_ID, Respackopts::getShaderImportSource);
|
||||
Respackopts.LOGGER.info("enabled frex/canvas support");
|
||||
Respackopts.SAVE_ACTIONS.add(() -> {
|
||||
try {
|
||||
if (!initial)
|
||||
ShaderConfig.invalidateShaderConfig();
|
||||
initial = false;
|
||||
}
|
||||
catch (Throwable e) {
|
||||
Respackopts.LOGGER.error("Could not reload shader config", e);
|
||||
}
|
||||
});
|
||||
// ShaderConfig.registerShaderConfigSupplier(Respackopts.RPO_SHADER_ID, Respackopts::getShaderImportSource);
|
||||
// Respackopts.LOGGER.info("enabled frex/canvas support");
|
||||
// Respackopts.SAVE_ACTIONS.add(() -> {
|
||||
// try {
|
||||
// if (!initial)
|
||||
// ShaderConfig.invalidateShaderConfig();
|
||||
// initial = false;
|
||||
// }
|
||||
// catch (Throwable e) {
|
||||
// Respackopts.LOGGER.error("Could not reload shader config", e);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue