Changed version of the origin one
This commit is contained in:
@@ -1,33 +1,2 @@
|
||||
# IIpho3nix's Capes Mod
|
||||
## Description
|
||||
IIpho3nix's Capes Mod is a client-side Fabric mod designed for Minecraft version 1.20.4. This mod introduces the ability to use .png and .gif files as capes in the game.
|
||||
|
||||
## Usage
|
||||
Ensure Capes Folder Exists:
|
||||
Before proceeding, make sure the "Capes" folder is present in the ".minecraft" directory. If it doesn't exist, create it manually.
|
||||
|
||||
Download Capes:
|
||||
Obtain the cape designs you want in either .png or .gif format.
|
||||
|
||||
Place Capes in the Capes Folder:
|
||||
Move the downloaded cape files into the "Capes" folder in the ".minecraft" directory.
|
||||
|
||||
Launch Minecraft:
|
||||
Start Minecraft with the Fabric profile.
|
||||
|
||||
Access Main Menu:
|
||||
Once in the main menu, look for the "Change Cape" button.
|
||||
|
||||
Cycle through Capes:
|
||||
Press the "Change Cape" button until you find the cape you want to use. The cape currently in use is displayed at the top left corner of the screen.
|
||||
|
||||
Enjoy Your Custom Cape:
|
||||
Your selected cape will now be visible in-game, allowing you to showcase your unique style.
|
||||
|
||||
## Additional Notes
|
||||
|
||||
This mod is client-side, meaning only you can see the custom cape. Other players on the server won't be able to see your cape.
|
||||
|
||||
Ensure that the chosen cape files are in either .png or .gif format for compatibility with the mod.
|
||||
|
||||
Be cautious when downloading cape files from external sources to avoid potential security risks.
|
||||
# AuraClient Cloaks
|
||||
Thanks to `IIpho3nix` for making this mod.
|
||||
@@ -1,42 +0,0 @@
|
||||
package me.iipho3nix.iicapemod.mixin;
|
||||
|
||||
import me.iipho3nix.iicapemod.CapesMod;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.text.Text;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(TitleScreen.class)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class TitleScreenMixin extends Screen {
|
||||
protected TitleScreenMixin(Text title) {
|
||||
super(title);
|
||||
}
|
||||
|
||||
@Inject(at = @At("TAIL"), method = "init")
|
||||
private void init(CallbackInfo ci) {
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.literal("Change Cape"), (button) -> {
|
||||
if (CapesMod.list.indexOf(CapesMod.cape) + 1 == CapesMod.list.size()) {
|
||||
CapesMod.cape = CapesMod.list.get(0);
|
||||
CapesMod.capeCacheIdentifier = null;
|
||||
}else{
|
||||
CapesMod.cape = CapesMod.list.get(CapesMod.list.indexOf(CapesMod.cape) + 1);
|
||||
};
|
||||
}).dimensions((this.width / 2) - 205, (this.height / 4) + 96, 100, 20).build());
|
||||
}
|
||||
|
||||
@Inject(at = @At("TAIL"), method = "render")
|
||||
private void render(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
|
||||
context.drawText(textRenderer, "Cape: " + CapesMod.cape, 10, 10, 0xffffffff, true);
|
||||
}
|
||||
}
|
||||
+34
-24
@@ -1,9 +1,10 @@
|
||||
package me.iipho3nix.iicapemod;
|
||||
package org.auraclient.auracloaks;
|
||||
|
||||
import at.dhyan.open_imaging.GifDecoder;
|
||||
import me.iipho3nix.iicapemod.utils.AnimatedCapeData;
|
||||
import me.iipho3nix.iicapemod.utils.IdentifierUtils;
|
||||
import me.iipho3nix.iicapemod.utils.RandomUtils;
|
||||
import org.auraclient.auracloaks.event.KeyInputHandler;
|
||||
import org.auraclient.auracloaks.utils.AnimatedCapeData;
|
||||
import org.auraclient.auracloaks.utils.IdentifierUtils;
|
||||
import org.auraclient.auracloaks.utils.RandomUtils;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.Identifier;
|
||||
@@ -18,9 +19,14 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
public class CapesMod implements ModInitializer {
|
||||
public static final String MOD_ID = "iicapemod";
|
||||
/*
|
||||
* Massive thank you to IIpho3nix for making this mod, i (leo) have modified it to fit Aura Client
|
||||
*/
|
||||
|
||||
public class AuraCloaks implements ModInitializer {
|
||||
public static final String MOD_ID = "auracloaks";
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
||||
private static final File capesFolder = new File(MinecraftClient.getInstance().runDirectory, "Capes");
|
||||
public static final List<String> list = new ArrayList<>();
|
||||
@@ -29,38 +35,42 @@ public class CapesMod implements ModInitializer {
|
||||
private static long mili = System.currentTimeMillis();
|
||||
private static String lastCache = "NotCached";
|
||||
public static Identifier capeCacheIdentifier = null;
|
||||
public static String cape = "None";
|
||||
|
||||
public static String cape = "";
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
list.clear();
|
||||
list.add("None");
|
||||
list.add("");
|
||||
if (capesFolder.mkdir()) {
|
||||
LOGGER.info("New Cape Folder Created");
|
||||
downloadCloakTextures();
|
||||
} else {
|
||||
LOGGER.info("Cape Folder Already Exists");
|
||||
listFilesForFolder(capesFolder);
|
||||
}
|
||||
LOGGER.info("IIpho3nix's capes mod loaded!");
|
||||
loadCloakTextures();
|
||||
|
||||
KeyInputHandler.register();
|
||||
}
|
||||
|
||||
private static void listFilesForFolder(File folder) {
|
||||
for (final File fileEntry : folder.listFiles()) {
|
||||
if (fileEntry.isDirectory()) {
|
||||
listFilesForFolder(fileEntry);
|
||||
} else if (
|
||||
fileEntry.getName().endsWith(".png") ||
|
||||
fileEntry.getName().endsWith(".gif")
|
||||
) {
|
||||
list.add(fileEntry.getName());
|
||||
public void downloadCloakTextures() {
|
||||
// Todo: Download the cloak textures and put them in the Capes folder
|
||||
}
|
||||
|
||||
private static void loadCloakTextures() {
|
||||
if (capesFolder.isDirectory()) {
|
||||
for (final File fileEntry : Objects.requireNonNull(capesFolder.listFiles())) {
|
||||
if (
|
||||
fileEntry.getName().endsWith(".png") || fileEntry.getName().endsWith(".gif")
|
||||
) {
|
||||
list.add(fileEntry.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void tick() {
|
||||
if (!lastCache.equals(cape)) {
|
||||
if (!cape.equals("None")) {
|
||||
if (!cape.isEmpty()) {
|
||||
if (cape.endsWith(".gif")) {
|
||||
try {
|
||||
anicape.clear();
|
||||
@@ -103,9 +113,9 @@ public class CapesMod implements ModInitializer {
|
||||
if (cape.endsWith(".gif")) {
|
||||
if (capeindex > (anicape.size() - 1)) {
|
||||
capeindex = 0;
|
||||
}
|
||||
if (System.currentTimeMillis() > mili + anicape.get(capeindex).getDelay()) {
|
||||
mili = System.currentTimeMillis();
|
||||
}
|
||||
if (System.currentTimeMillis() > mili + anicape.get(capeindex).getDelay()) {
|
||||
mili = System.currentTimeMillis();
|
||||
capeCacheIdentifier = anicape.get(capeindex).getId();
|
||||
capeindex++;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.auraclient.auracloaks.event;
|
||||
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
import org.auraclient.auracloaks.AuraCloaks;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class KeyInputHandler {
|
||||
public static final String KEY_CATEGORY_CAPES = "key.category.auracloaks";
|
||||
public static final String KEY_CHANGE_CAPE = "key.auracloaks.change_cape";
|
||||
|
||||
public static KeyBinding changeCapeKey;
|
||||
|
||||
public static void register() {
|
||||
changeCapeKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
||||
KEY_CHANGE_CAPE, InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_N, KEY_CATEGORY_CAPES
|
||||
));
|
||||
|
||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||
if (changeCapeKey.wasPressed()) {
|
||||
if (AuraCloaks.list.indexOf(AuraCloaks.cape) + 1 == AuraCloaks.list.size()) {
|
||||
AuraCloaks.cape = AuraCloaks.list.get(0);
|
||||
AuraCloaks.capeCacheIdentifier = null;
|
||||
}else{
|
||||
AuraCloaks.cape = AuraCloaks.list.get(AuraCloaks.list.indexOf(AuraCloaks.cape) + 1);
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
package me.iipho3nix.iicapemod.mixin;
|
||||
package org.auraclient.auracloaks.mixin;
|
||||
|
||||
import me.iipho3nix.iicapemod.CapesMod;
|
||||
import org.auraclient.auracloaks.AuraCloaks;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
@@ -16,12 +16,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
public class AbstractClientPlayerEntityMixin {
|
||||
@Inject(at = @At("RETURN"), method = "getSkinTextures", cancellable = true)
|
||||
private void getSkinTextures(CallbackInfoReturnable<SkinTextures> cir) {
|
||||
if (((AbstractClientPlayerEntity) (Object) this) instanceof ClientPlayerEntity && CapesMod.capeCacheIdentifier != null) {
|
||||
if (((AbstractClientPlayerEntity) (Object) this) instanceof ClientPlayerEntity && AuraCloaks.capeCacheIdentifier != null) {
|
||||
SkinTextures textures = cir.getReturnValue();
|
||||
cir.setReturnValue(new SkinTextures(
|
||||
textures.texture(),
|
||||
textures.textureUrl(),
|
||||
CapesMod.capeCacheIdentifier,
|
||||
AuraCloaks.capeCacheIdentifier,
|
||||
textures.elytraTexture(),
|
||||
textures.model(),
|
||||
textures.secure()
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package me.iipho3nix.iicapemod.mixin;
|
||||
package org.auraclient.auracloaks.mixin;
|
||||
|
||||
import me.iipho3nix.iicapemod.CapesMod;
|
||||
import org.auraclient.auracloaks.AuraCloaks;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
@@ -14,6 +14,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
public class MinecraftClientMixin {
|
||||
@Inject(at = @At("HEAD"), method = "tick")
|
||||
private void tick(CallbackInfo ci) {
|
||||
CapesMod.tick();
|
||||
AuraCloaks.tick();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.iipho3nix.iicapemod.utils;
|
||||
package org.auraclient.auracloaks.utils;
|
||||
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.iipho3nix.iicapemod.utils;
|
||||
package org.auraclient.auracloaks.utils;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.texture.NativeImage;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.iipho3nix.iicapemod.utils;
|
||||
package org.auraclient.auracloaks.utils;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
+2
-3
@@ -1,12 +1,11 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "me.iipho3nix.iicapemod.mixin",
|
||||
"package": "org.auraclient.auracloaks.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"client": [
|
||||
"AbstractClientPlayerEntityMixin",
|
||||
"MinecraftClientMixin",
|
||||
"TitleScreenMixin"
|
||||
"MinecraftClientMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
@@ -1,26 +1,27 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "iicapemod",
|
||||
"id": "auracloaks",
|
||||
"version": "${version}",
|
||||
"name": "IIpho3nix's capes mod",
|
||||
"name": "Auracloaks",
|
||||
"description": "A local cape mod for fabric with support for animated capes",
|
||||
"authors": [
|
||||
"IIpho3nix"
|
||||
"IIpho3nix",
|
||||
"kleo-dev"
|
||||
],
|
||||
"contact": {
|
||||
"website": "https://iipho3nix.me",
|
||||
"sources": "https://github.com/IIpho3nix/IIpho3nix-s-Capes-Mod"
|
||||
},
|
||||
"license": "GPL-3.0",
|
||||
"icon": "assets/iicapemod/icon.png",
|
||||
"icon": "assets/auracloaks/icon.png",
|
||||
"environment": "client",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"me.iipho3nix.iicapemod.CapesMod"
|
||||
"org.auraclient.auracloaks.AuraCloaks"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"iicapemod.mixins.json"
|
||||
"auracloaks.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=${loader_version}",
|
||||
|
||||
Reference in New Issue
Block a user