Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CapeMod support #151

Open
wants to merge 1 commit into
base: architectury
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/src/main/kotlin/me/cael/capes/CapeConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class CapeConfig {
var enableMinecraftCapesMod = false
var enableCosmetica = false
var enableCloaksPlus = false
var enableCapeMod = false
var enableElytraTexture = true

fun save() {
Expand Down
6 changes: 4 additions & 2 deletions common/src/main/kotlin/me/cael/capes/CapeType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.screen.ScreenTexts
import net.minecraft.text.Text

enum class CapeType(val stylized: String) {
MINECRAFT("Minecraft"), OPTIFINE("OptiFine"), LABYMOD("LabyMod"), WYNNTILS("Wynntils"), MINECRAFTCAPES("MinecraftCapes"), COSMETICA("Cosmetica"), CLOAKSPLUS("Cloaks+");
MINECRAFT("Minecraft"), OPTIFINE("OptiFine"), LABYMOD("LabyMod"), WYNNTILS("Wynntils"), MINECRAFTCAPES("MinecraftCapes"), COSMETICA("Cosmetica"), CLOAKSPLUS("Cloaks+"), CAPEMOD("CapeMod");

fun cycle() = when(this) {
MINECRAFT -> OPTIFINE
Expand All @@ -14,7 +14,8 @@ enum class CapeType(val stylized: String) {
WYNNTILS -> COSMETICA
COSMETICA -> MINECRAFTCAPES
MINECRAFTCAPES -> CLOAKSPLUS
CLOAKSPLUS -> MINECRAFT
CLOAKSPLUS -> CAPEMOD
CAPEMOD -> MINECRAFT
}

fun getURL(profile: GameProfile): String? {
Expand All @@ -26,6 +27,7 @@ enum class CapeType(val stylized: String) {
COSMETICA -> if(config.enableCosmetica) "https://api.cosmetica.cc/get/cloak?username=${profile.name}&uuid=${profile.id}&nothirdparty" else null
MINECRAFTCAPES -> if(config.enableMinecraftCapesMod) "https://api.minecraftcapes.net/profile/${profile.id.toString().replace("-", "")}" else null
CLOAKSPLUS -> if(config.enableCloaksPlus) "http://161.35.130.99/capes/${profile.name}.png" else null
CAPEMOD -> if(config.enableCapeMod) "https://capes.capemod.com/api/cape/?uuid=${profile.id}" else null
MINECRAFT -> null
}
}
Expand Down
10 changes: 8 additions & 2 deletions common/src/main/kotlin/me/cael/capes/menu/ToggleMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,21 @@ class ToggleMenu(parent: Screen, gameOptions: GameOptions) : MainMenu(parent, ga
it.message = CapeType.CLOAKSPLUS.getToggleText(config.enableCloaksPlus)
}.position(width / 2 - 155 + 160, height / 7 + 3 * 24).size(150, 20).build())

addDrawableChild(ButtonWidget.builder(CapeType.CAPEMOD.getToggleText(config.enableCapeMod)) {
config.enableCapeMod = !config.enableCapeMod
config.save()
it.message = CapeType.CAPEMOD.getToggleText(config.enableCapeMod)
}.position(width / 2 - 155, height / 7 + 4 * 24).size(150, 20).build())

addDrawableChild(ButtonWidget.builder(elytraMessage(config.enableElytraTexture)) {
config.enableElytraTexture = !config.enableElytraTexture
config.save()
it.message = elytraMessage(config.enableElytraTexture)
}.position((width/2) - (200 / 2), height / 7 + 4 * 24).size(200, 20).build())
}.position((width/2) - (200 / 2), height / 7 + 5 * 24).size(200, 20).build())

addDrawableChild(ButtonWidget.builder(ScreenTexts.DONE) {
client!!.setScreen(parent)
}.position((width/2) - (200 / 2), height / 7 + 5 * 24).size(200, 20).build())
}.position((width/2) - (200 / 2), height / 7 + 6 * 24).size(200, 20).build())

}

Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "${version}",

"name": "Capes",
"description": "A mod that lets you use capes from Optifine, LabyMod, Cosmetica, Wynntils, Capes++, and the MinecraftCapes Mod.",
"description": "A mod that lets you use capes from Optifine, LabyMod, Cosmetica, Wynntils, Capes++, CapeMod, and the MinecraftCapes Mod.",
"authors": [
"Cael"
],
Expand Down