diff --git a/cambios.md b/cambios.md index 64f3481..e251d78 100644 --- a/cambios.md +++ b/cambios.md @@ -1,17 +1,18 @@ -# v2.3 +# v2.4 ## novedades -- renombrado el mod a sputnik porque esmegma o cameratweaks era un asco y sputnik ta to wapo +ahora se usa el formato binario (.dat) en vez de .json para guardar ajustes, lo que los hace más rápidos, y el archivo más liviano ### adiciones #### módulos nuevos: +- capas: cambia (solo visualmente, para ti) la capa que usas a una custom de las disponibles + ### arreglos / mejoras -- ahora tienes un múltiplo en críticos, es decir, un número por el que se multiplica la cantidad de partículas a generar -- ya no se guardan los ajustes mientras se cargan +- renombrado bien todo que lo hice con prisa ## problemas reconocidos diff --git a/gradle.properties b/gradle.properties index f3f3366..74a4a2b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -org.gradle.jvmargs=-Xmx1G +org.gradle.jvmargs=-Xmx2G org.gradle.parallel=true minecraft_version=1.21.11 @@ -8,6 +8,6 @@ loom_version=1.13-SNAPSHOT fabric_api_version=0.140.2+1.21.11 -mod_version=2.3 +mod_version=2.4 maven_group=me.retucio archives_base_name=sputnik \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/Sputnik.java b/src/main/java/me/retucio/sputnik/Sputnik.java index d6fea20..c846429 100644 --- a/src/main/java/me/retucio/sputnik/Sputnik.java +++ b/src/main/java/me/retucio/sputnik/Sputnik.java @@ -1,6 +1,7 @@ package me.retucio.sputnik; +import me.retucio.sputnik.cape.CapeManager; import me.retucio.sputnik.command.CommandManager; import me.retucio.sputnik.command.commands.BindCommand; @@ -9,14 +10,15 @@ import me.retucio.sputnik.config.ConfigManager; import me.retucio.sputnik.event.EventBus; import me.retucio.sputnik.event.SubscribeEvent; import me.retucio.sputnik.event.events.ShutdownEvent; - +import me.retucio.sputnik.event.events.sputnik.LoadCapeManagerEvent; import me.retucio.sputnik.event.events.sputnik.LoadClickGUIEvent; import me.retucio.sputnik.event.events.sputnik.LoadCommandManagerEvent; import me.retucio.sputnik.event.events.sputnik.LoadModuleManagerEvent; + import me.retucio.sputnik.module.Module; import me.retucio.sputnik.module.ModuleManager; - import me.retucio.sputnik.module.modules.client.HUD; + import me.retucio.sputnik.ui.screen.ClickGUI; import me.retucio.sputnik.ui.hud.HudEditorScreen; import me.retucio.sputnik.ui.widgets.buttons.settings.BindButton; @@ -24,21 +26,19 @@ import me.retucio.sputnik.ui.widgets.buttons.SettingButton; import me.retucio.sputnik.ui.widgets.buttons.settings.TextButton; import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame; import me.retucio.sputnik.ui.widgets.frames.SettingsFrame; - import me.retucio.sputnik.ui.widgets.Button; + import me.retucio.sputnik.util.*; - - import me.retucio.sputnik.util.render.DrawUtil; import me.retucio.sputnik.util.render.RenderUtil; -import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.api.ClientModInitializer; import net.fabricmc.loader.api.FabricLoader; + import net.minecraft.SharedConstants; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.ChatScreen; import net.minecraft.client.gui.screen.Screen; - import net.minecraft.client.gui.screen.ingame.AbstractCommandBlockScreen; import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen; import net.minecraft.client.gui.screen.ingame.AnvilScreen; @@ -86,6 +86,9 @@ public class Sputnik implements ClientModInitializer { Lists.init(); + CapeManager.INSTANCE = new CapeManager(); + EVENT_BUS.post(new LoadCapeManagerEvent()); + ModuleManager.INSTANCE = new ModuleManager(); EVENT_BUS.post(new LoadModuleManagerEvent()); diff --git a/src/main/java/me/retucio/sputnik/cape/Cape.java b/src/main/java/me/retucio/sputnik/cape/Cape.java new file mode 100644 index 0000000..7377cad --- /dev/null +++ b/src/main/java/me/retucio/sputnik/cape/Cape.java @@ -0,0 +1,61 @@ +package me.retucio.sputnik.cape; + +import me.retucio.sputnik.Sputnik; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.texture.NativeImage; +import net.minecraft.client.texture.NativeImageBackedTexture; +import net.minecraft.util.Identifier; + +import java.io.IOException; +import java.io.InputStream; + +public class Cape { + + private final MinecraftClient mc = MinecraftClient.getInstance(); + + private final String name; + private final Identifier id; + private NativeImage img; + private NativeImageBackedTexture texture; + + public Cape(String name) { + this.name = name; + this.id = Identifier.of(Sputnik.MOD_ID, "textures/capes/" + name + ".png"); + } + + public void load() { + this.img = loadTexture(this.id); + } + + public NativeImage loadTexture(Identifier id) { + try (InputStream inputStream = mc.getResourceManager().getResource(id).get().getInputStream()) { + return NativeImage.read(inputStream); + } catch (IOException e) { + Sputnik.LOGGER.error("ups: {}", e.getMessage()); + return null; + } + } + + public void register() { + texture = new NativeImageBackedTexture(null, img); + mc.getTextureManager().registerTexture(id, texture); + img = null; + } + + public String getName() { + return name; + } + + public Identifier getId() { + return id; + } + + public NativeImageBackedTexture getTexture() { + return texture; + } + + @Override + public String toString() { + return name.replace('-', ' '); + } +} \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/cape/CapeManager.java b/src/main/java/me/retucio/sputnik/cape/CapeManager.java new file mode 100644 index 0000000..6f1e196 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/cape/CapeManager.java @@ -0,0 +1,87 @@ +package me.retucio.sputnik.cape; + +import java.util.ArrayList; +import java.util.List; + +import static me.retucio.sputnik.Sputnik.mc; + +public class CapeManager { + + public static CapeManager INSTANCE; + + private final List capes = new ArrayList<>(); + + public CapeManager() { + addCapes(); + } + + public void addCapes() { + addCape("sputnik"); + addCape("half-life"); + addCape("hollow-knight"); + + addCape("cherry-blossom"); + addCape("migrator"); + addCape("minecraft"); + addCape("pancakes"); + addCape("vanilla"); + + addCape("tiktok"); + addCape("twitch"); + + addCape("mojang"); + addCape("mojang-old"); + addCape("mojang-old-old"); + + addCape("minecon-2011"); + addCape("minecon-2012"); + addCape("minecon-2013"); + addCape("minecon-2015"); + addCape("minecon-2016"); + addCape("experience-2025"); + + addCape("15th-anniversary"); + addCape("bedrock"); + addCape("birthday"); + addCape("copper"); + addCape("eye-blossom"); + addCape("mcc-15"); + addCape("prismarine"); + addCape("turtle"); + addCape("valentine"); + + addCape("chinese-translator"); + addCape("cobalt"); + addCape("mojira-mod"); + addCape("millionth-customer"); + addCape("realms-mapmaker"); + addCape("scrolls-champion"); + addCape("translator"); + + addCape("cheapsh0t"); + addCape("dannybstyle"); + addCape("julianclark"); + addCape("mrmessiah"); + + for (Cape cape : capes) { + mc.execute(cape::load); + mc.execute(cape::register); + } + } + + private void addCape(String name) { + capes.add(new Cape(name)); + } + + public Cape getCape(String name) { + for (Cape cape : capes) + if (cape.getName().equalsIgnoreCase(name)) + return cape; + + return null; + } + + public List getCapes() { + return capes; + } +} \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/command/CommandManager.java b/src/main/java/me/retucio/sputnik/command/CommandManager.java index 5e38ecb..2dd47e3 100644 --- a/src/main/java/me/retucio/sputnik/command/CommandManager.java +++ b/src/main/java/me/retucio/sputnik/command/CommandManager.java @@ -2,6 +2,7 @@ package me.retucio.sputnik.command; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.exceptions.CommandSyntaxException; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.command.commands.*; import me.retucio.sputnik.event.SubscribeEvent; import net.minecraft.client.MinecraftClient; @@ -47,7 +48,7 @@ public class CommandManager { for (Command command : commands) { for (Method method : command.getClass().getDeclaredMethods()) { if (method.isAnnotationPresent(SubscribeEvent.class)) { - me.retucio.sputnik.Sputnik.EVENT_BUS.register(command); + Sputnik.EVENT_BUS.register(command); break; } } diff --git a/src/main/java/me/retucio/sputnik/command/args/EntityArgumentType.java b/src/main/java/me/retucio/sputnik/command/args/EntityArgumentType.java index 8ff83f2..5c17ce7 100644 --- a/src/main/java/me/retucio/sputnik/command/args/EntityArgumentType.java +++ b/src/main/java/me/retucio/sputnik/command/args/EntityArgumentType.java @@ -17,9 +17,10 @@ import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.regex.Pattern; -// para autocompletar entidades import static me.retucio.sputnik.Sputnik.mc; + +// para autocompletar entidades public class EntityArgumentType implements ArgumentType { public static final EntityArgumentType INSTANCE = new EntityArgumentType(); diff --git a/src/main/java/me/retucio/sputnik/command/commands/PurgeCommand.java b/src/main/java/me/retucio/sputnik/command/commands/PurgeCommand.java index b5cae1d..10d8696 100644 --- a/src/main/java/me/retucio/sputnik/command/commands/PurgeCommand.java +++ b/src/main/java/me/retucio/sputnik/command/commands/PurgeCommand.java @@ -31,7 +31,7 @@ public class PurgeCommand extends Command { ChatHud chatHud = mc.inGameHud.getChatHud(); synchronized (chatHud) { - List visibleMessages = ((IChatHud) chatHud).smegma$getVisibleMessages(); + List visibleMessages = ((IChatHud) chatHud).sputnik$getVisibleMessages(); int toRemove = Math.min(amount, visibleMessages.size()); for (int i = 0; i < toRemove; i++) visibleMessages.removeFirst(); diff --git a/src/main/java/me/retucio/sputnik/config/BinarySerializer.java b/src/main/java/me/retucio/sputnik/config/BinarySerializer.java new file mode 100644 index 0000000..2d343ce --- /dev/null +++ b/src/main/java/me/retucio/sputnik/config/BinarySerializer.java @@ -0,0 +1,357 @@ +package me.retucio.sputnik.config; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; + +public class BinarySerializer { + + private static final int MAGIC_NUMBER = 0x53505554; // "SPUT" + private static final int VERSION = 1; + + private static final byte TYPE_NULL = 0; + private static final byte TYPE_BOOLEAN = 1; + private static final byte TYPE_INT = 2; + private static final byte TYPE_DOUBLE = 3; + private static final byte TYPE_STRING = 4; + private static final byte TYPE_MAP = 5; + private static final byte TYPE_INT_ARRAY = 6; + private static final byte TYPE_FRAME_DATA = 7; + + public static void writeConfig(ClientConfig config, File file) + throws IOException { + try (DataOutputStream out = new DataOutputStream( + new BufferedOutputStream(new FileOutputStream(file)))) { + + // cabezal + out.writeInt(MAGIC_NUMBER); + out.writeInt(VERSION); + + // mapas + writeStringBooleanMap(out, config.moduleStates); + writeSettingsMap(out, config.settings); + writeStringIntArrayMap(out, config.settingsFrames); + writeExtendableFrames(out, config.extendableFrames); + writeStringIntArrayMap(out, config.hudPositions); + writeStringBooleanMap(out, config.hudVisibilities); + writeStringStringMap(out, config.hudImagePaths); + + // posición de la barra de búsqueda + if (config.searchBarPosition != null) { + out.writeBoolean(true); + out.writeInt(config.searchBarPosition[0]); + out.writeInt(config.searchBarPosition[1]); + } else { + out.writeBoolean(false); + } + } + } + + public static ClientConfig readConfig(File file) + throws IOException { + if (!file.exists() || file.length() == 0) { + throw new IOException("archivo de config. vacío o inexistente"); + } + + try (DataInputStream in = new DataInputStream( + new BufferedInputStream(new FileInputStream(file)))) { + + if (file.length() < 8) { + throw new IOException("archivo demasiado pequeño para ser válido"); + } + + // verificar cabezal + int magic = in.readInt(); + if (magic != MAGIC_NUMBER) { + throw new IOException("formato de archivo inválido: " + magic); + } + + int version = in.readInt(); + if (version != VERSION) { + throw new IOException("versión inválida: " + version); + } + + ClientConfig config = new ClientConfig(); + + // leer mapas + config.moduleStates = readStringBooleanMap(in); + config.settings = readSettingsMap(in); + config.settingsFrames = readStringIntArrayMap(in); + config.extendableFrames = readExtendableFrames(in); + config.hudPositions = readStringIntArrayMap(in); + config.hudVisibilities = readStringBooleanMap(in); + config.hudImagePaths = readStringStringMap(in); + + // leer pos. de la barra de búsqueda + if (in.readBoolean()) { + config.searchBarPosition = new int[]{in.readInt(), in.readInt()}; + } + + return config; + } + } + + private static void writeStringBooleanMap(DataOutputStream out, Map map) + throws IOException { + if (map == null) { + out.writeInt(0); + return; + } + out.writeInt(map.size()); + for (Map.Entry entry : map.entrySet()) { + writeString(out, entry.getKey()); + out.writeBoolean(entry.getValue()); + } + } + + private static Map readStringBooleanMap(DataInputStream in) + throws IOException { + int size = in.readInt(); + Map map = new HashMap<>(size); + for (int i = 0; i < size; i++) { + String key = readString(in); + boolean value = in.readBoolean(); + map.put(key, value); + } + return map; + } + + private static void writeSettingsMap(DataOutputStream out, Map map) + throws IOException { + if (map == null) { + out.writeInt(0); + return; + } + out.writeInt(map.size()); + for (Map.Entry entry : map.entrySet()) { + writeString(out, entry.getKey()); + writeSettingValue(out, entry.getValue()); + } + } + + private static Map readSettingsMap(DataInputStream in) + throws IOException { + int size = in.readInt(); + Map map = new HashMap<>(size); + for (int i = 0; i < size; i++) { + String key = readString(in); + Object value = readSettingValue(in); + map.put(key, value); + } + return map; + } + + private static void writeSettingValue(DataOutputStream out, Object value) + throws IOException { + switch (value) { + case Boolean b -> { + out.writeByte(TYPE_BOOLEAN); + out.writeBoolean(b); + } + case Integer i -> { + out.writeByte(TYPE_INT); + out.writeInt(i); + } + case Double v -> { + out.writeByte(TYPE_DOUBLE); + out.writeDouble(v); + } + case String s -> { + out.writeByte(TYPE_STRING); + writeString(out, s); + } + case Map map -> { + out.writeByte(TYPE_MAP); + writeGenericMap(out, map); + } // fallback + case null, default -> out.writeByte(TYPE_NULL); + } + } + + private static Object readSettingValue(DataInputStream in) throws IOException { + byte type = in.readByte(); + return switch (type) { + case TYPE_BOOLEAN -> in.readBoolean(); + case TYPE_INT -> in.readInt(); + case TYPE_DOUBLE -> in.readDouble(); + case TYPE_STRING -> readString(in); + case TYPE_MAP -> readGenericMap(in); + default -> null; + }; + } + + private static void writeGenericMap(DataOutputStream out, Map map) + throws IOException { + if (map == null) { + out.writeInt(0); + return; + } + out.writeInt(map.size()); + for (Map.Entry entry : map.entrySet()) { + writeObject(out, entry.getKey()); + writeObject(out, entry.getValue()); + } + } + + private static Map readGenericMap(DataInputStream in) + throws IOException { + int size = in.readInt(); + Map map = new HashMap<>(size); + for (int i = 0; i < size; i++) { + Object key = readObject(in); + Object value = readObject(in); + map.put(key, value); + } + return map; + } + + private static void writeObject(DataOutputStream out, Object obj) + throws IOException { + switch (obj) { + case String s -> { + out.writeByte(TYPE_STRING); + writeString(out, s); + } + case Boolean b -> { + out.writeByte(TYPE_BOOLEAN); + out.writeBoolean(b); + } + case Number number -> { + if (obj instanceof Integer) { + out.writeByte(TYPE_INT); + out.writeInt((Integer) obj); + } else if (obj instanceof Double) { + out.writeByte(TYPE_DOUBLE); + out.writeDouble((Double) obj); + } + } + default -> { + out.writeByte(TYPE_STRING); + writeString(out, obj.toString()); + } + } + } + + private static Object readObject(DataInputStream in) throws IOException { + byte type = in.readByte(); + return switch (type) { + case TYPE_STRING -> readString(in); + case TYPE_BOOLEAN -> in.readBoolean(); + case TYPE_INT -> in.readInt(); + case TYPE_DOUBLE -> in.readDouble(); + default -> null; + }; + } + + private static void writeStringIntArrayMap(DataOutputStream out, Map map) + throws IOException { + if (map == null) { + out.writeInt(0); + return; + } + out.writeInt(map.size()); + for (Map.Entry entry : map.entrySet()) { + writeString(out, entry.getKey()); + int[] array = entry.getValue(); + if (array == null) { + out.writeInt(0); + } else { + out.writeInt(array.length); + for (int value : array) { + out.writeInt(value); + } + } + } + } + + private static Map readStringIntArrayMap(DataInputStream in) + throws IOException { + int size = in.readInt(); + Map map = new HashMap<>(size); + for (int i = 0; i < size; i++) { + String key = readString(in); + int arraySize = in.readInt(); + int[] array = new int[arraySize]; + for (int j = 0; j < arraySize; j++) { + array[j] = in.readInt(); + } + map.put(key, array); + } + return map; + } + + private static void writeExtendableFrames(DataOutputStream out, Map map) + throws IOException { + if (map == null) { + out.writeInt(0); + return; + } + out.writeInt(map.size()); + for (Map.Entry entry : map.entrySet()) { + writeString(out, entry.getKey()); + ClientConfig.FrameData data = entry.getValue(); + out.writeInt(data.x()); + out.writeInt(data.y()); + out.writeBoolean(data.extended()); + } + } + + private static Map readExtendableFrames(DataInputStream in) + throws IOException { + int size = in.readInt(); + Map map = new HashMap<>(size); + for (int i = 0; i < size; i++) { + String key = readString(in); + int x = in.readInt(); + int y = in.readInt(); + boolean extended = in.readBoolean(); + map.put(key, new ClientConfig.FrameData(x, y, extended)); + } + return map; + } + + private static void writeStringStringMap(DataOutputStream out, Map map) + throws IOException { + if (map == null) { + out.writeInt(0); + return; + } + out.writeInt(map.size()); + for (Map.Entry entry : map.entrySet()) { + writeString(out, entry.getKey()); + writeString(out, entry.getValue()); + } + } + + private static Map readStringStringMap(DataInputStream in) + throws IOException { + int size = in.readInt(); + Map map = new HashMap<>(size); + for (int i = 0; i < size; i++) { + String key = readString(in); + String value = readString(in); + map.put(key, value); + } + return map; + } + + // Optimized string writing (UTF-8 with length prefix) + private static void writeString(DataOutputStream out, String str) throws IOException { + if (str == null) { + out.writeInt(-1); + return; + } + byte[] bytes = str.getBytes(StandardCharsets.UTF_8); + out.writeInt(bytes.length); + out.write(bytes); + } + + private static String readString(DataInputStream in) throws IOException { + int length = in.readInt(); + if (length == -1) return null; + byte[] bytes = new byte[length]; + in.readFully(bytes); + return new String(bytes, "UTF-8"); + } +} diff --git a/src/main/java/me/retucio/sputnik/config/ClientConfig.java b/src/main/java/me/retucio/sputnik/config/ClientConfig.java index 2a6e866..1652c34 100644 --- a/src/main/java/me/retucio/sputnik/config/ClientConfig.java +++ b/src/main/java/me/retucio/sputnik/config/ClientConfig.java @@ -5,6 +5,8 @@ import me.retucio.sputnik.event.events.sputnik.*; import me.retucio.sputnik.module.settings.*; import me.retucio.sputnik.ui.screen.ClickGUI; +import java.io.Serial; +import java.io.Serializable; import java.util.HashMap; import java.util.Map; @@ -62,7 +64,7 @@ public class ClientConfig { case StringSetting s: value = s.getValue(); break; case ListSetting l: value = l.getConfigValues(); break; case ColorSetting c: value = c.getConfigValue(); break; - case OptionSetting o: value = o.getIndex(); break; + case OptionSetting o: value = o.getDisplayName(); break; default: break; } @@ -71,7 +73,6 @@ public class ClientConfig { @SubscribeEvent public void onOpenSettingsFrame(SettingsFrameEvent.Open event) { - if (settingsFrames.containsKey(event.getFrame().module.getName())) return; ConfigManager.setFramePosition(event.getFrame()); } @@ -119,5 +120,7 @@ public class ClientConfig { ClickGUI.INSTANCE.getGuiSettingsFrame().extended)); } - public record FrameData(int x, int y, boolean extended) {} + public record FrameData(int x, int y, boolean extended) implements Serializable { + @Serial private static final long serialVersionUID = 1L; + } } diff --git a/src/main/java/me/retucio/sputnik/config/ConfigManager.java b/src/main/java/me/retucio/sputnik/config/ConfigManager.java index f77b877..1795e6a 100644 --- a/src/main/java/me/retucio/sputnik/config/ConfigManager.java +++ b/src/main/java/me/retucio/sputnik/config/ConfigManager.java @@ -2,6 +2,7 @@ package me.retucio.sputnik.config; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.module.Module; import me.retucio.sputnik.module.ModuleManager; import me.retucio.sputnik.module.settings.*; @@ -10,20 +11,20 @@ import me.retucio.sputnik.ui.widgets.frames.ModuleFrame; import me.retucio.sputnik.ui.screen.ClickGUI; import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame; import me.retucio.sputnik.ui.widgets.frames.SettingsFrame; +import me.retucio.sputnik.util.ChatUtil; import java.io.File; import java.io.FileReader; -import java.io.FileWriter; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.Map; // se ocupa de guardar, cargar y aplicar ajustes -// pues no me ha dado dolores de cabeza el coso este con los NPE de los cojones... public class ConfigManager { - private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); - private static final File CONFIG_FILE = new File("sputnik.json"); + private static final File CONFIG_FILE = new File("sputnik.dat"); + private static final File LEGACY_JSON_FILE = new File("sputnik.json"); private static boolean loaded = false; private static ClientConfig config = null; @@ -36,31 +37,44 @@ public class ConfigManager { if (!loaded) return; ensureConfig(); - try (FileWriter writer = new FileWriter(CONFIG_FILE)) { - GSON.toJson(config, writer); - me.retucio.sputnik.Sputnik.LOGGER.info("ajustes guardados"); + try { + BinarySerializer.writeConfig(config, CONFIG_FILE); + Sputnik.LOGGER.info("ajustes guardados"); } catch (IOException e) { - me.retucio.sputnik.Sputnik.LOGGER.error("error al guardar ajustes", e); + Sputnik.LOGGER.error("error al guardar ajustes", e); } } - // cargar configuraciones public static void load() { - me.retucio.sputnik.Sputnik.LOGGER.info("cargando ajustes..."); + Sputnik.LOGGER.info("cargando ajustes..."); - if (!CONFIG_FILE.exists()) { - ensureConfig(); - save(); - return; + if (CONFIG_FILE.exists()) { + try { + config = BinarySerializer.readConfig(CONFIG_FILE); + Sputnik.LOGGER.info("ajustes cargados"); + return; + } catch (IOException e) { + Sputnik.LOGGER.error("error cargando ajustes, intentando json", e); + } } - try (FileReader reader = new FileReader(CONFIG_FILE)) { - config = GSON.fromJson(reader, ClientConfig.class); - me.retucio.sputnik.Sputnik.LOGGER.info("ajustes cargados"); - } catch (IOException e) { - me.retucio.sputnik.Sputnik.LOGGER.error("no se pudieron cargar los ajustes, usando ajustes por defecto", e); - ensureConfig(); + // Fallback to legacy JSON + if (LEGACY_JSON_FILE.exists()) { + try (FileReader reader = new FileReader(LEGACY_JSON_FILE)) { + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + config = gson.fromJson(reader, ClientConfig.class); + Sputnik.LOGGER.info("ajustes json cargados (migración)"); + + save(); + return; + } catch (IOException e) { + Sputnik.LOGGER.error("error cargando json, usando defaults", e); + } } + + // crear nuevo config + ensureConfig(); + save(); } // aplicar configuraciones cargadas @@ -75,7 +89,7 @@ public class ConfigManager { applyExtendableFrames(); loaded = true; - me.retucio.sputnik.Sputnik.LOGGER.info("ajustes aplicados"); + Sputnik.LOGGER.info("ajustes aplicados"); } // obtener configuración actual @@ -101,7 +115,10 @@ public class ConfigManager { public static void setFramePosition(SettingsFrame frame) { ensureConfig(); - config.settingsFrames.put(frame.module.getName(), new int[] {frame.getX(), frame.getY()}); + if (!config.settingsFrames.containsKey(frame.module.getName())) + config.settingsFrames.put(frame.module.getName(), new int[] {frame.getX(), frame.getY()}); + else + config.settingsFrames.replace(frame.module.getName(), new int[] {frame.getX(), frame.getY()}); save(); } @@ -160,7 +177,7 @@ public class ConfigManager { case ListSetting listSetting -> applyListSetting(listSetting, value); case ColorSetting colorSetting -> applyColorSetting(colorSetting, value); case OptionSetting optionSetting -> applyOptionSetting(optionSetting, value); - default -> me.retucio.sputnik.Sputnik.LOGGER.warn("watafac queseso: {}", setting.getClass().getSimpleName()); + default -> Sputnik.LOGGER.warn("watafac queseso: {}", setting.getClass().getSimpleName()); } } @@ -170,14 +187,14 @@ public class ConfigManager { module.setEnabled(config.moduleStates.get(module.getName())); } }); - me.retucio.sputnik.Sputnik.LOGGER.info("estados de módulos aplicados"); + Sputnik.LOGGER.info("estados de módulos aplicados"); } private static void applyModuleSettings() { ModuleManager.INSTANCE.getModules().forEach(module -> { module.getSettings().forEach(setting -> applySetting(module, setting)); }); - me.retucio.sputnik.Sputnik.LOGGER.info("ajustes de módulos aplicados"); + Sputnik.LOGGER.info("ajustes de módulos aplicados"); } private static void applySettingsFrames() { @@ -185,7 +202,7 @@ public class ConfigManager { Module module = ModuleManager.INSTANCE.getModuleByName(moduleName); ClickGUI.INSTANCE.openSettingsFrame(module, position[0], position[1]); }); - me.retucio.sputnik.Sputnik.LOGGER.info("estados de marcos de ajustes aplicados"); + Sputnik.LOGGER.info("estados de marcos de ajustes aplicados"); } private static void applySearchBarPosition() { @@ -193,7 +210,7 @@ public class ConfigManager { ClickGUI.INSTANCE.getSearchBar().setX(config.searchBarPosition[0]); ClickGUI.INSTANCE.getSearchBar().setY(config.searchBarPosition[1]); } - me.retucio.sputnik.Sputnik.LOGGER.info("posición de la barra de búsqueda aplicada"); + Sputnik.LOGGER.info("posición de la barra de búsqueda aplicada"); } private static void applyGuiSettings() { @@ -201,14 +218,14 @@ public class ConfigManager { ClientSettingsFrame.guiSettings.getSettings().forEach(setting -> { applySetting(ClientSettingsFrame.guiSettings, setting); }); - me.retucio.sputnik.Sputnik.LOGGER.info("ajustes del cliente aplicados"); + Sputnik.LOGGER.info("ajustes del cliente aplicados"); } private static void applyExtendableFrames() { applyExtendableFrame(ClickGUI.INSTANCE.getModulesFrame()); applyExtendableFrame(ClickGUI.INSTANCE.getGuiSettingsFrame()); - me.retucio.sputnik.Sputnik.LOGGER.info("posiciones de marcos extendibles aplicadasa"); + Sputnik.LOGGER.info("posiciones de marcos extendibles aplicadas"); ClickGUI.INSTANCE.refreshListButtons(); } @@ -299,9 +316,8 @@ public class ConfigManager { } private static void applyOptionSetting(OptionSetting setting, Object value) { - if (value instanceof Double) { - int index = ((Double) value).intValue(); - setting.setValue(setting.getOption(index)); + if (value instanceof String name) { + setting.setValueByName(name); } } @@ -316,10 +332,9 @@ public class ConfigManager { // ------------------ MÉTODOS DE AYUDA ------------------ private static boolean shouldApply() { - return me.retucio.sputnik.Sputnik.mc != null && ModuleManager.INSTANCE != null && config != null; + return Sputnik.mc != null && ModuleManager.INSTANCE != null && config != null; } - private static void ensureConfig() { if (config == null) config = new ClientConfig(); } diff --git a/src/main/java/me/retucio/sputnik/event/JoinWorldEvent.java b/src/main/java/me/retucio/sputnik/event/events/JoinWorldEvent.java similarity index 81% rename from src/main/java/me/retucio/sputnik/event/JoinWorldEvent.java rename to src/main/java/me/retucio/sputnik/event/events/JoinWorldEvent.java index 343fe38..c095403 100644 --- a/src/main/java/me/retucio/sputnik/event/JoinWorldEvent.java +++ b/src/main/java/me/retucio/sputnik/event/events/JoinWorldEvent.java @@ -1,5 +1,6 @@ -package me.retucio.sputnik.event; +package me.retucio.sputnik.event.events; +import me.retucio.sputnik.event.Event; import net.minecraft.client.world.ClientWorld; diff --git a/src/main/java/me/retucio/sputnik/event/events/sputnik/LoadCapeManagerEvent.java b/src/main/java/me/retucio/sputnik/event/events/sputnik/LoadCapeManagerEvent.java new file mode 100644 index 0000000..41c9183 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/event/events/sputnik/LoadCapeManagerEvent.java @@ -0,0 +1,6 @@ +package me.retucio.sputnik.event.events.sputnik; + +import me.retucio.sputnik.event.Event; + +// se genera cuando carga el gestor de capas +public class LoadCapeManagerEvent extends Event {} diff --git a/src/main/java/me/retucio/sputnik/mixin/CapeFeatureRendererMixin.java b/src/main/java/me/retucio/sputnik/mixin/CapeFeatureRendererMixin.java new file mode 100644 index 0000000..566f8c0 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/mixin/CapeFeatureRendererMixin.java @@ -0,0 +1,26 @@ +package me.retucio.sputnik.mixin; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import me.retucio.sputnik.module.ModuleManager; +import me.retucio.sputnik.module.modules.player.Capes; +import net.minecraft.client.render.command.OrderedRenderCommandQueue; +import net.minecraft.client.render.entity.feature.CapeFeatureRenderer; +import net.minecraft.client.render.entity.state.PlayerEntityRenderState; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.AssetInfo; +import net.minecraft.util.Identifier; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +@Mixin(CapeFeatureRenderer.class) +public abstract class CapeFeatureRendererMixin { + + @ModifyExpressionValue(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/command/OrderedRenderCommandQueue;ILnet/minecraft/client/render/entity/state/PlayerEntityRenderState;FF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/SkinTextures;cape()Lnet/minecraft/util/AssetInfo$TextureAsset;")) + private AssetInfo.TextureAsset modifyCapeTexture(AssetInfo.TextureAsset original, MatrixStack matrices, OrderedRenderCommandQueue entityRenderCommandQueue, int i, PlayerEntityRenderState state, float f, float g) { + Capes capes = ModuleManager.INSTANCE.getModuleByClass(Capes.class); + if (!capes.isEnabled()) return original; + + Identifier id = capes.cape.getValue().getId(); + return id == null ? original : new AssetInfo.TextureAssetInfo(id, id); + } +} \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/mixin/ChatHudLineMixin.java b/src/main/java/me/retucio/sputnik/mixin/ChatHudLineMixin.java index b183d64..725ff1b 100644 --- a/src/main/java/me/retucio/sputnik/mixin/ChatHudLineMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/ChatHudLineMixin.java @@ -22,17 +22,17 @@ public class ChatHudLineMixin implements IChatHudLine { private GameProfile sender; @Override - public String smegma$getText() { return content.toString(); } + public String sputnik$getText() { return content.toString(); } @Override - public int smegma$getId() { return id; } + public int sputnik$getId() { return id; } @Override - public void smegma$setId(int id) { this.id = id; } + public void sputnik$setId(int id) { this.id = id; } @Override - public GameProfile smegma$getSender() { return sender; } + public GameProfile sputnik$getSender() { return sender; } @Override - public void smegma$setSender(GameProfile profile) { this.sender = profile; } + public void sputnik$setSender(GameProfile profile) { this.sender = profile; } } diff --git a/src/main/java/me/retucio/sputnik/mixin/ChatHudLineVisibleMixin.java b/src/main/java/me/retucio/sputnik/mixin/ChatHudLineVisibleMixin.java index 669023e..c21c56f 100644 --- a/src/main/java/me/retucio/sputnik/mixin/ChatHudLineVisibleMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/ChatHudLineVisibleMixin.java @@ -25,7 +25,7 @@ public class ChatHudLineVisibleMixin implements IChatHudLineVisible { private boolean startOfEntry; @Override - public String smegma$getText() { + public String sputnik$getText() { StringBuilder sb = new StringBuilder(); content.accept((index, style, codePoint) -> { @@ -36,20 +36,20 @@ public class ChatHudLineVisibleMixin implements IChatHudLineVisible { } @Override - public int smegma$getId() { return id; } + public int sputnik$getId() { return id; } @Override - public void smegma$setId(int id) { this.id = id; } + public void sputnik$setId(int id) { this.id = id; } @Override - public GameProfile smegma$getSender() { return sender; } + public GameProfile sputnik$getSender() { return sender; } @Override - public void smegma$setSender(GameProfile profile) { this.sender = profile; } + public void sputnik$setSender(GameProfile profile) { this.sender = profile; } @Override - public boolean smegma$isStartOfEntry() { return startOfEntry; } + public boolean sputnik$isStartOfEntry() { return startOfEntry; } @Override - public void smegma$setStartOfEntry(boolean start) { this.startOfEntry = start; } + public void sputnik$setStartOfEntry(boolean start) { this.startOfEntry = start; } } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/mixin/ChatHudMixin.java b/src/main/java/me/retucio/sputnik/mixin/ChatHudMixin.java index 79b0d46..10c7aa8 100644 --- a/src/main/java/me/retucio/sputnik/mixin/ChatHudMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/ChatHudMixin.java @@ -62,7 +62,7 @@ public abstract class ChatHudMixin implements IChatHud { // métodos relacionados a las interfaces IChatHud, IChatHudLine, IChadHudLineVisible y IMessageHandler @Override - public void smegma$add(Text message, int id) { + public void sputnik$add(Text message, int id) { nextId = id; addMessage(message); nextId = 0; @@ -70,12 +70,12 @@ public abstract class ChatHudMixin implements IChatHud { @Inject(method = "addVisibleMessage", at = @At(value = "INVOKE", target = "Ljava/util/List;addFirst(Ljava/lang/Object;)V", shift = At.Shift.AFTER)) private void onAddMessageAfterNewChatHudLineVisible(ChatHudLine message, CallbackInfo ci) { - ((IChatHudLine) (Object) visibleMessages.getFirst()).smegma$setId(nextId); + ((IChatHudLine) (Object) visibleMessages.getFirst()).sputnik$setId(nextId); } @Inject(method = "addMessage(Lnet/minecraft/client/gui/hud/ChatHudLine;)V", at = @At(value = "INVOKE", target = "Ljava/util/List;addFirst(Ljava/lang/Object;)V", shift = At.Shift.AFTER)) private void onAddMessageAfterNewChatHudLine(ChatHudLine message, CallbackInfo ci) { - ((IChatHudLine) (Object) messages.getFirst()).smegma$setId(nextId); + ((IChatHudLine) (Object) messages.getFirst()).sputnik$setId(nextId); } @SuppressWarnings("DataFlowIssue") @@ -86,8 +86,8 @@ public abstract class ChatHudMixin implements IChatHud { IChatHudLineVisible iLine = (IChatHudLineVisible) (Object) line; - iLine.smegma$setSender(handler.smegma$getSender()); - iLine.smegma$setStartOfEntry(j == 0); + iLine.sputnik$setSender(handler.sputnik$getSender()); + iLine.sputnik$setStartOfEntry(j == 0); return line; } @@ -97,12 +97,12 @@ public abstract class ChatHudMixin implements IChatHud { IMessageHandler handler = (IMessageHandler) mc.getMessageHandler(); if (handler == null) return line; - ((IChatHudLine) (Object) line).smegma$setSender(handler.smegma$getSender()); + ((IChatHudLine) (Object) line).sputnik$setSender(handler.sputnik$getSender()); return line; } @Override - public List smegma$getVisibleMessages() { + public List sputnik$getVisibleMessages() { return visibleMessages; } @@ -118,10 +118,10 @@ public abstract class ChatHudMixin implements IChatHud { if (event.isCancelled()) { ci.cancel(); } else { - visibleMessages.removeIf(msg -> ((IChatHudLine) (Object) msg).smegma$getId() == nextId && nextId != 0); + visibleMessages.removeIf(msg -> ((IChatHudLine) (Object) msg).sputnik$getId() == nextId && nextId != 0); for (int i = messages.size() - 1; i > -1; i--) { - if (((IChatHudLine) (Object) messages.get(i)).smegma$getId() == nextId && nextId != 0) { + if (((IChatHudLine) (Object) messages.get(i)).sputnik$getId() == nextId && nextId != 0) { messages.remove(i); chatPlus.removeLine(i); } diff --git a/src/main/java/me/retucio/sputnik/mixin/ClientCommonNetworkHandlerMixin.java b/src/main/java/me/retucio/sputnik/mixin/ClientCommonNetworkHandlerMixin.java index b149d79..dd66760 100644 --- a/src/main/java/me/retucio/sputnik/mixin/ClientCommonNetworkHandlerMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/ClientCommonNetworkHandlerMixin.java @@ -45,7 +45,7 @@ public abstract class ClientCommonNetworkHandlerMixin { if (!bypassPack.isEnabled()) return; final Screen screen = cir.getReturnValue(); - ((IConfirmScreen) screen).smegma$setBypassAction(() -> { + ((IConfirmScreen) screen).sputnik$setBypassAction(() -> { client.setScreen(((ConfirmServerResourcePackScreenAccessor) screen).getParentScreen()); if (this.serverInfo != null) { this.serverInfo.setResourcePackPolicy(bypassPack.getPolicy()); diff --git a/src/main/java/me/retucio/sputnik/mixin/ConfirmScreenMixin.java b/src/main/java/me/retucio/sputnik/mixin/ConfirmScreenMixin.java index e20f826..e2b6a00 100644 --- a/src/main/java/me/retucio/sputnik/mixin/ConfirmScreenMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/ConfirmScreenMixin.java @@ -33,7 +33,7 @@ public abstract class ConfirmScreenMixin extends Screen implements IConfirmScree } @Override - public void smegma$setBypassAction(Runnable bypass) { + public void sputnik$setBypassAction(Runnable bypass) { this.bypassAction = bypass; } } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/mixin/ElytraFeatureRendererMixin.java b/src/main/java/me/retucio/sputnik/mixin/ElytraFeatureRendererMixin.java new file mode 100644 index 0000000..a7b21ee --- /dev/null +++ b/src/main/java/me/retucio/sputnik/mixin/ElytraFeatureRendererMixin.java @@ -0,0 +1,32 @@ +package me.retucio.sputnik.mixin; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import me.retucio.sputnik.module.ModuleManager; +import me.retucio.sputnik.module.modules.player.Capes; +import net.minecraft.client.render.command.OrderedRenderCommandQueue; +import net.minecraft.client.render.entity.feature.ElytraFeatureRenderer; +import net.minecraft.client.render.entity.feature.FeatureRenderer; +import net.minecraft.client.render.entity.feature.FeatureRendererContext; +import net.minecraft.client.render.entity.model.EntityModel; +import net.minecraft.client.render.entity.state.BipedEntityRenderState; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.Identifier; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +@Mixin(ElytraFeatureRenderer.class) +public abstract class ElytraFeatureRendererMixin> extends FeatureRenderer { + + public ElytraFeatureRendererMixin(FeatureRendererContext context) { + super(context); + } + + @ModifyExpressionValue(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/command/OrderedRenderCommandQueue;ILnet/minecraft/client/render/entity/state/BipedEntityRenderState;FF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/feature/ElytraFeatureRenderer;getTexture(Lnet/minecraft/client/render/entity/state/BipedEntityRenderState;)Lnet/minecraft/util/Identifier;")) + private Identifier modifyCapeTexture(Identifier original, MatrixStack matrices, OrderedRenderCommandQueue entityRenderCommandQueue, int i, S state, float f, float g) { + Capes capes = ModuleManager.INSTANCE.getModuleByClass(Capes.class); + if (!capes.isEnabled()) return original; + + Identifier id = capes.cape.getValue().getId(); + return id == null ? original : id; + } +} \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/mixin/GameRendererMixin.java b/src/main/java/me/retucio/sputnik/mixin/GameRendererMixin.java index 8d57889..0cf1f4f 100644 --- a/src/main/java/me/retucio/sputnik/mixin/GameRendererMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/GameRendererMixin.java @@ -84,7 +84,7 @@ public abstract class GameRendererMixin { float lastYaw = cameraEntity.lastYaw; float lastPitch = cameraEntity.lastPitch; - ((IVec3d) cameraEntity.getEntityPos()).smegma$set(pos.x, pos.y - cameraEntity.getEyeHeight(cameraEntity.getPose()), pos.z); + ((IVec3d) cameraEntity.getEntityPos()).sputnik$set(pos.x, pos.y - cameraEntity.getEyeHeight(cameraEntity.getPose()), pos.z); cameraEntity.lastX = prevPos.x; cameraEntity.lastY = prevPos.y - cameraEntity.getEyeHeight(cameraEntity.getPose()); cameraEntity.lastZ = prevPos.z; @@ -97,7 +97,7 @@ public abstract class GameRendererMixin { updateCrosshairTarget(tickDelta); freecamDone = false; - ((IVec3d) cameraEntity.getEntityPos()).smegma$set(x, y, z); + ((IVec3d) cameraEntity.getEntityPos()).sputnik$set(x, y, z); cameraEntity.lastX = lastX; cameraEntity.lastY = lastY; cameraEntity.lastZ = lastZ; diff --git a/src/main/java/me/retucio/sputnik/mixin/KeyboardMixin.java b/src/main/java/me/retucio/sputnik/mixin/KeyboardMixin.java index 7db7543..f92a381 100644 --- a/src/main/java/me/retucio/sputnik/mixin/KeyboardMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/KeyboardMixin.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.mixin; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.event.events.KeyEvent; import net.minecraft.client.Keyboard; import net.minecraft.client.input.KeyInput; @@ -16,7 +17,7 @@ public abstract class KeyboardMixin { @Inject(method = "onKey", at = @At("HEAD"), cancellable = true) private void onKeyPress(long window, int action, KeyInput input, CallbackInfo ci) { if (input.key() == -1) return; - me.retucio.sputnik.Sputnik.INSTANCE.onKey(input.key(), action); + Sputnik.INSTANCE.onKey(input.key(), action); KeyEvent event = EVENT_BUS.post(new KeyEvent(input.key(), input.scancode(), action)); if (event.isCancelled()) ci.cancel(); } diff --git a/src/main/java/me/retucio/sputnik/mixin/MessageHandlerMixin.java b/src/main/java/me/retucio/sputnik/mixin/MessageHandlerMixin.java index 09a2dcd..ae857dd 100644 --- a/src/main/java/me/retucio/sputnik/mixin/MessageHandlerMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/MessageHandlerMixin.java @@ -31,7 +31,7 @@ public abstract class MessageHandlerMixin implements IMessageHandler { } @Override - public GameProfile smegma$getSender() { + public GameProfile sputnik$getSender() { return sender; } } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/mixin/MinecraftClientMixin.java b/src/main/java/me/retucio/sputnik/mixin/MinecraftClientMixin.java index 9d888cf..74ae770 100644 --- a/src/main/java/me/retucio/sputnik/mixin/MinecraftClientMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/MinecraftClientMixin.java @@ -1,7 +1,8 @@ package me.retucio.sputnik.mixin; import com.llamalad7.mixinextras.sugar.Local; -import me.retucio.sputnik.event.JoinWorldEvent; +import me.retucio.sputnik.Sputnik; +import me.retucio.sputnik.event.events.JoinWorldEvent; import me.retucio.sputnik.event.events.OpenScreenEvent; import me.retucio.sputnik.event.events.ShutdownEvent; import me.retucio.sputnik.event.events.TickEvent; @@ -20,8 +21,6 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import static me.retucio.sputnik.Sputnik.EVENT_BUS; -import static me.retucio.sputnik.Sputnik.mc; @Mixin(MinecraftClient.class) public abstract class MinecraftClientMixin { @@ -31,23 +30,23 @@ public abstract class MinecraftClientMixin { @Inject(method = "tick", at = @At("HEAD")) private void onTickPre(CallbackInfo ci) { - me.retucio.sputnik.Sputnik.INSTANCE.onTick(); - EVENT_BUS.post(new TickEvent.Pre()); + Sputnik.INSTANCE.onTick(); + Sputnik.EVENT_BUS.post(new TickEvent.Pre()); } @Inject(method = "tick", at = @At("TAIL")) private void onTickPost(CallbackInfo ci) { - EVENT_BUS.post(new TickEvent.Post()); + Sputnik.EVENT_BUS.post(new TickEvent.Post()); } @Inject(method = "stop", at = @At("HEAD")) private void onStop(CallbackInfo ci) { - EVENT_BUS.post(new ShutdownEvent()); + Sputnik.EVENT_BUS.post(new ShutdownEvent()); } @Inject(method = "setScreen", at = @At("HEAD"), cancellable = true) private void onOpenScreen(Screen screen, CallbackInfo ci) { - OpenScreenEvent event = EVENT_BUS.post(new OpenScreenEvent(screen)); + OpenScreenEvent event = Sputnik.EVENT_BUS.post(new OpenScreenEvent(screen)); if (event.isCancelled()) ci.cancel(); } @@ -58,8 +57,8 @@ public abstract class MinecraftClientMixin { @Inject(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;getStackInHand(Lnet/minecraft/util/Hand;)Lnet/minecraft/item/ItemStack;"), cancellable = true) private void onUseItem(CallbackInfo ci, @Local Hand hand) { - if (mc.player == null) return; - UseItemEvent event = EVENT_BUS.post(new UseItemEvent(mc.player.getStackInHand(hand), hand)); + if (Sputnik.mc.player == null) return; + UseItemEvent event = Sputnik.EVENT_BUS.post(new UseItemEvent(Sputnik.mc.player.getStackInHand(hand), hand)); if (event.isCancelled()) ci.cancel(); } @@ -72,7 +71,7 @@ public abstract class MinecraftClientMixin { @Inject(method = "joinWorld", at = @At("HEAD"), cancellable = true) private void onJoinWorld(ClientWorld world, CallbackInfo ci) { - JoinWorldEvent event = EVENT_BUS.post(new JoinWorldEvent(world)); + JoinWorldEvent event = Sputnik.EVENT_BUS.post(new JoinWorldEvent(world)); if (event.isCancelled()) ci.cancel(); } } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/mixin/PlayerEntityMixin.java b/src/main/java/me/retucio/sputnik/mixin/PlayerEntityMixin.java index a5bf87f..85019cb 100644 --- a/src/main/java/me/retucio/sputnik/mixin/PlayerEntityMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/PlayerEntityMixin.java @@ -1,6 +1,7 @@ package me.retucio.sputnik.mixin; import com.llamalad7.mixinextras.injector.ModifyReturnValue; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.event.events.ClipAtLedgeEvent; import me.retucio.sputnik.module.ModuleManager; import me.retucio.sputnik.module.modules.render.Nametags; @@ -56,7 +57,7 @@ public abstract class PlayerEntityMixin extends LivingEntity { @Inject(method = "clipAtLedge", at = @At("HEAD"), cancellable = true) private void clipAtLedge(CallbackInfoReturnable cir) { if (!getEntityWorld().isClient()) return; - ClipAtLedgeEvent event = me.retucio.sputnik.Sputnik.EVENT_BUS.post(new ClipAtLedgeEvent(isSneaking())); + ClipAtLedgeEvent event = Sputnik.EVENT_BUS.post(new ClipAtLedgeEvent(isSneaking())); cir.setReturnValue(event.isClipping()); } } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/mixin/Vec3dMixin.java b/src/main/java/me/retucio/sputnik/mixin/Vec3dMixin.java index 52cb8ac..ab3d767 100644 --- a/src/main/java/me/retucio/sputnik/mixin/Vec3dMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/Vec3dMixin.java @@ -20,20 +20,20 @@ public abstract class Vec3dMixin implements IVec3d { public double z; @Override - public void smegma$set(double x, double y, double z) { + public void sputnik$set(double x, double y, double z) { this.x = x; this.y = y; this.z = z; } @Override - public void smegma$setXZ(double x, double z) { + public void sputnik$setXZ(double x, double z) { this.x = x; this.z = z; } @Override - public void smegma$setY(double y) { + public void sputnik$setY(double y) { this.y = y; } } diff --git a/src/main/java/me/retucio/sputnik/mixin/WorldRendererMixin.java b/src/main/java/me/retucio/sputnik/mixin/WorldRendererMixin.java index f384c83..be0e33e 100644 --- a/src/main/java/me/retucio/sputnik/mixin/WorldRendererMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/WorldRendererMixin.java @@ -2,6 +2,7 @@ package me.retucio.sputnik.mixin; import com.llamalad7.mixinextras.sugar.Local; import com.mojang.blaze3d.buffers.GpuBufferSlice; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.event.events.RenderWorldEvent; import me.retucio.sputnik.module.ModuleManager; import me.retucio.sputnik.module.modules.render.BlockOutline; @@ -45,7 +46,7 @@ public abstract class WorldRendererMixin { matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(camera.getPitch())); matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(camera.getYaw() + 180f)); - profiler.push(me.retucio.sputnik.Sputnik.MOD_ID + "-3d"); + profiler.push(Sputnik.MOD_ID + "-3d"); EVENT_BUS.post(new RenderWorldEvent(matrices, tickCounter, camera)); profiler.pop(); diff --git a/src/main/java/me/retucio/sputnik/module/Module.java b/src/main/java/me/retucio/sputnik/module/Module.java index 83fa144..0646122 100644 --- a/src/main/java/me/retucio/sputnik/module/Module.java +++ b/src/main/java/me/retucio/sputnik/module/Module.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.module; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.config.ConfigManager; import me.retucio.sputnik.event.SubscribeEvent; import me.retucio.sputnik.event.events.sputnik.ToggleModuleEvent; @@ -78,24 +79,24 @@ public class Module { enabled = !enabled; if (enabled) onEnable(); else onDisable(); - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this)); + Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this)); } public void onEnable() { if (notify.isEnabled()) ChatUtil.info(getName() + " fue activado"); for (Method method : getClass().getDeclaredMethods()) if (method.isAnnotationPresent(SubscribeEvent.class)) { - me.retucio.sputnik.Sputnik.EVENT_BUS.register(this); + Sputnik.EVENT_BUS.register(this); break; } - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this)); + Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this)); } public void onDisable() { if (notify.isEnabled()) ChatUtil.info(getName() + " fue desactivado"); - if (me.retucio.sputnik.Sputnik.EVENT_BUS.isRegistered(this)) - me.retucio.sputnik.Sputnik.EVENT_BUS.unregister(this); - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this)); + if (Sputnik.EVENT_BUS.isRegistered(this)) + Sputnik.EVENT_BUS.unregister(this); + Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this)); } diff --git a/src/main/java/me/retucio/sputnik/module/ModuleManager.java b/src/main/java/me/retucio/sputnik/module/ModuleManager.java index 06c6684..771dfd0 100644 --- a/src/main/java/me/retucio/sputnik/module/ModuleManager.java +++ b/src/main/java/me/retucio/sputnik/module/ModuleManager.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.module; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.event.SubscribeEvent; import me.retucio.sputnik.module.modules.camera.*; import me.retucio.sputnik.module.modules.client.HUD; @@ -38,6 +39,7 @@ public class ModuleManager { modules.add(new BossbarStack()); modules.add(new BreakingProgress()); modules.add(new BungeecordSpoofer()); + modules.add(new Capes()); modules.add(new ChatPlus()); modules.add(new ColoredSigns()); modules.add(new CritsPlus()); @@ -80,7 +82,7 @@ public class ModuleManager { for (Module module : getEnabledModules()) { for (Method method : module.getClass().getDeclaredMethods()) { if (method.isAnnotationPresent(SubscribeEvent.class)) { - me.retucio.sputnik.Sputnik.EVENT_BUS.register(module); + Sputnik.EVENT_BUS.register(module); break; } } diff --git a/src/main/java/me/retucio/sputnik/module/modules/misc/ChatPlus.java b/src/main/java/me/retucio/sputnik/module/modules/misc/ChatPlus.java index c4d35c1..2fefdb6 100644 --- a/src/main/java/me/retucio/sputnik/module/modules/misc/ChatPlus.java +++ b/src/main/java/me/retucio/sputnik/module/modules/misc/ChatPlus.java @@ -127,7 +127,7 @@ public class ChatPlus extends Module { if (!isEnabled() || !showHeads.isEnabled()) return; // dibujar la cabeza al principio del mensaje - if (((IChatHudLineVisible) (Object) line).smegma$isStartOfEntry()) + if (((IChatHudLineVisible) (Object) line).sputnik$isStartOfEntry()) drawTexture(context, (IChatHudLine) (Object) line, y, color); context.getMatrices().pushMatrix(); @@ -142,7 +142,7 @@ public class ChatPlus extends Module { @SuppressWarnings("DataFlowIssue") private void drawTexture(DrawContext context, IChatHudLine line, int y, int color) { - String text = line.smegma$getText().trim(); + String text = line.sputnik$getText().trim(); int startOffset = 0; @@ -173,7 +173,7 @@ public class ChatPlus extends Module { @SuppressWarnings("DataFlowIssue") private GameProfile getSender(IChatHudLine line, String text) { // obtener el jugador que envió un mensaje - GameProfile sender = line.smegma$getSender(); + GameProfile sender = line.sputnik$getSender(); if (sender == null) { Matcher usernameMatcher = usernameRegex.matcher(text); diff --git a/src/main/java/me/retucio/sputnik/module/modules/network/PacketDelay.java b/src/main/java/me/retucio/sputnik/module/modules/network/PacketDelay.java index cd75406..ef1f012 100644 --- a/src/main/java/me/retucio/sputnik/module/modules/network/PacketDelay.java +++ b/src/main/java/me/retucio/sputnik/module/modules/network/PacketDelay.java @@ -1,6 +1,6 @@ package me.retucio.sputnik.module.modules.network; -import me.retucio.sputnik.event.JoinWorldEvent; +import me.retucio.sputnik.event.events.JoinWorldEvent; import me.retucio.sputnik.event.SubscribeEvent; import me.retucio.sputnik.event.events.PacketEvent; import me.retucio.sputnik.module.Category; diff --git a/src/main/java/me/retucio/sputnik/module/modules/player/Capes.java b/src/main/java/me/retucio/sputnik/module/modules/player/Capes.java new file mode 100644 index 0000000..7775eea --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/player/Capes.java @@ -0,0 +1,17 @@ +package me.retucio.sputnik.module.modules.player; + +import me.retucio.sputnik.cape.Cape; +import me.retucio.sputnik.cape.CapeManager; +import me.retucio.sputnik.module.Category; +import me.retucio.sputnik.module.Module; +import me.retucio.sputnik.module.settings.OptionSetting; + +public class Capes extends Module { + + public OptionSetting cape = addSetting(new OptionSetting<>("capa", "qué capa llevar puesta", + CapeManager.INSTANCE.getCapes(), CapeManager.INSTANCE.getCape("hollow-knight"))); + + public Capes() { + super("capas", "elige qué capa llevar (solo visible para ti)", Category.PLAYER); + } +} diff --git a/src/main/java/me/retucio/sputnik/module/modules/player/UIMove.java b/src/main/java/me/retucio/sputnik/module/modules/player/UIMove.java index 59c53fa..3102324 100644 --- a/src/main/java/me/retucio/sputnik/module/modules/player/UIMove.java +++ b/src/main/java/me/retucio/sputnik/module/modules/player/UIMove.java @@ -27,7 +27,7 @@ public class UIMove extends Module { private final ScreenHandlerType inventoryHandlerType = ScreenHandlerType.register( "player_inventory", GenericContainerScreenHandler::createGeneric9x3); private final ScreenHandlerType clickGuiHandlerType = ScreenHandlerType.register( - "camtweaks_clickgui", GenericContainerScreenHandler::createGeneric9x3); // 9x3 porque no importa (creo) + "sputnik_clickgui", GenericContainerScreenHandler::createGeneric9x3); // 9x3 porque no importa (creo) public UIMove() { super("moverse en interfaz", diff --git a/src/main/java/me/retucio/sputnik/module/settings/ColorSetting.java b/src/main/java/me/retucio/sputnik/module/settings/ColorSetting.java index d9d5924..195cb50 100644 --- a/src/main/java/me/retucio/sputnik/module/settings/ColorSetting.java +++ b/src/main/java/me/retucio/sputnik/module/settings/ColorSetting.java @@ -270,8 +270,8 @@ public class ColorSetting extends Setting { map.put("a", a); map.put("rb", rainbow); map.put("rs", rainbowSpeed); - map.put("sat", saturation); - map.put("bri", brightness); + map.put("sat", (double) saturation); + map.put("bri", (double) brightness); return map; } } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/module/settings/OptionSetting.java b/src/main/java/me/retucio/sputnik/module/settings/OptionSetting.java index bd5efc9..6735133 100644 --- a/src/main/java/me/retucio/sputnik/module/settings/OptionSetting.java +++ b/src/main/java/me/retucio/sputnik/module/settings/OptionSetting.java @@ -1,16 +1,15 @@ package me.retucio.sputnik.module.settings; -import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.function.Consumer; public class OptionSetting extends Setting{ - List options = new ArrayList<>(); - Map displayNames; - T option; - T defaultOption; + private final List options; + private Map displayNames; + private T option; + private final T defaultOption; private Consumer updateListener; @@ -39,6 +38,20 @@ public class OptionSetting extends Setting{ if (updateListener != null) updateListener.accept(option); } + public void setValueByName(String name) { + for (T opt : options) { + if (displayNames != null && !displayNames.isEmpty()) { + if (displayNames.get(opt).equals(name)) { + setValue(opt); + return; + } + } else if (opt.toString().equals(name)) { + setValue(opt); + return; + } + } + } + public List getOptions() { return options; } @@ -64,6 +77,10 @@ public class OptionSetting extends Setting{ return index; } + public void setIndex(int index) { + setValue(getOption(index)); + } + public boolean is(T option) { return getValue() == option; } @@ -94,4 +111,8 @@ public class OptionSetting extends Setting{ if (displayNames != null) return displayNames.get(key); return key.toString(); } + + public String getDisplayName() { + return getDisplayName(option); + } } diff --git a/src/main/java/me/retucio/sputnik/module/settings/Setting.java b/src/main/java/me/retucio/sputnik/module/settings/Setting.java index 51e670b..abdca85 100644 --- a/src/main/java/me/retucio/sputnik/module/settings/Setting.java +++ b/src/main/java/me/retucio/sputnik/module/settings/Setting.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.module.settings; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.event.events.sputnik.UpdateSettingEvent; import me.retucio.sputnik.module.Module; @@ -52,6 +53,6 @@ public abstract class Setting { } public void fireUpdateEvent() { - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new UpdateSettingEvent(this, module.shouldSaveSettings())); + Sputnik.EVENT_BUS.post(new UpdateSettingEvent(this, module.shouldSaveSettings())); } } diff --git a/src/main/java/me/retucio/sputnik/ui/hud/ImageHudElement.java b/src/main/java/me/retucio/sputnik/ui/hud/ImageHudElement.java index 99269b4..5b2b949 100644 --- a/src/main/java/me/retucio/sputnik/ui/hud/ImageHudElement.java +++ b/src/main/java/me/retucio/sputnik/ui/hud/ImageHudElement.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.ui.hud; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.module.modules.client.HUD; import me.retucio.sputnik.util.Colors; @@ -22,7 +23,7 @@ public abstract class ImageHudElement extends HudElement { public ImageHudElement(String id, int defaultX, int defaultY) { super(id, defaultX, defaultY); - this.textureId = Identifier.of(me.retucio.sputnik.Sputnik.MOD_ID, "textures/" + id); + this.textureId = Identifier.of(Sputnik.MOD_ID, "textures/" + id); this.w = imageWidth; this.h = imageHeight; } @@ -36,7 +37,7 @@ public abstract class ImageHudElement extends HudElement { try { // cargar - Identifier resourceId = Identifier.of(me.retucio.sputnik.Sputnik.MOD_ID, imagePath); + Identifier resourceId = Identifier.of(Sputnik.MOD_ID, imagePath); try (InputStream stream = mc.getResourceManager().getResource(resourceId).get().getInputStream()) { NativeImage image = NativeImage.read(stream); @@ -57,10 +58,10 @@ public abstract class ImageHudElement extends HudElement { mc.getTextureManager().registerTexture(textureId, texture); textureLoaded = true; - me.retucio.sputnik.Sputnik.LOGGER.info("textura para el elemento del HUD {} cargada", getId()); + Sputnik.LOGGER.info("textura para el elemento del HUD {} cargada", getId()); } } catch (Exception e) { - me.retucio.sputnik.Sputnik.LOGGER.error("no se pudo cargar la textura para el elemento del HUD {}: {}", getId(), e.getMessage()); + Sputnik.LOGGER.error("no se pudo cargar la textura para el elemento del HUD {}: {}", getId(), e.getMessage()); } } diff --git a/src/main/java/me/retucio/sputnik/ui/screen/ClickGUI.java b/src/main/java/me/retucio/sputnik/ui/screen/ClickGUI.java index 00a3bff..57b23fb 100644 --- a/src/main/java/me/retucio/sputnik/ui/screen/ClickGUI.java +++ b/src/main/java/me/retucio/sputnik/ui/screen/ClickGUI.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.ui.screen; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.event.SubscribeEvent; import me.retucio.sputnik.event.events.KeyEvent; import me.retucio.sputnik.event.events.MouseClickEvent; @@ -57,7 +58,7 @@ public class ClickGUI extends Screen { public ClickGUI() { super(Text.of("interfaz")); settingsFrames.add(guiSettingsFrame); - me.retucio.sputnik.Sputnik.EVENT_BUS.register(this); + Sputnik.EVENT_BUS.register(this); } @Override @@ -179,9 +180,9 @@ public class ClickGUI extends Screen { @SubscribeEvent public void onMouseMiddleButton(MouseClickEvent event) { // mover todos los marcos a un punto visible al presionar shift + la rueda del ratón - if (me.retucio.sputnik.Sputnik.mc.currentScreen != this || event.getButton() != 2 || !KeyUtil.isKeyDown(GLFW.GLFW_KEY_LEFT_SHIFT)) return; + if (Sputnik.mc.currentScreen != this || event.getButton() != 2 || !KeyUtil.isKeyDown(GLFW.GLFW_KEY_LEFT_SHIFT)) return; - int h = me.retucio.sputnik.Sputnik.mc.getWindow().getScaledHeight(); + int h = Sputnik.mc.getWindow().getScaledHeight(); int minY = Math.min(modulesFrame.getY(), settingsFrames.stream().mapToInt(Frame::getY).min().orElse(modulesFrame.getY())); int maxY = Math.max(modulesFrame.getY() + modulesFrame.getH(), settingsFrames.stream().mapToInt(sf -> sf.getY() + sf.getH()).max().orElse(modulesFrame.getY() + modulesFrame.getH())); int correction = minY < 0 ? -minY + 4 : (maxY > h ? h - maxY - 4 : 0); @@ -247,10 +248,18 @@ public class ClickGUI extends Screen { // abrir un marco donde se encuentran los ajustes del módulo deseado public void openSettingsFrame(Module module, int x, int y) { - if (isSettingsFrameOpen(module)) return; // permitir un solo marco de ajustes por módulo - SettingsFrame frame = new SettingsFrame(module, x, y, 120, 20); + for (SettingsFrame frame : settingsFrames) { + if (frame.module == module) { + frame.setX(x); + frame.setY(y); + return; + } + } + + SettingsFrame frame = new SettingsFrame(module, x, y, 100, 20); settingsFrames.add(frame); - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new SettingsFrameEvent.Open(frame)); + + Sputnik.EVENT_BUS.post(new SettingsFrameEvent.Open(frame)); } // abrir un marco de ajustes específicamente para ajustes de selección múltiple @@ -268,7 +277,7 @@ public class ClickGUI extends Screen { if ((sf instanceof ColorPickerFrame cpf && cpf.dummyModule == module) // para los selectores de colores || (!(sf instanceof ColorPickerFrame) && sf.module == module)) { // lógica muy mierdas, lo sé, pero paso de hacerlo bien toRemove.add(sf); - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new SettingsFrameEvent.Close(sf)); + Sputnik.EVENT_BUS.post(new SettingsFrameEvent.Close(sf)); unselect(sf); } } diff --git a/src/main/java/me/retucio/sputnik/ui/screen/PreviewScreen.java b/src/main/java/me/retucio/sputnik/ui/screen/PreviewScreen.java index e3ec257..899acee 100644 --- a/src/main/java/me/retucio/sputnik/ui/screen/PreviewScreen.java +++ b/src/main/java/me/retucio/sputnik/ui/screen/PreviewScreen.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.ui.screen; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.module.modules.misc.ShulkerPeek; import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame; import me.retucio.sputnik.util.Colors; @@ -19,7 +20,7 @@ import java.util.List; public class PreviewScreen extends Screen { - private static final Identifier TEXTURE = Identifier.of(me.retucio.sputnik.Sputnik.MOD_ID, "textures/gui/preview.png"); + private static final Identifier TEXTURE = Identifier.of(Sputnik.MOD_ID, "textures/gui/preview.png"); private int x, y; private final int bgWidth = 176; diff --git a/src/main/java/me/retucio/sputnik/ui/widgets/frames/ModuleFrame.java b/src/main/java/me/retucio/sputnik/ui/widgets/frames/ModuleFrame.java index 9b89142..00af7ec 100644 --- a/src/main/java/me/retucio/sputnik/ui/widgets/frames/ModuleFrame.java +++ b/src/main/java/me/retucio/sputnik/ui/widgets/frames/ModuleFrame.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.ui.widgets.frames; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.event.events.sputnik.ModuleFrameEvent; import me.retucio.sputnik.module.Module; import me.retucio.sputnik.module.ModuleManager; @@ -101,7 +102,7 @@ public class ModuleFrame extends Frame { dragY = mouseY - y; } else if (button == 1) { // clic derecho para extenderlo extended = !extended; - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new ModuleFrameEvent.Extend()); + Sputnik.EVENT_BUS.post(new ModuleFrameEvent.Extend()); } } @@ -132,7 +133,7 @@ public class ModuleFrame extends Frame { } if (isHovered(mouseX, mouseY)) - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new ModuleFrameEvent.Move()); + Sputnik.EVENT_BUS.post(new ModuleFrameEvent.Move()); } @Override diff --git a/src/main/java/me/retucio/sputnik/ui/widgets/frames/SettingsFrame.java b/src/main/java/me/retucio/sputnik/ui/widgets/frames/SettingsFrame.java index 7611f57..9f482d4 100644 --- a/src/main/java/me/retucio/sputnik/ui/widgets/frames/SettingsFrame.java +++ b/src/main/java/me/retucio/sputnik/ui/widgets/frames/SettingsFrame.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.ui.widgets.frames; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.event.events.sputnik.SettingsFrameEvent; import me.retucio.sputnik.module.Module; import me.retucio.sputnik.module.settings.*; @@ -130,7 +131,9 @@ public class SettingsFrame extends Frame> { super.mouseReleased(mouseX, mouseY, button); if (button == 0) { dragging = false; - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new SettingsFrameEvent.Move(this)); + + if (isHovered(mouseX, mouseY)) + Sputnik.EVENT_BUS.post(new SettingsFrameEvent.Move(this)); } for (SettingButton sb : visibleButtons) @@ -143,9 +146,6 @@ public class SettingsFrame extends Frame> { sb.mouseDragged(mouseX, mouseY); } - @Override - public void onKey(int key, int action) {} - @Override public void updateWidth() { // asegurarse de que todos los botones caben en el marco, haciendo que la anchura se ajuste al texto más largo diff --git a/src/main/java/me/retucio/sputnik/ui/widgets/frames/settings/ClientSettingsFrame.java b/src/main/java/me/retucio/sputnik/ui/widgets/frames/settings/ClientSettingsFrame.java index 9d7dd28..e46a07a 100644 --- a/src/main/java/me/retucio/sputnik/ui/widgets/frames/settings/ClientSettingsFrame.java +++ b/src/main/java/me/retucio/sputnik/ui/widgets/frames/settings/ClientSettingsFrame.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.ui.widgets.frames.settings; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.event.events.sputnik.GUISettingsFrameEvent; import me.retucio.sputnik.module.modules.client.GUI; import me.retucio.sputnik.ui.widgets.frames.SettingsFrame; @@ -65,7 +66,7 @@ public class ClientSettingsFrame extends SettingsFrame { dragY = mouseY - y; } else if (button == 1) { extended = !extended; - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new GUISettingsFrameEvent.Extend()); + Sputnik.EVENT_BUS.post(new GUISettingsFrameEvent.Extend()); } } @@ -78,7 +79,7 @@ public class ClientSettingsFrame extends SettingsFrame { public void mouseReleased(int mouseX, int mouseY, int button) { ClickGUI.INSTANCE.unselect(this); if (button == 0 && dragging) - me.retucio.sputnik.Sputnik.EVENT_BUS.post(new GUISettingsFrameEvent.Move()); + Sputnik.EVENT_BUS.post(new GUISettingsFrameEvent.Move()); super.mouseReleased(mouseX, mouseY, button); } diff --git a/src/main/java/me/retucio/sputnik/util/ChatUtil.java b/src/main/java/me/retucio/sputnik/util/ChatUtil.java index 13af915..c23dd7b 100644 --- a/src/main/java/me/retucio/sputnik/util/ChatUtil.java +++ b/src/main/java/me/retucio/sputnik/util/ChatUtil.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.util; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.event.SubscribeEvent; import me.retucio.sputnik.event.events.sputnik.LoadModuleManagerEvent; import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame; @@ -24,7 +25,7 @@ public class ChatUtil { } public static void addMessage(Text text) { - if (mc.inGameHud == null || !me.retucio.sputnik.Sputnik.settingsApplied) return; + if (mc.inGameHud == null || !Sputnik.settingsApplied) return; mc.inGameHud.getChatHud().addMessage(text); } @@ -87,6 +88,6 @@ public class ChatUtil { } public static String getDefaultPrefix() { - return Colors.getFormatting(Colors.mainColor) + "[smegma] "; + return Colors.getFormatting(Colors.mainColor) + "[sputnik] "; } } diff --git a/src/main/java/me/retucio/sputnik/util/interfaces/IChatHud.java b/src/main/java/me/retucio/sputnik/util/interfaces/IChatHud.java index d7e913f..c46f5ae 100644 --- a/src/main/java/me/retucio/sputnik/util/interfaces/IChatHud.java +++ b/src/main/java/me/retucio/sputnik/util/interfaces/IChatHud.java @@ -7,7 +7,7 @@ import java.util.List; public interface IChatHud { - void smegma$add(Text message, int id); + void sputnik$add(Text message, int id); - List smegma$getVisibleMessages(); + List sputnik$getVisibleMessages(); } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/util/interfaces/IChatHudLine.java b/src/main/java/me/retucio/sputnik/util/interfaces/IChatHudLine.java index 8313318..e4be705 100644 --- a/src/main/java/me/retucio/sputnik/util/interfaces/IChatHudLine.java +++ b/src/main/java/me/retucio/sputnik/util/interfaces/IChatHudLine.java @@ -4,11 +4,11 @@ import com.mojang.authlib.GameProfile; public interface IChatHudLine { - String smegma$getText(); + String sputnik$getText(); - int smegma$getId(); - void smegma$setId(int id); + int sputnik$getId(); + void sputnik$setId(int id); - GameProfile smegma$getSender(); - void smegma$setSender(GameProfile profile); + GameProfile sputnik$getSender(); + void sputnik$setSender(GameProfile profile); } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/util/interfaces/IChatHudLineVisible.java b/src/main/java/me/retucio/sputnik/util/interfaces/IChatHudLineVisible.java index 1482b3f..c60cff2 100644 --- a/src/main/java/me/retucio/sputnik/util/interfaces/IChatHudLineVisible.java +++ b/src/main/java/me/retucio/sputnik/util/interfaces/IChatHudLineVisible.java @@ -2,6 +2,6 @@ package me.retucio.sputnik.util.interfaces; public interface IChatHudLineVisible extends IChatHudLine { - boolean smegma$isStartOfEntry(); - void smegma$setStartOfEntry(boolean start); + boolean sputnik$isStartOfEntry(); + void sputnik$setStartOfEntry(boolean start); } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/util/interfaces/IConfirmScreen.java b/src/main/java/me/retucio/sputnik/util/interfaces/IConfirmScreen.java index 938eccb..6e303d7 100644 --- a/src/main/java/me/retucio/sputnik/util/interfaces/IConfirmScreen.java +++ b/src/main/java/me/retucio/sputnik/util/interfaces/IConfirmScreen.java @@ -2,5 +2,5 @@ package me.retucio.sputnik.util.interfaces; public interface IConfirmScreen { - void smegma$setBypassAction(Runnable action); + void sputnik$setBypassAction(Runnable action); } diff --git a/src/main/java/me/retucio/sputnik/util/interfaces/IMessageHandler.java b/src/main/java/me/retucio/sputnik/util/interfaces/IMessageHandler.java index bb0ada7..ed468d1 100644 --- a/src/main/java/me/retucio/sputnik/util/interfaces/IMessageHandler.java +++ b/src/main/java/me/retucio/sputnik/util/interfaces/IMessageHandler.java @@ -4,5 +4,5 @@ import com.mojang.authlib.GameProfile; public interface IMessageHandler { - GameProfile smegma$getSender(); + GameProfile sputnik$getSender(); } diff --git a/src/main/java/me/retucio/sputnik/util/interfaces/IVec3d.java b/src/main/java/me/retucio/sputnik/util/interfaces/IVec3d.java index 85fad3e..10aad54 100644 --- a/src/main/java/me/retucio/sputnik/util/interfaces/IVec3d.java +++ b/src/main/java/me/retucio/sputnik/util/interfaces/IVec3d.java @@ -5,10 +5,10 @@ import org.joml.Vector3d; public interface IVec3d { - void smegma$set(double x, double y, double z); - default void smegma$set(Vec3i vec) { smegma$set(vec.getX(), vec.getY(), vec.getZ()); } - default void semgma$set(Vector3d vec) { smegma$set(vec.x, vec.y, vec.z); } + void sputnik$set(double x, double y, double z); + default void sputnik$set(Vec3i vec) { sputnik$set(vec.getX(), vec.getY(), vec.getZ()); } + default void sputnik$set(Vector3d vec) { sputnik$set(vec.x, vec.y, vec.z); } - void smegma$setXZ(double x, double z); - void smegma$setY(double y); + void sputnik$setXZ(double x, double z); + void sputnik$setY(double y); } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/util/interfaces/TextVisitor.java b/src/main/java/me/retucio/sputnik/util/interfaces/TextVisitor.java index 16440b3..a0731b2 100644 --- a/src/main/java/me/retucio/sputnik/util/interfaces/TextVisitor.java +++ b/src/main/java/me/retucio/sputnik/util/interfaces/TextVisitor.java @@ -23,14 +23,6 @@ public interface TextVisitor { return text.visit((style, string) -> visitor.accept(queue.remove(), style, string), baseStyle); } - /** - * Collapses the tree of {@link Text} siblings into a one dimensional FIFO {@link Queue}. To match the behaviours of - * the {@link Text#visit(StringVisitable.Visitor)} and {@link Text#visit(StringVisitable.StyledVisitor, Style)} - * methods, texts with empty contents (created from {@link Text#empty()}) are ignored but their siblings are still - * processed. - * @param text the text - * @return the text and its siblings in the order they appear when rendered. - */ static ArrayDeque collectSiblings(Text text) { ArrayDeque queue = new ArrayDeque<>(); collectSiblings(text, queue); diff --git a/src/main/java/me/retucio/sputnik/util/render/GlintRenderLayer.java b/src/main/java/me/retucio/sputnik/util/render/GlintRenderLayer.java index 72bc9c9..96cdf70 100644 --- a/src/main/java/me/retucio/sputnik/util/render/GlintRenderLayer.java +++ b/src/main/java/me/retucio/sputnik/util/render/GlintRenderLayer.java @@ -3,6 +3,7 @@ package me.retucio.sputnik.util.render; import com.mojang.blaze3d.pipeline.RenderPipeline; import com.mojang.blaze3d.vertex.VertexFormat; import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; +import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.module.modules.render.GlintPlus; import net.minecraft.client.gl.RenderPipelines; import net.minecraft.client.render.*; @@ -55,7 +56,7 @@ public class GlintRenderLayer extends RenderLayer { } private static RenderLayer buildGlintRenderLayer(String name) { - final Identifier res = Identifier.of(me.retucio.sputnik.Sputnik.MOD_ID, "textures/misc/glint_" + name.toLowerCase() + ".png"); + final Identifier res = Identifier.of(Sputnik.MOD_ID, "textures/misc/glint_" + name.toLowerCase() + ".png"); return RenderLayer.of("glint_" + name, RenderSetup.builder(RenderPipelines.GLINT) .texture("Sampler0", res) @@ -66,7 +67,7 @@ public class GlintRenderLayer extends RenderLayer { } private static RenderLayer buildEntityGlintRenderLayer(String name) { - final Identifier res = Identifier.of(me.retucio.sputnik.Sputnik.MOD_ID, "textures/misc/glint_" + name.toLowerCase() + ".png"); + final Identifier res = Identifier.of(Sputnik.MOD_ID, "textures/misc/glint_" + name.toLowerCase() + ".png"); return RenderLayer.of("entity_glint_" + name, RenderSetup.builder(RenderPipelines.GLINT) .texture("Sampler0", res) @@ -78,7 +79,7 @@ public class GlintRenderLayer extends RenderLayer { private static RenderLayer buildArmorEntityGlintRenderLayer(String name) { - final Identifier res = Identifier.of(me.retucio.sputnik.Sputnik.MOD_ID, "textures/misc/glint_" + name.toLowerCase() + ".png"); + final Identifier res = Identifier.of(Sputnik.MOD_ID, "textures/misc/glint_" + name.toLowerCase() + ".png"); return RenderLayer.of("armor_glint_" + name, RenderSetup.builder(RenderPipelines.GLINT) .texture("Sampler0", res) diff --git a/src/main/java/me/retucio/sputnik/util/render/Layers.java b/src/main/java/me/retucio/sputnik/util/render/Layers.java index 11cc095..07c5e39 100644 --- a/src/main/java/me/retucio/sputnik/util/render/Layers.java +++ b/src/main/java/me/retucio/sputnik/util/render/Layers.java @@ -1,5 +1,6 @@ package me.retucio.sputnik.util.render; +import me.retucio.sputnik.Sputnik; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.RenderSetup; @@ -31,11 +32,11 @@ public class Layers { } static { - LINES = RenderLayer.of(me.retucio.sputnik.Sputnik.MOD_ID + "_lines", RenderSetup.builder(LINES_PIPELINE).build()); - LINES_CULL = RenderLayer.of(me.retucio.sputnik.Sputnik.MOD_ID + "_lines_cull", RenderSetup.builder(LINES_CULL_PIPELINE).build()); + LINES = RenderLayer.of(Sputnik.MOD_ID + "_lines", RenderSetup.builder(LINES_PIPELINE).build()); + LINES_CULL = RenderLayer.of(Sputnik.MOD_ID + "_lines_cull", RenderSetup.builder(LINES_CULL_PIPELINE).build()); - QUADS = RenderLayer.of(me.retucio.sputnik.Sputnik.MOD_ID + "_quads", RenderSetup.builder(QUADS_PIPELINE).build()); - QUADS_CULL = RenderLayer.of(me.retucio.sputnik.Sputnik.MOD_ID + "quads_cull", RenderSetup.builder(QUADS_CULL_PIPELINE).build()); + QUADS = RenderLayer.of(Sputnik.MOD_ID + "_quads", RenderSetup.builder(QUADS_PIPELINE).build()); + QUADS_CULL = RenderLayer.of(Sputnik.MOD_ID + "quads_cull", RenderSetup.builder(QUADS_CULL_PIPELINE).build()); } } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/util/render/Pipelines.java b/src/main/java/me/retucio/sputnik/util/render/Pipelines.java index f2204ad..a63bcf5 100644 --- a/src/main/java/me/retucio/sputnik/util/render/Pipelines.java +++ b/src/main/java/me/retucio/sputnik/util/render/Pipelines.java @@ -4,6 +4,7 @@ import com.mojang.blaze3d.pipeline.BlendFunction; import com.mojang.blaze3d.pipeline.RenderPipeline; import com.mojang.blaze3d.platform.DepthTestFunction; import com.mojang.blaze3d.vertex.VertexFormat; +import me.retucio.sputnik.Sputnik; import net.minecraft.client.gl.RenderPipelines; import net.minecraft.client.render.VertexFormats; import net.minecraft.util.Identifier; @@ -12,7 +13,7 @@ import net.minecraft.util.Identifier; public class Pipelines { static final RenderPipeline LINES_PIPELINE = RenderPipeline.builder(RenderPipelines.RENDERTYPE_LINES_SNIPPET) - .withLocation(Identifier.of(me.retucio.sputnik.Sputnik.MOD_ID, "pipeline/lines")) + .withLocation(Identifier.of(Sputnik.MOD_ID, "pipeline/lines")) .withVertexFormat(VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH, VertexFormat.DrawMode.LINES) .withDepthTestFunction(DepthTestFunction.NO_DEPTH_TEST) .withDepthWrite(false) @@ -20,7 +21,7 @@ public class Pipelines { .build(); static final RenderPipeline LINES_CULL_PIPELINE = RenderPipeline.builder(RenderPipelines.RENDERTYPE_LINES_SNIPPET) - .withLocation(Identifier.of(me.retucio.sputnik.Sputnik.MOD_ID, "pipeline/lines_cull")) + .withLocation(Identifier.of(Sputnik.MOD_ID, "pipeline/lines_cull")) .withVertexFormat(VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH, VertexFormat.DrawMode.LINES) .withDepthTestFunction(DepthTestFunction.LEQUAL_DEPTH_TEST) .withDepthWrite(false) @@ -28,7 +29,7 @@ public class Pipelines { .build(); static final RenderPipeline QUADS_PIPELINE = RenderPipeline.builder(RenderPipelines.POSITION_COLOR_SNIPPET) - .withLocation(Identifier.of(me.retucio.sputnik.Sputnik.MOD_ID, "pipeline/quads")) + .withLocation(Identifier.of(Sputnik.MOD_ID, "pipeline/quads")) .withVertexFormat(VertexFormats.POSITION_COLOR, VertexFormat.DrawMode.QUADS) .withDepthTestFunction(DepthTestFunction.NO_DEPTH_TEST) .withBlend(BlendFunction.TRANSLUCENT) @@ -37,7 +38,7 @@ public class Pipelines { .build(); static final RenderPipeline QUADS_CULL_PIPELINE = RenderPipeline.builder(RenderPipelines.POSITION_COLOR_SNIPPET) - .withLocation(Identifier.of(me.retucio.sputnik.Sputnik.MOD_ID, "pipeline/quads_cull")) + .withLocation(Identifier.of(Sputnik.MOD_ID, "pipeline/quads_cull")) .withVertexFormat(VertexFormats.POSITION_COLOR, VertexFormat.DrawMode.QUADS) .withDepthTestFunction(DepthTestFunction.LEQUAL_DEPTH_TEST) .withBlend(BlendFunction.TRANSLUCENT) diff --git a/src/main/resources/assets/sputnik/textures/capes/15th-anniversary.png b/src/main/resources/assets/sputnik/textures/capes/15th-anniversary.png new file mode 100644 index 0000000..5e05cf7 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/15th-anniversary.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/bedrock.png b/src/main/resources/assets/sputnik/textures/capes/bedrock.png new file mode 100644 index 0000000..3b5cad3 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/bedrock.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/birthday.png b/src/main/resources/assets/sputnik/textures/capes/birthday.png new file mode 100644 index 0000000..b9ec94e Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/birthday.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/cheapsh0t.png b/src/main/resources/assets/sputnik/textures/capes/cheapsh0t.png new file mode 100644 index 0000000..75ed53d Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/cheapsh0t.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/cherry-blossom.png b/src/main/resources/assets/sputnik/textures/capes/cherry-blossom.png new file mode 100644 index 0000000..647fbd9 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/cherry-blossom.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/chinese-translator.png b/src/main/resources/assets/sputnik/textures/capes/chinese-translator.png new file mode 100644 index 0000000..4d86fb1 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/chinese-translator.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/cobalt.png b/src/main/resources/assets/sputnik/textures/capes/cobalt.png new file mode 100644 index 0000000..639e6b1 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/cobalt.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/copper.png b/src/main/resources/assets/sputnik/textures/capes/copper.png new file mode 100644 index 0000000..aea52a9 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/copper.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/dannybstyle.png b/src/main/resources/assets/sputnik/textures/capes/dannybstyle.png new file mode 100644 index 0000000..34c4417 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/dannybstyle.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/experience-2025.png b/src/main/resources/assets/sputnik/textures/capes/experience-2025.png new file mode 100644 index 0000000..6584248 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/experience-2025.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/eye-blossom.png b/src/main/resources/assets/sputnik/textures/capes/eye-blossom.png new file mode 100644 index 0000000..b7d9398 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/eye-blossom.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/half-life.png b/src/main/resources/assets/sputnik/textures/capes/half-life.png new file mode 100644 index 0000000..91925b3 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/half-life.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/hollow-knight.png b/src/main/resources/assets/sputnik/textures/capes/hollow-knight.png new file mode 100644 index 0000000..db35cbc Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/hollow-knight.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/julianclark.png b/src/main/resources/assets/sputnik/textures/capes/julianclark.png new file mode 100644 index 0000000..949a966 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/julianclark.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/mcc-15.png b/src/main/resources/assets/sputnik/textures/capes/mcc-15.png new file mode 100644 index 0000000..21a5e4e Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/mcc-15.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/migrator.png b/src/main/resources/assets/sputnik/textures/capes/migrator.png new file mode 100644 index 0000000..feb6c4c Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/migrator.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/millionth-customer.png b/src/main/resources/assets/sputnik/textures/capes/millionth-customer.png new file mode 100644 index 0000000..936946b Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/millionth-customer.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/minecon-2011.png b/src/main/resources/assets/sputnik/textures/capes/minecon-2011.png new file mode 100644 index 0000000..e4c5728 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/minecon-2011.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/minecon-2012.png b/src/main/resources/assets/sputnik/textures/capes/minecon-2012.png new file mode 100644 index 0000000..84a268d Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/minecon-2012.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/minecon-2013.png b/src/main/resources/assets/sputnik/textures/capes/minecon-2013.png new file mode 100644 index 0000000..776ad09 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/minecon-2013.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/minecon-2015.png b/src/main/resources/assets/sputnik/textures/capes/minecon-2015.png new file mode 100644 index 0000000..b0db9b7 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/minecon-2015.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/minecon-2016.png b/src/main/resources/assets/sputnik/textures/capes/minecon-2016.png new file mode 100644 index 0000000..7983535 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/minecon-2016.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/minecraft.png b/src/main/resources/assets/sputnik/textures/capes/minecraft.png new file mode 100644 index 0000000..b158079 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/minecraft.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/mojang-old-old.png b/src/main/resources/assets/sputnik/textures/capes/mojang-old-old.png new file mode 100644 index 0000000..fb19315 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/mojang-old-old.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/mojang-old.png b/src/main/resources/assets/sputnik/textures/capes/mojang-old.png new file mode 100644 index 0000000..deac5c5 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/mojang-old.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/mojang.png b/src/main/resources/assets/sputnik/textures/capes/mojang.png new file mode 100644 index 0000000..47d5d33 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/mojang.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/mojira-mod.png b/src/main/resources/assets/sputnik/textures/capes/mojira-mod.png new file mode 100644 index 0000000..ccfacea Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/mojira-mod.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/mrmessiah.png b/src/main/resources/assets/sputnik/textures/capes/mrmessiah.png new file mode 100644 index 0000000..c79e156 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/mrmessiah.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/pancakes.png b/src/main/resources/assets/sputnik/textures/capes/pancakes.png new file mode 100644 index 0000000..0a4410d Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/pancakes.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/prismarine.png b/src/main/resources/assets/sputnik/textures/capes/prismarine.png new file mode 100644 index 0000000..53c248d Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/prismarine.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/realms-mapmaker.png b/src/main/resources/assets/sputnik/textures/capes/realms-mapmaker.png new file mode 100644 index 0000000..0dae4b2 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/realms-mapmaker.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/scrolls-champion.png b/src/main/resources/assets/sputnik/textures/capes/scrolls-champion.png new file mode 100644 index 0000000..775425e Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/scrolls-champion.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/sputnik.png b/src/main/resources/assets/sputnik/textures/capes/sputnik.png new file mode 100644 index 0000000..a5391c2 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/sputnik.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/tiktok.png b/src/main/resources/assets/sputnik/textures/capes/tiktok.png new file mode 100644 index 0000000..a420dca Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/tiktok.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/translator.png b/src/main/resources/assets/sputnik/textures/capes/translator.png new file mode 100644 index 0000000..e2d6492 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/translator.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/turtle.png b/src/main/resources/assets/sputnik/textures/capes/turtle.png new file mode 100644 index 0000000..7532618 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/turtle.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/twitch.png b/src/main/resources/assets/sputnik/textures/capes/twitch.png new file mode 100644 index 0000000..c4f18a3 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/twitch.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/valentine.png b/src/main/resources/assets/sputnik/textures/capes/valentine.png new file mode 100644 index 0000000..72ad2e8 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/valentine.png differ diff --git a/src/main/resources/assets/sputnik/textures/capes/vanilla.png b/src/main/resources/assets/sputnik/textures/capes/vanilla.png new file mode 100644 index 0000000..9a3c129 Binary files /dev/null and b/src/main/resources/assets/sputnik/textures/capes/vanilla.png differ diff --git a/src/main/resources/sputnik.mixins.json b/src/main/resources/sputnik.mixins.json index 7d6fd86..a52f689 100644 --- a/src/main/resources/sputnik.mixins.json +++ b/src/main/resources/sputnik.mixins.json @@ -30,6 +30,7 @@ "BossBarHudMixin", "BufferStorageMixin", "CameraMixin", + "CapeFeatureRendererMixin", "ChatHudLineMixin", "ChatHudLineVisibleMixin", "ChatHudMixin", @@ -47,6 +48,7 @@ "DamageParticleFactoryMixin", "DamageParticleMixin", "DisconnectedScreenMixin", + "ElytraFeatureRendererMixin", "EmitterParticleMixin", "EquipmentRendererMixin", "FogRendererMixin",