-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 1.20.5-rc3 Quilt port (based on FAPI for now)
- Loading branch information
Showing
10 changed files
with
263 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ jobs: | |
1.20.4-forge/build/libs/ | ||
1.20.4-neoforge/build/libs/ | ||
1.20.5-fabric/build/libs/ | ||
1.20.5-quilt/build/libs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
plugins { | ||
id("dev.architectury.loom") version "1.6-SNAPSHOT" | ||
} | ||
|
||
java.sourceCompatibility = JavaVersion.VERSION_21 | ||
java.targetCompatibility = JavaVersion.VERSION_21 | ||
java.toolchain.languageVersion = JavaLanguageVersion.of(21) | ||
group = "ru.vidtu.ias" | ||
base.archivesName = "IAS-Quilt-1.20.5" | ||
evaluationDependsOn(":1.20.5") | ||
val shared = project(":1.20.5") | ||
|
||
repositories { | ||
mavenCentral() | ||
maven("https://maven.quiltmc.org/repository/release/") | ||
maven("https://maven.fabricmc.net/") | ||
maven("https://maven.terraformersmc.com/releases/") | ||
} | ||
|
||
loom { | ||
silentMojangMappingsLicense() | ||
runs.named("client") { | ||
vmArgs("-XX:+IgnoreUnrecognizedVMOptions", "-Xmx2G", "-XX:+AllowEnhancedClassRedefinition", "-XX:HotswapAgent=fatjar", "-Dfabric.debug.disableClassPathIsolation=true") | ||
} | ||
@Suppress("UnstableApiUsage") | ||
mixin { | ||
defaultRefmapName = "ias.mixins.refmap.json" | ||
} | ||
} | ||
|
||
dependencies { | ||
// Minecraft | ||
minecraft("com.mojang:minecraft:1.20.5-rc3") | ||
mappings(loom.officialMojangMappings()) | ||
|
||
// Quilt | ||
modImplementation(libs.quilt.loader) | ||
modImplementation("net.fabricmc.fabric-api:fabric-api:0.97.5+1.20.5") | ||
modImplementation("com.terraformersmc:modmenu:10.0.0-alpha.3") | ||
|
||
// Root | ||
compileOnly(shared) | ||
} | ||
|
||
tasks.withType<JavaCompile> { | ||
source(rootProject.sourceSets.main.get().java) | ||
source(shared.sourceSets.main.get().java) | ||
options.encoding = "UTF-8" | ||
options.release.set(21) | ||
} | ||
|
||
tasks.withType<ProcessResources> { | ||
from(rootProject.sourceSets.main.get().resources) | ||
from(shared.sourceSets.main.get().resources) | ||
inputs.property("version", project.version) | ||
filesMatching("quilt.mod.json") { | ||
expand("version" to project.version) | ||
} | ||
} | ||
|
||
tasks.withType<Jar> { | ||
from(rootDir.resolve("LICENSE")) | ||
from(rootDir.resolve("GPL")) | ||
manifest { | ||
attributes( | ||
"Specification-Title" to "In-Game Account Switcher", | ||
"Specification-Version" to project.version, | ||
"Specification-Vendor" to "VidTu", | ||
"Implementation-Title" to "IAS-Quilt-1.20.5", | ||
"Implementation-Version" to project.version, | ||
"Implementation-Vendor" to "VidTu", | ||
"MixinConfigs" to "ias.mixins.json" | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* In-Game Account Switcher is a mod for Minecraft that allows you to change your logged in account in-game, without restarting Minecraft. | ||
* Copyright (C) 2015-2022 The_Fireplace | ||
* Copyright (C) 2021-2024 VidTu | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/> | ||
*/ | ||
|
||
package ru.vidtu.ias; | ||
|
||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
import ru.vidtu.ias.screen.ConfigScreen; | ||
|
||
/** | ||
* Main IAS hook for ModMenu. | ||
* | ||
* @author VidTu | ||
*/ | ||
public final class IASModMenu implements ModMenuApi { | ||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() { | ||
return ConfigScreen::new; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* In-Game Account Switcher is a mod for Minecraft that allows you to change your logged in account in-game, without restarting Minecraft. | ||
* Copyright (C) 2015-2022 The_Fireplace | ||
* Copyright (C) 2021-2024 VidTu | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/> | ||
*/ | ||
|
||
package ru.vidtu.ias; | ||
|
||
import net.fabricmc.api.ClientModInitializer; | ||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; | ||
import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents; | ||
import net.fabricmc.fabric.api.client.screen.v1.Screens; | ||
import net.minecraft.client.gui.Font; | ||
import net.minecraft.client.gui.screens.TitleScreen; | ||
import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen; | ||
import org.quiltmc.loader.api.ModContainer; | ||
import org.quiltmc.loader.api.ModMetadata; | ||
import org.quiltmc.loader.api.QuiltLoader; | ||
import org.quiltmc.loader.api.Version; | ||
|
||
/** | ||
* Main IAS class for Quilt. | ||
* | ||
* @author VidTu | ||
*/ | ||
public final class IASQuilt implements ClientModInitializer { | ||
@Override | ||
public void onInitializeClient() { | ||
// Create the UA and initialize. | ||
String modVersion = QuiltLoader.getModContainer("ias") | ||
.map(ModContainer::metadata) | ||
.map(ModMetadata::version) | ||
.map(Version::raw) | ||
.orElse("UNKNOWN"); | ||
String loaderVersion = QuiltLoader.getModContainer("quilt_loader") | ||
.map(ModContainer::metadata) | ||
.map(ModMetadata::version) | ||
.map(Version::raw) | ||
.orElse("UNKNOWN"); | ||
IASMinecraft.init(QuiltLoader.getGameDir(), QuiltLoader.getConfigDir(), "Quilt", modVersion, loaderVersion); | ||
|
||
// Register closer. | ||
ClientLifecycleEvents.CLIENT_STOPPING.register(client -> IAS.close()); | ||
|
||
// Register screen handlers. | ||
ScreenEvents.AFTER_INIT.register((client, screen, width, height) -> { | ||
// Init. | ||
IASMinecraft.onInit(client, screen, Screens.getButtons(screen)::add); | ||
|
||
// Register drawer. | ||
if (screen instanceof TitleScreen || screen instanceof JoinMultiplayerScreen) { | ||
// Draw. | ||
Font font = client.font; | ||
ScreenEvents.afterRender(screen).register((scr, graphics, mouseX, mouseY, delta) -> IASMinecraft.onDraw(scr, font, graphics)); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"schema_version": 1, | ||
"quilt_loader": { | ||
"group": "ru.vidtu.ias", | ||
"id": "ias", | ||
"version": "${version}", | ||
"metadata": { | ||
"name": "In-Game Account Switcher", | ||
"description": "Allows you to change which account you are signed in to in-game without restarting Minecraft.", | ||
"license": "LGPL-3.0-or-later", | ||
"contributors": { | ||
"VidTu": "Current Maintainer", | ||
"The_Fireplace": "Original Mod Author", | ||
"The_BrainStone": "Contributor", | ||
"2xsaiko": "Contributor", | ||
"Elvm": "Contributor" | ||
}, | ||
"contact": { | ||
"homepage": "https://modrinth.com/mod/in-game-account-switcher", | ||
"sources": "https://github.com/The-Fireplace-Minecraft-Mods/In-Game-Account-Switcher", | ||
"issues": "https://github.com/The-Fireplace-Minecraft-Mods/In-Game-Account-Switcher/issues", | ||
"discord": "https://discord.gg/TpU2nEkSPk" | ||
}, | ||
"icon": "ias.png" | ||
}, | ||
"intermediate_mappings": "net.fabricmc:intermediary", | ||
"depends": [ | ||
{ | ||
"id": "quilt_loader", | ||
"versions": ">=0.24.0", | ||
"reason": "In-Game Account Switcher requires Quilt mod loader to be loaded." | ||
}, | ||
{ | ||
"id": "minecraft", | ||
"versions": "1.20.5-rc.3", | ||
"reason": "In-Game Account Switcher works only with Minecraft 1.20.5-rc3." | ||
}, | ||
{ | ||
"id": "fabric-api", | ||
"versions": ">=0.97.0", | ||
"reason": "In-Game Account Switcher requires Quilted Fabric API (QFAPI) and Quilt Standard Libraries (QSL) to add its button into the GUI." | ||
}, | ||
{ | ||
"id": "modmenu", | ||
"versions": ">=10.0.0", | ||
"reason": "In-Game Account Switcher recommends ModMenu for configuration access.", | ||
"optional": true | ||
}, | ||
{ | ||
"id": "java", | ||
"versions": ">=21", | ||
"reason": "In-Game Account Switcher makes use of modern Java in its code." | ||
} | ||
], | ||
"entrypoints": { | ||
"client": "ru.vidtu.ias.IASQuilt", | ||
"modmenu": "ru.vidtu.ias.IASModMenu" | ||
} | ||
}, | ||
"minecraft": { | ||
"environment": "client" | ||
}, | ||
"mixin": "ias.mixins.json", | ||
"modmenu": { | ||
"links": { | ||
"modmenu.modrinth": "https://modrinth.com/mod/in-game-account-switcher", | ||
"modmenu.curseforge": "https://curseforge.com/minecraft/mc-mods/in-game-account-switcher", | ||
"modmenu.github_releases": "https://github.com/The-Fireplace-Minecraft-Mods/In-Game-Account-Switcher/releases", | ||
"modmenu.discord": "https://discord.gg/TpU2nEkSPk", | ||
"ias.help.crypt": "https://github.com/The-Fireplace-Minecraft-Mods/In-Game-Account-Switcher/blob/main/docs/CRYPT.md", | ||
"ias.help.errors": "https://github.com/The-Fireplace-Minecraft-Mods/In-Game-Account-Switcher/blob/main/docs/ERRORS.md", | ||
"ias.help.stolen": "https://github.com/The-Fireplace-Minecraft-Mods/In-Game-Account-Switcher/blob/main/docs/STOLEN.md" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters