Skip to content

Commit

Permalink
Ported to 1.19 & Bumped Version
Browse files Browse the repository at this point in the history
  • Loading branch information
emonadeo committed Jun 13, 2022
1 parent 8819dc5 commit 98e2a67
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 46 deletions.
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id "fabric-loom" version "0.10-SNAPSHOT"
id "fabric-loom" version "0.12-SNAPSHOT"
id "maven-publish"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "1.2.1"
id "com.modrinth.minotaur" version "2.+"
}

sourceCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -93,7 +93,7 @@ curseforge {
changelogType = "text"
changelog = file("changelog.txt")

addGameVersion "1.18"
addGameVersion "1.19"
addGameVersion "Java 17"
addGameVersion "Fabric"

Expand All @@ -112,14 +112,14 @@ curseforge {
}
}

import com.modrinth.minotaur.TaskModrinthUpload
import com.modrinth.minotaur.dependencies.ModDependency

task publishModrinth (type: TaskModrinthUpload) {
modrinth {
token = project.hasProperty("modrinthApiKey") ? project.property("modrinthApiKey") : System.getenv("modrinthApiKey")
projectId = "2i7tg1Wv"
versionName = "v${project.mod_version} (Minecraft 1.18)"
versionName = "v${project.mod_version} (Minecraft 1.19)"
versionNumber = version
uploadFile = remapJar
addGameVersion "1.18"
addLoader "fabric"
gameVersions = ["1.19"]
loaders = ["fabric"]
}
7 changes: 1 addition & 6 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
* Added config option to toggle Auto-Jump automatically when Auto-Run is active
* Added german localization
* Changed localization from AutoRun to Auto-Run in parity with Auto-Jump
Name of the mod is still: AutoRun
Name of the action: Auto-Run
Confusing, I know
* Ported to 1.19
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.18
yarn_mappings=1.18+build.1
loader_version=0.12.8
minecraft_version=1.19
yarn_mappings=1.19+build.2
loader_version=0.14.7

# Mod Properties
mod_version=0.4.0
supported_versions=1.18.X
mod_version=0.5.0
supported_versions=1.19.X
maven_group=com.emonadeo
archives_base_name=autorun

# 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
modmenu_version=3.0.0
cloth_version=6.0.45
fabric_version=0.55.3+1.19
modmenu_version=4.0.0
cloth_version=7.0.69

# CurseGradle
project_id=279429
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/emonadeo/autorun/AutoRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ public static void enableAutoJump(MinecraftClient client) {
if (!toggleAutoJump)
return;

originalAutoJumpSetting = client.options.autoJump;
originalAutoJumpSetting = client.options.getAutoJump().getValue();

client.options.autoJump = true;
client.options.getAutoJump().setValue(true);
client.options.sendClientSettings();
}

public static void restoreAutoJump(MinecraftClient client) {
if (!toggleAutoJump)
return;

client.options.autoJump = originalAutoJumpSetting;
client.options.getAutoJump().setValue(originalAutoJumpSetting);
client.options.sendClientSettings();
}

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/emonadeo/autorun/AutoRunModMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import me.shedaniel.clothconfig2.api.ConfigCategory;
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.TranslatableText;
import net.minecraft.text.Text;

public class AutoRunModMenu implements ModMenuApi, ConfigScreenFactory<Screen> {
@Override
Expand All @@ -18,22 +18,22 @@ public ConfigScreenFactory<Screen> getModConfigScreenFactory() {
public Screen create(Screen screen) {
ConfigBuilder builder = ConfigBuilder.create()
.setParentScreen(screen)
.setTitle(new TranslatableText("title." + AutoRun.MODID + ".config"));
.setTitle(Text.translatable("title." + AutoRun.MODID + ".config"));

ConfigEntryBuilder entryBuilder = builder.entryBuilder();
ConfigCategory general = builder.getOrCreateCategory(new TranslatableText("config." + AutoRun.MODID + ".general"));
ConfigCategory general = builder.getOrCreateCategory(Text.translatable("config." + AutoRun.MODID + ".general"));

// Toogle Auto-Jump
general.addEntry(entryBuilder.startBooleanToggle(new TranslatableText("config." + AutoRun.MODID + ".toggleAutoJump"), AutoRun.isToggleAutoJump())
general.addEntry(entryBuilder.startBooleanToggle(Text.translatable("config." + AutoRun.MODID + ".toggleAutoJump"), AutoRun.isToggleAutoJump())
.setDefaultValue(true)
.setTooltip(new TranslatableText("config." + AutoRun.MODID + ".toggleAutoJump.description"))
.setTooltip(Text.translatable("config." + AutoRun.MODID + ".toggleAutoJump.description"))
.setSaveConsumer(AutoRun::setToggleAutoJump)
.build());

// Delay Buffer
general.addEntry(entryBuilder.startIntField(new TranslatableText("config." + AutoRun.MODID + ".delayBuffer"), AutoRun.getDelayBuffer())
general.addEntry(entryBuilder.startIntField(Text.translatable("config." + AutoRun.MODID + ".delayBuffer"), AutoRun.getDelayBuffer())
.setDefaultValue(20)
.setTooltip(new TranslatableText("config." + AutoRun.MODID + ".delayBuffer.description"))
.setTooltip(Text.translatable("config." + AutoRun.MODID + ".delayBuffer.description"))
.setSaveConsumer(AutoRun::setDelayBuffer)
.build());

Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/emonadeo/autorun/MovementDirection.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ public enum MovementDirection {
public KeyBinding getKeyBinding(MinecraftClient client) {
switch (this) {
default:
return client.options.keyForward;
return client.options.forwardKey;
case BACK:
return client.options.keyBack;
return client.options.backKey;
case LEFT:
return client.options.keyLeft;
return client.options.leftKey;
case RIGHT:
return client.options.keyRight;
return client.options.rightKey;
}
}

public Set<KeyBinding> getTerminators(MinecraftClient client) {
switch (this) {
default:
return Stream.of(
client.options.keyForward,
client.options.keyBack)
client.options.forwardKey,
client.options.backKey)
.collect(Collectors.toSet());
case LEFT:
case RIGHT:
return Stream.of(
client.options.keyLeft,
client.options.keyRight)
client.options.leftKey,
client.options.rightKey)
.collect(Collectors.toSet());
}
}
Expand Down
9 changes: 3 additions & 6 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"license": "CC0-1.0",
"icon": "assets/autorun/icon.png",

"environment": "*",
"environment": "client",
"entrypoints": {
"client": [ "com.emonadeo.autorun.AutoRun" ],
"modmenu": [ "com.emonadeo.autorun.AutoRunModMenu" ]
Expand All @@ -26,11 +26,8 @@
],

"depends": {
"fabricloader": ">=0.11.3",
"fabricloader": ">=0.14.7",
"fabric": "*",
"minecraft": "1.18.x"
},
"custom": {
"modmenu:clientsideOnly": true
"minecraft": "1.19.x"
}
}

0 comments on commit 98e2a67

Please sign in to comment.