Add 1.20
This commit is contained in:
parent
cd071560fa
commit
6c476c3ead
9 changed files with 38 additions and 46 deletions
|
|
@ -4,14 +4,18 @@ org.gradle.parallel=true
|
||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/develop
|
# check these on https://fabricmc.net/develop
|
||||||
minecraft_version=1.19.3
|
minecraft_version=1.20
|
||||||
yarn_mappings=1.19.3+build.5
|
yarn_mappings=1.20+build.1
|
||||||
loader_version=0.14.19
|
loader_version=0.14.21
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
|
<<<<<<< Updated upstream
|
||||||
mod_version=1.0.2
|
mod_version=1.0.2
|
||||||
|
=======
|
||||||
|
mod_version=1.0.3
|
||||||
|
>>>>>>> Stashed changes
|
||||||
maven_group=dev.axolotlmaid.optionsprofiles
|
maven_group=dev.axolotlmaid.optionsprofiles
|
||||||
archives_base_name=options-profiles
|
archives_base_name=options-profiles
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
fabric_version=0.76.1+1.19.3
|
fabric_version=0.83.0+1.20
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,6 +1,5 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||||
networkTimeout=10000
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
||||||
12
gradlew
vendored
12
gradlew
vendored
|
|
@ -55,7 +55,7 @@
|
||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
|
@ -80,11 +80,11 @@ do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# This is normally unused
|
|
||||||
# shellcheck disable=SC2034
|
|
||||||
APP_BASE_NAME=${0##*/}
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
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.
|
# 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"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
|
@ -143,16 +143,12 @@ fi
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
|
||||||
# shellcheck disable=SC3045
|
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
||||||
# shellcheck disable=SC3045
|
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
1
gradlew.bat
vendored
1
gradlew.bat
vendored
|
|
@ -26,7 +26,6 @@ if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
@rem This is normally unused
|
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package dev.axolotlmaid.optionsprofiles.gui;
|
package dev.axolotlmaid.optionsprofiles.gui;
|
||||||
|
|
||||||
import dev.axolotlmaid.optionsprofiles.Profiles;
|
import dev.axolotlmaid.optionsprofiles.Profiles;
|
||||||
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.screen.GameModeSelectionScreen;
|
import net.minecraft.client.gui.screen.GameModeSelectionScreen;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||||
|
|
@ -45,10 +46,11 @@ public class EditProfileScreen extends Screen {
|
||||||
}).position(5, this.height - 25).size(100, 20).build());
|
}).position(5, this.height - 25).size(100, 20).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
@Override
|
||||||
this.renderBackground(matrices);
|
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||||
drawCenteredTextWithShadow(matrices, this.textRenderer, Text.of(this.title.getString() + profileName.getString()).asOrderedText(), this.width / 2 , 8, 16777215);
|
this.renderBackground(context);
|
||||||
drawCenteredTextWithShadow(matrices, this.textRenderer, Text.translatable("gui.options-profiles.profile-name-text").asOrderedText(), this.width / 2 - 70, this.height / 4 + 10, 16777215);
|
context.drawCenteredTextWithShadow(textRenderer, Text.of(this.title.getString() + profileName.getString()).asOrderedText(), this.width / 2 , 8, 16777215);
|
||||||
super.render(matrices, mouseX, mouseY, delta);
|
context.drawCenteredTextWithShadow(textRenderer, Text.translatable("gui.options-profiles.profile-name-text").asOrderedText(), this.width / 2 - 70, this.height / 4 + 10, 16777215);
|
||||||
|
super.render(context, mouseX, mouseY, delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,11 @@ import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.font.TextRenderer;
|
import net.minecraft.client.font.TextRenderer;
|
||||||
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.Element;
|
import net.minecraft.client.gui.Element;
|
||||||
import net.minecraft.client.gui.Selectable;
|
import net.minecraft.client.gui.Selectable;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||||
import net.minecraft.client.gui.widget.ElementListWidget;
|
import net.minecraft.client.gui.widget.ElementListWidget;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
|
|
||||||
|
|
@ -29,12 +29,6 @@ public class ProfilesListWidget extends ElementListWidget<ProfilesListWidget.Ent
|
||||||
for (File profile : Objects.requireNonNull(profilesDirectory.listFiles())) {
|
for (File profile : Objects.requireNonNull(profilesDirectory.listFiles())) {
|
||||||
String profileName = FilenameUtils.removeExtension(profile.getName());
|
String profileName = FilenameUtils.removeExtension(profile.getName());
|
||||||
this.addEntry(new ProfilesListWidget.ProfileEntry(Text.of(profileName)));
|
this.addEntry(new ProfilesListWidget.ProfileEntry(Text.of(profileName)));
|
||||||
|
|
||||||
// Sodium
|
|
||||||
// This code doesn't work yet
|
|
||||||
// if (!(profileName.contains("-sodium-options"))) {
|
|
||||||
// this.addEntry(new ProfilesListWidget.ProfileEntry(Text.of(profileName)));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,9 +55,7 @@ public class ProfilesListWidget extends ElementListWidget<ProfilesListWidget.Ent
|
||||||
|
|
||||||
ProfileEntry(final Text profileName) {
|
ProfileEntry(final Text profileName) {
|
||||||
this.profileName = profileName;
|
this.profileName = profileName;
|
||||||
this.editButton = new ButtonWidget.Builder(Text.translatable("gui.options-profiles.edit-profile-text"), (button) -> {
|
this.editButton = new ButtonWidget.Builder(Text.translatable("gui.options-profiles.edit-profile-text"), (button) -> ProfilesListWidget.this.client.setScreen(new EditProfileScreen(parent, profileName))).position(0, 0).size(75, 20).build();
|
||||||
ProfilesListWidget.this.client.setScreen(new EditProfileScreen(parent, profileName));
|
|
||||||
}).position(0, 0).size(75, 20).build();
|
|
||||||
|
|
||||||
this.loadButton = new ButtonWidget.Builder(Text.translatable("gui.options-profiles.load-profile-text"), (button) -> {
|
this.loadButton = new ButtonWidget.Builder(Text.translatable("gui.options-profiles.load-profile-text"), (button) -> {
|
||||||
new Profiles().overwriteOptionsFile(profileName.getString());
|
new Profiles().overwriteOptionsFile(profileName.getString());
|
||||||
|
|
@ -74,21 +66,19 @@ public class ProfilesListWidget extends ElementListWidget<ProfilesListWidget.Ent
|
||||||
}).position(0, 0).size(75, 20).build();
|
}).position(0, 0).size(75, 20).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
|
@Override
|
||||||
TextRenderer var10000 = ProfilesListWidget.this.client.textRenderer;
|
public void render(DrawContext context, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
|
||||||
|
TextRenderer textRenderer = ProfilesListWidget.this.client.textRenderer;
|
||||||
int var10004 = y + entryHeight / 2;
|
int textY = y + entryHeight / 2;
|
||||||
|
context.drawText(textRenderer, profileName, x, textY - 9 / 2, 16777215, true);
|
||||||
Objects.requireNonNull(ProfilesListWidget.this.client.textRenderer);
|
|
||||||
var10000.draw(matrices, profileName, x, (float)(var10004 - 9 / 2), 16777215);
|
|
||||||
|
|
||||||
this.editButton.setX(x + 115);
|
this.editButton.setX(x + 115);
|
||||||
this.editButton.setY(y);
|
this.editButton.setY(y);
|
||||||
this.editButton.render(matrices, mouseX, mouseY, tickDelta);
|
this.editButton.render(context, mouseX, mouseY, tickDelta);
|
||||||
|
|
||||||
this.loadButton.setX(x + 190);
|
this.loadButton.setX(x + 190);
|
||||||
this.loadButton.setY(y);
|
this.loadButton.setY(y);
|
||||||
this.loadButton.render(matrices, mouseX, mouseY, tickDelta);
|
this.loadButton.render(context, mouseX, mouseY, tickDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<? extends Element> children() {
|
public List<? extends Element> children() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package dev.axolotlmaid.optionsprofiles.gui;
|
package dev.axolotlmaid.optionsprofiles.gui;
|
||||||
|
|
||||||
import dev.axolotlmaid.optionsprofiles.Profiles;
|
import dev.axolotlmaid.optionsprofiles.Profiles;
|
||||||
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
|
@ -34,10 +35,11 @@ public class ProfilesScreen extends Screen {
|
||||||
}).position(this.width / 2 - 155 + 160, this.height - 29).size(150, 20).build());
|
}).position(this.width / 2 - 155 + 160, this.height - 29).size(150, 20).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
@Override
|
||||||
this.renderBackground(matrices);
|
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||||
this.profilesList.render(matrices, mouseX, mouseY, delta);
|
this.renderBackground(context);
|
||||||
drawCenteredTextWithShadow(matrices, this.textRenderer, this.title.asOrderedText(), this.width / 2, 8, 16777215);
|
this.profilesList.render(context, mouseX, mouseY, delta);
|
||||||
super.render(matrices, mouseX, mouseY, delta);
|
context.drawCenteredTextWithShadow(textRenderer, this.title.asOrderedText(), this.width / 2, 8, 16777215);
|
||||||
|
super.render(context, mouseX, mouseY, delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@
|
||||||
"options-profiles.mixins.json"
|
"options-profiles.mixins.json"
|
||||||
],
|
],
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.14.19",
|
"fabricloader": ">=0.14.21",
|
||||||
"minecraft": "~1.19.3",
|
"minecraft": "~1.20",
|
||||||
"java": ">=17",
|
"java": ">=17",
|
||||||
"fabric-api": "*"
|
"fabric-api": "*"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue