Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2329476fe4 | ||
|
|
6b2ec0e69a | ||
|
|
6fa409d60a | ||
|
|
4f816381c3 | ||
|
|
36c38bdf02 | ||
|
|
a6a6f1261e | ||
|
|
8891a57c7c |
No files matched your search
+3
-1
@@ -39,6 +39,8 @@ replay_*.log
|
|||||||
*.hprof
|
*.hprof
|
||||||
*.jfr
|
*.jfr
|
||||||
|
|
||||||
|
# otros
|
||||||
|
|
||||||
todo.txt
|
todo.txt
|
||||||
test.java
|
|
||||||
cambios.md
|
cambios.md
|
||||||
|
remappedSrc/
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# jenny's mod 2 100% real
|
# jenny's mod 2 100% real
|
||||||
|
|
||||||
mod para Minecraft Fabric 1.21.6 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
|
mod para Minecraft Fabric 1.21.10 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
|
||||||
|
|
||||||
## instalación
|
## instalación
|
||||||
|
|
||||||
@@ -10,8 +10,8 @@ mod para Minecraft Fabric 1.21.6 que añade algunas cosas QOL, mayormente relaci
|
|||||||
3. descargar el .jar
|
3. descargar el .jar
|
||||||
4. moverlo a tu directorio de mods (probablemente `%appdata%/.minecraft/mods`)
|
4. moverlo a tu directorio de mods (probablemente `%appdata%/.minecraft/mods`)
|
||||||
|
|
||||||
asegúrate de tener una version de Minecraft y Fabric compatibles con el mod (MC 1.21.6; Fabric 0.128.2)
|
asegúrate de tener una version de Minecraft y Fabric compatibles con el mod (MC `1.21.10`; Fabric `0.138.3`)
|
||||||
es posible que hayan problemas al usarlo junto a otros mods, especialmente otros clientes, pues pueden conflictar
|
es posible que haya problemas al usarlo junto a otros mods, especialmente junto a otros clientes, pues pueden conflictar entre ellos.
|
||||||
|
|
||||||
### para frikis de 200 de iq
|
### para frikis de 200 de iq
|
||||||
1. clona el respositorio (`git clone https://github.com/retuci0/camera-tweaks`)
|
1. clona el respositorio (`git clone https://github.com/retuci0/camera-tweaks`)
|
||||||
@@ -23,9 +23,11 @@ es posible que hayan problemas al usarlo junto a otros mods, especialmente otros
|
|||||||
|
|
||||||
`shift derecho` por defecto para abrir la interfaz
|
`shift derecho` por defecto para abrir la interfaz
|
||||||
|
|
||||||
|
`pág. arriba` por defecto para abrir el editor del hud
|
||||||
|
|
||||||
`$` como prefijo por defecto para comandos (se autocompletan)
|
`$` como prefijo por defecto para comandos (se autocompletan)
|
||||||
|
|
||||||
algunos módulos tienen teclas asignadas por defecto, asígnales `ESC` para desactivar sus teclas
|
algunos módulos tienen teclas asignadas por defecto, asígnales `ESC` para desactivar sus atajos de teclado
|
||||||
|
|
||||||
## interfaz
|
## interfaz
|
||||||
|
|
||||||
@@ -51,6 +53,7 @@ algunos módulos tienen teclas asignadas por defecto, asígnales `ESC` para desa
|
|||||||
<img src="screenshots/crits.png" alt="críticos">
|
<img src="screenshots/crits.png" alt="críticos">
|
||||||
<img src="screenshots/fullbright.png" alt="fullbright en modo gamma cambiando el color de los shaders">
|
<img src="screenshots/fullbright.png" alt="fullbright en modo gamma cambiando el color de los shaders">
|
||||||
<img src="screenshots/hud.png" alt="HUD">
|
<img src="screenshots/hud.png" alt="HUD">
|
||||||
|
<img src="screenshots/hudeditor.png" alt="editor de HUD">
|
||||||
|
|
||||||
## contibuciones
|
## contibuciones
|
||||||
|
|
||||||
@@ -59,3 +62,25 @@ sí por favor
|
|||||||
## licencia
|
## licencia
|
||||||
|
|
||||||
no sé, haz lo que quieras con esto, es puta basura xd
|
no sé, haz lo que quieras con esto, es puta basura xd
|
||||||
|
|
||||||
|
aunque estaría guay que acreditases
|
||||||
|
|
||||||
|
pero bueno
|
||||||
|
|
||||||
|
## descargo de responsabilidad
|
||||||
|
|
||||||
|
me importa una puta mierda lo que pase al usar este mod en servers donde es baneable y así.
|
||||||
|
|
||||||
|
## mods recomendados
|
||||||
|
|
||||||
|
> mods que recomiendo usar junto a este:
|
||||||
|
|
||||||
|
- [fabric api (necesario)](https://modrinth.com/mod/fabric-api/): necesario para el mod
|
||||||
|
- [sodium](https://modrinth.com/mod/sodium): mejora el rendimiento general del juego
|
||||||
|
- [viafabricplus](https://modrinth.com/mod/viafabricplus): te permite conectarte a servidores que tengan una versión distinta a la de tu cliente
|
||||||
|
- [xaero's world map](https://modrinth.com/mod/xaeros-world-map/) y [xaero's minimap](https://modrinth.com/mod/xaeros-minimap/): mapa chulo
|
||||||
|
- [mod menu](https://modrinth.com/mod/modmenu): lista de los mods instalados, y sus ajustes
|
||||||
|
- [iris](https://modrinth.com/mod/iris): shaders
|
||||||
|
- [lambdynamiclights](https://modrinth.com/mod/lambdynamiclights): iluminación dinámica
|
||||||
|
- [appleskin](https://modrinth.com/mod/appleskin/): información relacionada con la comida
|
||||||
|
- [baritone (desactualizado)](https://github.com/cabaletta/baritone): google maps para juego de cubos
|
||||||
@@ -24,7 +24,6 @@ dependencies {
|
|||||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
|
|
||||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-16
@@ -1,27 +1,29 @@
|
|||||||
# v1.3
|
# v1.7
|
||||||
|
|
||||||
## novedades
|
## novedades
|
||||||
|
|
||||||
|
|
||||||
### adiciones
|
### adiciones
|
||||||
|
|
||||||
- barra de búsqueda: filtra los ajustes de todos los paneles de ajustes, por nombre y descripción
|
- comando `$echest` (o `$ec` si eres un puto vago) para previsualizar los contenidos del enderchest en cualquier momento
|
||||||
- barra de deslizamiento
|
- se ha añadido un gradiente negro leve en la parte inferior del clickgui si el contenido excede los límites de la pantalla, para indicarlo visualmente
|
||||||
- módulo de jugador falso: invoca una entidad de jugador falsa, por motivos de testeo
|
|
||||||
- HUD: mostrar información adicional en pantalla (ej.: hora, fps, coordenadas, ...)
|
#### módulos nuevos:
|
||||||
|
|
||||||
|
- aviso de baja durabilidad: te avisa cuando un ítem llega a cierto porcentaje de durabilidad
|
||||||
|
- bypassear packs: te permite omitir packs de recursos forzados por el servidor, al establecer el modo en "preguntar" y seleccionar la opción "nuh uh"
|
||||||
|
- destello de enchants.: modifica el color del destello de los items y armadura encantada
|
||||||
|
|
||||||
### arreglos / mejoras
|
### arreglos / mejoras
|
||||||
|
|
||||||
- mejoras a la interfaz
|
- ahora puedes volver a abrir el clickgui y el editor de hud en la pantalla de inicio
|
||||||
- ahora el color de los widgets depende del color principal
|
- ya no se deja de renderizar el hud si algún modo de debug (chunks, hitboxes, etc.) está activado y "mostar en F3" está desactivado
|
||||||
- ahora solo se puede seleccionar un objeto de la interfaz a la vez
|
- ahora se pueden previsualizar enderchests igual que shulkers, desde el inventario (prev. de shulkers)
|
||||||
- cambiada la posición de los títulos de los marcos
|
- ahora el mod funciona al compilarlo tras clonarlo por github, ya que había gitignorado algunos archivos importantes jsajajs
|
||||||
|
- arreglados los problemas del módulo zoom (creo)
|
||||||
- ahora los módulos están ordenados por orden alfabético
|
- arregladas las opciones de ceguera y oscuridad de norender
|
||||||
|
- el color de la interfaz ya no es negro en el primer launch o cuando no se ha generado el archivo de config todavía
|
||||||
- ahora nametags también tiene en cuenta la absorción de un jugador al mostrar su vida
|
- arreglado el problema donde se muestra la marca de agua por defecto en la pantalla de inicio si no se abre un mundo primero
|
||||||
|
|
||||||
- el color del prefijo de las notificaciones por chat ahora depende de los ajustes de color
|
|
||||||
- ya no se muestra el prefijo equivocado en notificaciones por chat al meterse a un mundo por primera vez
|
|
||||||
|
|
||||||
## problemas reconocidos
|
## problemas reconocidos
|
||||||
|
|
||||||
|
|||||||
+11
-5
@@ -1,5 +1,11 @@
|
|||||||
meteor client dev team
|
Meteor Client: https://github.com/MeteorDevelopment/meteor-client | https://meteorclient.com
|
||||||
oyvey client (1.21 port by mioclient)
|
OyVey Port: https://github.com/mioclient/oyvey-ported/
|
||||||
lennyboi (youtube)
|
Lenny Boi: https://www.youtube.com/@lennyboi7195
|
||||||
packbar by cattyn on github
|
Shotify: https://modrinth.com/mod/shotify
|
||||||
shotify mod
|
No Telemetry: https://modrinth.com/mod/no-telemetry
|
||||||
|
Trouser Streak: https://github.com/etianl/Trouser-Streak
|
||||||
|
No More Purple: https://github.com/Pepperoni-Jabroni/NoMorePurple/
|
||||||
|
bypass-resource-pack: https://github.com/emilyy-dev/bypass-resource-pack
|
||||||
|
|
||||||
|
probablemente más pero como tengo demencia se me olvida
|
||||||
|
si quieres que te acredite o quite tu código de mi mod, mándame un mensaje en discord (username: retucio) y sin problemas :)
|
||||||
+5
-10
@@ -1,18 +1,13 @@
|
|||||||
# Done to increase the memory available to gradle.
|
|
||||||
org.gradle.jvmargs=-Xmx1G
|
org.gradle.jvmargs=-Xmx1G
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
|
||||||
# Fabric Properties
|
minecraft_version=1.21.10
|
||||||
# check these on https://fabricmc.net/develop
|
yarn_mappings=1.21.10+build.2
|
||||||
minecraft_version=1.21.6
|
loader_version=0.17.3
|
||||||
yarn_mappings=1.21.6+build.1
|
|
||||||
loader_version=0.17.2
|
|
||||||
loom_version=1.11-SNAPSHOT
|
loom_version=1.11-SNAPSHOT
|
||||||
|
|
||||||
# Mod Properties
|
mod_version=1.8
|
||||||
mod_version=1.3
|
|
||||||
maven_group=me.retucio
|
maven_group=me.retucio
|
||||||
archives_base_name=camtweaks
|
archives_base_name=camtweaks
|
||||||
|
|
||||||
# Dependencies
|
fabric_version=0.135.0+1.21.10
|
||||||
fabric_version=0.128.2+1.21.6
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 243 KiB |
@@ -16,7 +16,10 @@ import me.retucio.camtweaks.event.events.camtweaks.LoadModuleManagerEvent;
|
|||||||
import me.retucio.camtweaks.module.Module;
|
import me.retucio.camtweaks.module.Module;
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
|
||||||
import me.retucio.camtweaks.ui.ClickGUI;
|
import me.retucio.camtweaks.module.modules.HUD;
|
||||||
|
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||||
|
import me.retucio.camtweaks.ui.screen.HudEditorScreen;
|
||||||
|
import me.retucio.camtweaks.ui.HudRenderer;
|
||||||
import me.retucio.camtweaks.ui.buttons.BindButton;
|
import me.retucio.camtweaks.ui.buttons.BindButton;
|
||||||
import me.retucio.camtweaks.ui.buttons.SettingButton;
|
import me.retucio.camtweaks.ui.buttons.SettingButton;
|
||||||
import me.retucio.camtweaks.ui.buttons.TextButton;
|
import me.retucio.camtweaks.ui.buttons.TextButton;
|
||||||
@@ -31,10 +34,11 @@ import me.retucio.camtweaks.util.MiscUtil;
|
|||||||
|
|
||||||
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.MinecraftClient;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
|
||||||
import net.minecraft.client.gui.screen.TitleScreen;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
@@ -45,25 +49,40 @@ import org.lwjgl.glfw.GLFW;
|
|||||||
public class CameraTweaks implements ClientModInitializer {
|
public class CameraTweaks implements ClientModInitializer {
|
||||||
|
|
||||||
// cosas necesarias
|
// cosas necesarias
|
||||||
public static final String MOD_ID = "camtweaks";
|
|
||||||
public static final CameraTweaks INSTANCE = new CameraTweaks();
|
public static final CameraTweaks INSTANCE = new CameraTweaks();
|
||||||
public static final Logger LOGGER = LogManager.getLogger(CameraTweaks.class);
|
|
||||||
public static final EventBus EVENT_BUS = new EventBus();
|
public static final EventBus EVENT_BUS = new EventBus();
|
||||||
|
public static final Logger LOGGER = LogManager.getLogger(CameraTweaks.class);
|
||||||
public static MinecraftClient mc;
|
public static MinecraftClient mc;
|
||||||
|
|
||||||
|
// id y versión
|
||||||
|
public static final String MOD_ID = "camtweaks";
|
||||||
|
public static final String MOD_VERSION;
|
||||||
|
|
||||||
|
static {
|
||||||
|
MOD_VERSION = FabricLoader.getInstance().getModContainer(MOD_ID)
|
||||||
|
.orElseThrow()
|
||||||
|
.getMetadata()
|
||||||
|
.getVersion()
|
||||||
|
.getFriendlyString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private Screen prevScreen;
|
private Screen prevScreen;
|
||||||
public boolean settingsApplied = false;
|
public boolean settingsApplied = false;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
// por algún motivo aunque lo añada a los args de la JVM sigue siendo true a menos que haga esto??? puta vida
|
// por algún motivo aunque lo añada a los args de la JVM sigue siendo true a menos que haga esto??? puta vida
|
||||||
System.setProperty("java.awt.headless", "false");
|
System.setProperty("java.awt.headless", "false");
|
||||||
|
|
||||||
mc = MinecraftClient.getInstance();
|
mc = MinecraftClient.getInstance();
|
||||||
|
ConfigManager.load();
|
||||||
|
|
||||||
EVENT_BUS.register(this);
|
EVENT_BUS.register(this);
|
||||||
EVENT_BUS.register(MiscUtil.class);
|
EVENT_BUS.register(MiscUtil.class);
|
||||||
EVENT_BUS.register(ChatUtil.class);
|
EVENT_BUS.register(ChatUtil.class);
|
||||||
|
EVENT_BUS.register(HudRenderer.class);
|
||||||
|
|
||||||
Lists.init();
|
Lists.init();
|
||||||
|
|
||||||
@@ -74,10 +93,9 @@ public class CameraTweaks implements ClientModInitializer {
|
|||||||
EVENT_BUS.post(new LoadCommandManagerEvent());
|
EVENT_BUS.post(new LoadCommandManagerEvent());
|
||||||
|
|
||||||
ClickGUI.INSTANCE = new ClickGUI();
|
ClickGUI.INSTANCE = new ClickGUI();
|
||||||
|
HudEditorScreen.INSTANCE = new HudEditorScreen();
|
||||||
EVENT_BUS.post(new LoadClickGUIEvent());
|
EVENT_BUS.post(new LoadClickGUIEvent());
|
||||||
|
|
||||||
ConfigManager.load();
|
|
||||||
|
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||||
ConfigManager.save();
|
ConfigManager.save();
|
||||||
EVENT_BUS.post(new ShutdownEvent());
|
EVENT_BUS.post(new ShutdownEvent());
|
||||||
@@ -86,30 +104,34 @@ public class CameraTweaks implements ClientModInitializer {
|
|||||||
|
|
||||||
// se ejecuta cada tick, es decir, 20 veces por segundo
|
// se ejecuta cada tick, es decir, 20 veces por segundo
|
||||||
public void onTick() {
|
public void onTick() {
|
||||||
ModuleManager.INSTANCE.getEnabledModules().forEach(Module::onTick);
|
|
||||||
|
|
||||||
if (!settingsApplied
|
if (!settingsApplied
|
||||||
&& ConfigManager.getConfig() != null
|
&& ConfigManager.getConfig() != null
|
||||||
&& mc.player != null && mc.world != null) {
|
&& !ConfigManager.hasLoaded()) {
|
||||||
ConfigManager.applyConfig();
|
ConfigManager.applyConfig();
|
||||||
settingsApplied = true;
|
settingsApplied = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ModuleManager.INSTANCE.getEnabledModules().forEach(Module::onTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// se ejecuta cada vez que se presiona una tecla
|
// se ejecuta cada vez que se presiona una tecla
|
||||||
public void onKeyPress(int key, int action) {
|
public void onKeyPress(int key, int action) {
|
||||||
|
if (key == GLFW.GLFW_KEY_F3) return; // prevenir activación de módulos al usar combinaciones de F3
|
||||||
ModuleManager.INSTANCE.getEnabledModules().forEach(module -> module.onKey(key, action));
|
ModuleManager.INSTANCE.getEnabledModules().forEach(module -> module.onKey(key, action));
|
||||||
|
|
||||||
boolean anyFocused = isAnySettingButtonFocused() || ClickGUI.INSTANCE.getSearchBar().isFocused();
|
boolean anyFocused = isAnySettingButtonFocused() || ClickGUI.INSTANCE.getSearchBar().isFocused();
|
||||||
ClickGUI.INSTANCE.setAnyFocused(anyFocused);
|
ClickGUI.INSTANCE.setAnyFocused(anyFocused);
|
||||||
|
|
||||||
if (action == GLFW.GLFW_PRESS) {
|
if (action != GLFW.GLFW_RELEASE) {
|
||||||
if (BindCommand.onKeyPress(key)) return;
|
if (BindCommand.onKeyPress(key)) return;
|
||||||
|
if (action == GLFW.GLFW_PRESS) {
|
||||||
|
handleModuleToggle(key, anyFocused);
|
||||||
|
handleClickGUIKey(key, anyFocused);
|
||||||
|
handleHudEditorKey(key, anyFocused);
|
||||||
|
}
|
||||||
handleSettingButtonsKey(key, action);
|
handleSettingButtonsKey(key, action);
|
||||||
handleModuleToggle(key, anyFocused);
|
} else if (!anyFocused) {
|
||||||
handleClickGUIKey(key, anyFocused);
|
|
||||||
} else if (action == GLFW.GLFW_RELEASE && !anyFocused) {
|
|
||||||
handleModuleRelease(key);
|
handleModuleRelease(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,7 +175,7 @@ public class CameraTweaks implements ClientModInitializer {
|
|||||||
|
|
||||||
// al parecer esto hace que con la tecla de la interfaz puedas ir cambiando de splash text en la pantalla del título
|
// al parecer esto hace que con la tecla de la interfaz puedas ir cambiando de splash text en la pantalla del título
|
||||||
// pero me ha hecho gracia así que así se queda
|
// pero me ha hecho gracia así que así se queda
|
||||||
if (mc.currentScreen != ClickGUI.INSTANCE && !(mc.currentScreen instanceof TitleScreen)) {
|
if (mc.currentScreen != ClickGUI.INSTANCE) {
|
||||||
prevScreen = mc.currentScreen;
|
prevScreen = mc.currentScreen;
|
||||||
mc.setScreen(ClickGUI.INSTANCE);
|
mc.setScreen(ClickGUI.INSTANCE);
|
||||||
} else {
|
} else {
|
||||||
@@ -162,6 +184,19 @@ public class CameraTweaks implements ClientModInitializer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// manejar la lógica de apertura del editor de elementos del hud, con la misma lógica que handleClickGUIKey()
|
||||||
|
private void handleHudEditorKey(int key, boolean anyFocused) {
|
||||||
|
if (key != ModuleManager.INSTANCE.getModuleByClass(HUD.class).editorKey.getKey() || anyFocused) return;
|
||||||
|
|
||||||
|
if (mc.currentScreen != HudEditorScreen.INSTANCE) {
|
||||||
|
prevScreen = mc.currentScreen;
|
||||||
|
mc.setScreen(HudEditorScreen.INSTANCE);
|
||||||
|
} else {
|
||||||
|
HudEditorScreen.INSTANCE.close();
|
||||||
|
mc.setScreen(prevScreen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// se ocupa de apagar los módulos que tengan configurado hacerlo tras soltar su tecla
|
// se ocupa de apagar los módulos que tengan configurado hacerlo tras soltar su tecla
|
||||||
private void handleModuleRelease(int key) {
|
private void handleModuleRelease(int key) {
|
||||||
if (mc.currentScreen != null && mc.currentScreen != ClickGUI.INSTANCE) return;
|
if (mc.currentScreen != null && mc.currentScreen != ClickGUI.INSTANCE) return;
|
||||||
@@ -175,4 +210,8 @@ public class CameraTweaks implements ClientModInitializer {
|
|||||||
public void onStop(ShutdownEvent event) {
|
public void onStop(ShutdownEvent event) {
|
||||||
ConfigManager.save();
|
ConfigManager.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getVersionName() {
|
||||||
|
return MOD_ID + "_v" + MOD_VERSION + "_" + SharedConstants.getGameVersion().name();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,10 +2,14 @@ package me.retucio.camtweaks.command;
|
|||||||
|
|
||||||
import com.mojang.brigadier.CommandDispatcher;
|
import com.mojang.brigadier.CommandDispatcher;
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
|
import me.retucio.camtweaks.CameraTweaks;
|
||||||
import me.retucio.camtweaks.command.commands.*;
|
import me.retucio.camtweaks.command.commands.*;
|
||||||
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.command.CommandSource;
|
import net.minecraft.command.CommandSource;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@@ -30,7 +34,8 @@ public class CommandManager {
|
|||||||
public static void registerCommands() {
|
public static void registerCommands() {
|
||||||
addCommand(new BindCommand());
|
addCommand(new BindCommand());
|
||||||
addCommand(new CopyScreenshotCommand());
|
addCommand(new CopyScreenshotCommand());
|
||||||
// addCommand(new EnderChestCommand()); no funciona D:
|
addCommand(new EnderChestCommand());
|
||||||
|
addCommand(new GarbageCleanerCommand());
|
||||||
addCommand(new PeekCommand());
|
addCommand(new PeekCommand());
|
||||||
addCommand(new PrefixCommand());
|
addCommand(new PrefixCommand());
|
||||||
addCommand(new PurgeCommand());
|
addCommand(new PurgeCommand());
|
||||||
@@ -39,6 +44,15 @@ public class CommandManager {
|
|||||||
addCommand(new ToggleCommand());
|
addCommand(new ToggleCommand());
|
||||||
|
|
||||||
commands.sort(Comparator.comparing(Command::getName));
|
commands.sort(Comparator.comparing(Command::getName));
|
||||||
|
|
||||||
|
for (Command command : commands) {
|
||||||
|
for (Method method : command.getClass().getDeclaredMethods()) {
|
||||||
|
if (method.isAnnotationPresent(SubscribeEvent.class)) {
|
||||||
|
CameraTweaks.EVENT_BUS.register(command);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addCommand(Command command) {
|
public static void addCommand(Command command) {
|
||||||
|
|||||||
@@ -1,37 +1,59 @@
|
|||||||
package me.retucio.camtweaks.command.commands;
|
package me.retucio.camtweaks.command.commands;
|
||||||
|
|
||||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||||
|
import me.retucio.camtweaks.CameraTweaks;
|
||||||
import me.retucio.camtweaks.command.Command;
|
import me.retucio.camtweaks.command.Command;
|
||||||
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.DisconnectEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.OpenScreenEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.PacketEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.TickEvent;
|
||||||
|
import me.retucio.camtweaks.ui.screen.PreviewScreen;
|
||||||
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
|
import me.retucio.camtweaks.util.MiscUtil;
|
||||||
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
|
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
|
||||||
import net.minecraft.command.CommandSource;
|
import net.minecraft.command.CommandSource;
|
||||||
import net.minecraft.inventory.EnderChestInventory;
|
import net.minecraft.inventory.EnderChestInventory;
|
||||||
import net.minecraft.inventory.Inventories;
|
import net.minecraft.inventory.Inventories;
|
||||||
import net.minecraft.inventory.Inventory;
|
import net.minecraft.inventory.Inventory;
|
||||||
import net.minecraft.inventory.SimpleInventory;
|
import net.minecraft.inventory.SimpleInventory;
|
||||||
|
import net.minecraft.network.packet.s2c.play.CloseScreenS2CPacket;
|
||||||
import net.minecraft.screen.GenericContainerScreenHandler;
|
import net.minecraft.screen.GenericContainerScreenHandler;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
|
|
||||||
// accede a los contenidos de tu enderchest
|
// accede a los contenidos de tu enderchest
|
||||||
public class EnderChestCommand extends Command {
|
public class EnderChestCommand extends Command {
|
||||||
|
|
||||||
|
private boolean shouldOpenEchest = false;
|
||||||
|
|
||||||
public EnderChestCommand() {
|
public EnderChestCommand() {
|
||||||
super("echest", "muestra el contenido de tu enderchest", "ec", "enderchest");
|
super("echest", "muestra el contenido de tu enderchest (solo de ver)", "ec", "enderchest");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||||
builder.executes(ctx -> {
|
builder.executes(ctx -> {
|
||||||
mc.execute(() -> { // para evitar llamar setScreen desde el hilo equivocado, que causa crashes
|
mc.execute(() -> {
|
||||||
EnderChestInventory enderChestInv = mc.player.getEnderChestInventory();
|
if (mc.player == null) return;
|
||||||
|
if (MiscUtil.getEchestInv() == null) {
|
||||||
|
ChatUtil.warn("necesitas abrir un enderchest una vez primero");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// llámame imbécil pero no tengo ni idea de por qué no se abre
|
shouldOpenEchest = true;
|
||||||
mc.setScreen(new GenericContainerScreen(
|
|
||||||
GenericContainerScreenHandler.createGeneric9x3(mc.player.currentScreenHandler.syncId + 1, mc.player.getInventory(), enderChestInv),
|
|
||||||
mc.player.getInventory(),
|
|
||||||
Text.translatable("container.enderchest")
|
|
||||||
));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void tickEvent(TickEvent.Post event) {
|
||||||
|
if (shouldOpenEchest) {
|
||||||
|
shouldOpenEchest = false;
|
||||||
|
if (MiscUtil.getEchestInv() != null)
|
||||||
|
mc.setScreen(new PreviewScreen(MiscUtil.getEchestInv(), null));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package me.retucio.camtweaks.command.commands;
|
||||||
|
|
||||||
|
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||||
|
import me.retucio.camtweaks.command.Command;
|
||||||
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
|
import net.minecraft.command.CommandSource;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
|
public class GarbageCleanerCommand extends Command {
|
||||||
|
|
||||||
|
public GarbageCleanerCommand() {
|
||||||
|
super("cleanram", "limpia la ram mediante el recolector de basura (gc)", "gc", "garbagecollect");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||||
|
builder.executes(context -> {
|
||||||
|
System.gc();
|
||||||
|
ChatUtil.info(Text.of("ram limpiada"));
|
||||||
|
return SUCCESS;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ package me.retucio.camtweaks.config;
|
|||||||
import me.retucio.camtweaks.event.SubscribeEvent;
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
import me.retucio.camtweaks.event.events.camtweaks.*;
|
import me.retucio.camtweaks.event.events.camtweaks.*;
|
||||||
import me.retucio.camtweaks.module.settings.*;
|
import me.retucio.camtweaks.module.settings.*;
|
||||||
import me.retucio.camtweaks.ui.ClickGUI;
|
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -26,11 +26,16 @@ public class ClientConfig {
|
|||||||
// nombre del frame -> FrameData (que contiene extended, x & y)
|
// nombre del frame -> FrameData (que contiene extended, x & y)
|
||||||
public Map<String, FrameData> extendableFrames = new HashMap<>();
|
public Map<String, FrameData> extendableFrames = new HashMap<>();
|
||||||
|
|
||||||
|
// id del elemento del hud -> posición (x, y)
|
||||||
|
public Map<String, int[]> hudPositions = new HashMap<>();
|
||||||
|
|
||||||
|
// id del elemento del hud -> true: visible / false: no visible
|
||||||
|
public Map<String, Boolean> hudVisibilities = new HashMap<>();
|
||||||
|
|
||||||
public ClientConfig() {
|
public ClientConfig() {
|
||||||
EVENT_BUS.register(this);
|
EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onToggleModule(ToggleModuleEvent event) {
|
public void onToggleModule(ToggleModuleEvent event) {
|
||||||
ConfigManager.setModuleState(event.getModule());
|
ConfigManager.setModuleState(event.getModule());
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import me.retucio.camtweaks.CameraTweaks;
|
|||||||
import me.retucio.camtweaks.module.Module;
|
import me.retucio.camtweaks.module.Module;
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
import me.retucio.camtweaks.module.settings.*;
|
import me.retucio.camtweaks.module.settings.*;
|
||||||
import me.retucio.camtweaks.ui.ClickGUI;
|
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||||
import me.retucio.camtweaks.ui.frames.ClientSettingsFrame;
|
import me.retucio.camtweaks.ui.frames.ClientSettingsFrame;
|
||||||
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
||||||
|
|
||||||
@@ -23,6 +23,7 @@ public class ConfigManager {
|
|||||||
|
|
||||||
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
||||||
private static final File CONFIG_FILE = new File("camera_tweaks.json");
|
private static final File CONFIG_FILE = new File("camera_tweaks.json");
|
||||||
|
private static boolean loaded = false;
|
||||||
|
|
||||||
private static ClientConfig config = null;
|
private static ClientConfig config = null;
|
||||||
|
|
||||||
@@ -93,6 +94,8 @@ public class ConfigManager {
|
|||||||
|
|
||||||
CameraTweaks.LOGGER.info("posiciones de frames cargadas");
|
CameraTweaks.LOGGER.info("posiciones de frames cargadas");
|
||||||
ClickGUI.INSTANCE.refreshListButtons();
|
ClickGUI.INSTANCE.refreshListButtons();
|
||||||
|
|
||||||
|
loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ClientConfig getConfig() {
|
public static ClientConfig getConfig() {
|
||||||
@@ -114,7 +117,7 @@ public class ConfigManager {
|
|||||||
public static void setFramePosition(SettingsFrame frame) {
|
public static void setFramePosition(SettingsFrame frame) {
|
||||||
ensureConfig();
|
ensureConfig();
|
||||||
config.settingsFrames.put(frame.module.getName(), new int[]{frame.x, frame.y});
|
config.settingsFrames.put(frame.module.getName(), new int[]{frame.x, frame.y});
|
||||||
ConfigManager.save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setExtendableFrame(String key, ClientConfig.FrameData data) {
|
public static void setExtendableFrame(String key, ClientConfig.FrameData data) {
|
||||||
@@ -123,6 +126,19 @@ public class ConfigManager {
|
|||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setHudPosition(String id, int x, int y) {
|
||||||
|
ensureConfig();
|
||||||
|
config.hudPositions.put(id, new int[]{x, y});
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setHudVisibility(String id, Boolean visible) {
|
||||||
|
ensureConfig();
|
||||||
|
config.hudVisibilities.put(id, visible);
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public static void applySetting(Module parent, AbstractSetting setting) {
|
public static void applySetting(Module parent, AbstractSetting setting) {
|
||||||
String id = parent.getName() + ":" + setting.getName();
|
String id = parent.getName() + ":" + setting.getName();
|
||||||
@@ -153,4 +169,8 @@ public class ConfigManager {
|
|||||||
private static void ensureConfig() {
|
private static void ensureConfig() {
|
||||||
if (config == null) config = new ClientConfig();
|
if (config == null) config = new ClientConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean hasLoaded() {
|
||||||
|
return loaded;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package me.retucio.camtweaks.event.events;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.Event;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
|
public class AttackEntityEvent extends Event {
|
||||||
|
|
||||||
|
private final Entity entity;
|
||||||
|
|
||||||
|
public AttackEntityEvent(Entity entity) {
|
||||||
|
this.entity = entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package me.retucio.camtweaks.event.events;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.Event;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
|
public class BreakBlockEvent extends Event {
|
||||||
|
|
||||||
|
private BlockPos pos;
|
||||||
|
|
||||||
|
public BreakBlockEvent(BlockPos pos) {
|
||||||
|
this.pos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos getPos() {
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPos(BlockPos pos) {
|
||||||
|
this.pos = pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package me.retucio.camtweaks.event.events;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.Event;
|
||||||
|
|
||||||
|
public class ChangeRotationEvent extends Event {
|
||||||
|
|
||||||
|
private float yaw;
|
||||||
|
private float pitch;
|
||||||
|
|
||||||
|
public ChangeRotationEvent(float yaw, float pitch) {
|
||||||
|
this.yaw = yaw;
|
||||||
|
this.pitch = pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getYaw() {
|
||||||
|
return yaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYaw(float yaw) {
|
||||||
|
this.yaw = yaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getPitch() {
|
||||||
|
return pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPitch(float pitch) {
|
||||||
|
this.pitch = pitch;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package me.retucio.camtweaks.event.events;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.Event;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class DamageItemEvent extends Event {
|
||||||
|
|
||||||
|
private final int amount;
|
||||||
|
private final ItemStack stack;
|
||||||
|
|
||||||
|
public DamageItemEvent(int amount, ItemStack stack) {
|
||||||
|
this.amount = amount;
|
||||||
|
this.stack = stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAmount() {
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getStack() {
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package me.retucio.camtweaks.event.events;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.Event;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
|
import net.minecraft.util.Hand;
|
||||||
|
|
||||||
|
public class InteractEntityEvent extends Event {
|
||||||
|
|
||||||
|
private final Entity entity;
|
||||||
|
private Hand hand;
|
||||||
|
|
||||||
|
public InteractEntityEvent(Entity entity, Hand hand) {
|
||||||
|
this.entity = entity;
|
||||||
|
this.hand = hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Hand getHand() {
|
||||||
|
return hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHand(Hand hand) {
|
||||||
|
this.hand = hand;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package me.retucio.camtweaks.event.events;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.Event;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
|
import net.minecraft.util.Hand;
|
||||||
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
|
|
||||||
|
public class PlaceBlockEvent extends Event {
|
||||||
|
|
||||||
|
private Hand hand;
|
||||||
|
private BlockHitResult result;
|
||||||
|
|
||||||
|
public PlaceBlockEvent(Hand hand, BlockHitResult result) {
|
||||||
|
this.hand = hand;
|
||||||
|
this.result = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Hand getHand() {
|
||||||
|
return hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHand(Hand hand) {
|
||||||
|
this.hand = hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockHitResult getResult() {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResult(BlockHitResult result) {
|
||||||
|
this.result = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package me.retucio.camtweaks.event.events;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.Event;
|
||||||
|
import net.minecraft.client.render.Camera;
|
||||||
|
import net.minecraft.client.render.RenderTickCounter;
|
||||||
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
|
||||||
|
public class RenderWorldEvent extends Event {
|
||||||
|
|
||||||
|
private final MatrixStack matrices;
|
||||||
|
private final RenderTickCounter tc;
|
||||||
|
private final Camera camera;
|
||||||
|
|
||||||
|
public RenderWorldEvent(MatrixStack matrices, RenderTickCounter tc, Camera camera) {
|
||||||
|
this.matrices = matrices;
|
||||||
|
this.tc = tc;
|
||||||
|
this.camera = camera;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MatrixStack getMatrices() {
|
||||||
|
return matrices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderTickCounter getTickCounter() {
|
||||||
|
return tc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Camera getCamera() {
|
||||||
|
return camera;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package me.retucio.camtweaks.event.events;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.Event;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Hand;
|
||||||
|
|
||||||
|
public class UseItemEvent extends Event {
|
||||||
|
|
||||||
|
private ItemStack stack;
|
||||||
|
private Hand hand;
|
||||||
|
|
||||||
|
public UseItemEvent(ItemStack stack, Hand hand) {
|
||||||
|
this.stack = stack;
|
||||||
|
this.hand = hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getStack() {
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStack(ItemStack stack) {
|
||||||
|
this.stack = stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Hand getHand() {
|
||||||
|
return hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHand(Hand hand) {
|
||||||
|
this.hand = hand;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package me.retucio.camtweaks.event.events.camtweaks;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.Event;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
|
public class AddEntityEvent extends Event {
|
||||||
|
|
||||||
|
private final Entity entity;
|
||||||
|
|
||||||
|
public AddEntityEvent(Entity entity) {
|
||||||
|
this.entity = entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package me.retucio.camtweaks.event.events.camtweaks;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.Event;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
|
public class RemoveEntityEvent extends Event {
|
||||||
|
|
||||||
|
private final Entity entity;
|
||||||
|
|
||||||
|
public RemoveEntityEvent(Entity entity) {
|
||||||
|
this.entity = entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap;
|
||||||
|
import me.retucio.camtweaks.util.render.GlintRenderLayer;
|
||||||
|
import net.minecraft.client.render.BufferBuilderStorage;
|
||||||
|
import net.minecraft.client.render.RenderLayer;
|
||||||
|
import net.minecraft.client.util.BufferAllocator;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(BufferBuilderStorage.class)
|
||||||
|
public abstract class BufferStorageMixin {
|
||||||
|
|
||||||
|
@Inject(method = "assignBufferBuilder", at = @At("HEAD"))
|
||||||
|
private static void addGlintTypes(Object2ObjectLinkedOpenHashMap<RenderLayer, BufferAllocator> builderStorage, RenderLayer layer, CallbackInfo ci) {
|
||||||
|
GlintRenderLayer.addGlintTypes(builderStorage);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.mixin.accessor.ConfirmServerResourcePackScreenAccessor;
|
||||||
|
import me.retucio.camtweaks.mixin.accessor.PackAccessor;
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.RPackBypass;
|
||||||
|
import me.retucio.camtweaks.util.interfaces.IConfirmScreen;
|
||||||
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||||
|
import net.minecraft.client.network.ServerInfo;
|
||||||
|
import net.minecraft.client.option.ServerList;
|
||||||
|
import net.minecraft.network.ClientConnection;
|
||||||
|
import net.minecraft.network.packet.c2s.common.ResourcePackStatusC2SPacket;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|
||||||
|
@Mixin(ClientCommonNetworkHandler.class)
|
||||||
|
public abstract class ClientCommonNetworkHandlerMixin {
|
||||||
|
|
||||||
|
@Shadow @Final protected MinecraftClient client;
|
||||||
|
@Shadow @Final protected ServerInfo serverInfo;
|
||||||
|
@Shadow @Final protected ClientConnection connection;
|
||||||
|
|
||||||
|
@Unique // tardar 3 segundos porque algunos servers
|
||||||
|
private final Executor DELAYED_EXECUTOR = CompletableFuture.delayedExecutor(3L, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
@Inject(method = "createConfirmServerResourcePackScreen", at = @At("TAIL"))
|
||||||
|
private void setScreenBypassAction(UUID id, URL url, String hash, boolean required, Text prompt, CallbackInfoReturnable<Screen> cir) {
|
||||||
|
RPackBypass bypassPack = ModuleManager.INSTANCE.getModuleByClass(RPackBypass.class);
|
||||||
|
if (!bypassPack.isEnabled()) return;
|
||||||
|
|
||||||
|
final Screen screen = cir.getReturnValue();
|
||||||
|
((IConfirmScreen) screen).smegma$setBypassAction(() -> {
|
||||||
|
client.setScreen(((ConfirmServerResourcePackScreenAccessor) screen).getParentScreen());
|
||||||
|
if (this.serverInfo != null) {
|
||||||
|
this.serverInfo.setResourcePackPolicy(bypassPack.getPolicy());
|
||||||
|
this.client.getServerResourcePackProvider().acceptAll();
|
||||||
|
ServerList.updateServerListEntry(this.serverInfo);
|
||||||
|
}
|
||||||
|
bypass(((ConfirmServerResourcePackScreenAccessor) screen).getRequests().stream().map(PackAccessor::callId).toList());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
public void bypass(List<UUID> ids) {
|
||||||
|
ids.forEach(id -> connection.send(new ResourcePackStatusC2SPacket(id, ResourcePackStatusC2SPacket.Status.ACCEPTED)));
|
||||||
|
ids.forEach(id -> connection.send(new ResourcePackStatusC2SPacket(id, ResourcePackStatusC2SPacket.Status.DOWNLOADED)));
|
||||||
|
DELAYED_EXECUTOR.execute(() ->
|
||||||
|
ids.forEach(id -> connection.send(new ResourcePackStatusC2SPacket(id, ResourcePackStatusC2SPacket.Status.SUCCESSFULLY_LOADED)))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.PortalGUI;
|
||||||
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
import net.minecraft.client.network.ClientPlayerEntity;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(ClientPlayerEntity.class)
|
||||||
|
public abstract class ClientPlayerEntityMixin {
|
||||||
|
|
||||||
|
@ModifyExpressionValue(method = "tickNausea", at = @At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;"))
|
||||||
|
private Screen allowScreensInPortals(Screen original) {
|
||||||
|
if (ModuleManager.INSTANCE.getModuleByClass(PortalGUI.class).isEnabled()) return null;
|
||||||
|
return original;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,14 @@
|
|||||||
package me.retucio.camtweaks.mixin;
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
|
import me.retucio.camtweaks.event.events.AttackEntityEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.BreakBlockEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.InteractEntityEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.PlaceBlockEvent;
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
import me.retucio.camtweaks.module.modules.Freecam;
|
import me.retucio.camtweaks.module.modules.Freecam;
|
||||||
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||||
import net.minecraft.client.network.ClientPlayerEntity;
|
import net.minecraft.client.network.ClientPlayerEntity;
|
||||||
@@ -12,16 +19,24 @@ import net.minecraft.util.ActionResult;
|
|||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
@Mixin(ClientPlayerInteractionManager.class)
|
@Mixin(ClientPlayerInteractionManager.class)
|
||||||
public abstract class ClientPlayerInteractionManagerMixin {
|
public abstract class ClientPlayerInteractionManagerMixin {
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private MinecraftClient client;
|
||||||
@Unique
|
@Unique
|
||||||
Freecam freecam;
|
Freecam freecam;
|
||||||
|
|
||||||
@@ -30,19 +45,31 @@ public abstract class ClientPlayerInteractionManagerMixin {
|
|||||||
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// los paquetes ya se cancelan en la clase de Freecam, pero visualmente el bloque sigue apareciendo roto
|
|
||||||
@Inject(method = "breakBlock", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "breakBlock", at = @At("HEAD"), cancellable = true)
|
||||||
private void cancelBlockBreaking(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
private void onBlockBreak(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
||||||
if (freecam.isEnabled() && freecam.cancelActionPackets.isEnabled()) cir.setReturnValue(false);
|
BreakBlockEvent event = EVENT_BUS.post(new BreakBlockEvent(pos));
|
||||||
|
if (event.isCancelled()) cir.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "interactBlock", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "interactBlock", at = @At("HEAD"), cancellable = true)
|
||||||
private void cancelBlockPlacement(ClientPlayerEntity player, Hand hand, BlockHitResult hitResult, CallbackInfoReturnable<ActionResult> cir) {
|
private void onBlockPlace(ClientPlayerEntity player, Hand hand, BlockHitResult result, CallbackInfoReturnable<ActionResult> cir) {
|
||||||
if (freecam.isEnabled() && freecam.cancelActionPackets.isEnabled()) cir.setReturnValue(ActionResult.FAIL);
|
if (mc.player != player) return;
|
||||||
|
PlaceBlockEvent event = EVENT_BUS.post(new PlaceBlockEvent(hand, result));
|
||||||
|
if (event.isCancelled()) cir.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "interactEntity", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "interactEntity", at = @At("HEAD"), cancellable = true)
|
||||||
private void cancelEntityInteractions(PlayerEntity player, Entity entity, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
private void onEntityInteract(PlayerEntity player, Entity entity, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
||||||
if (freecam.isEnabled() && freecam.cancelActionPackets.isEnabled()) cir.setReturnValue(ActionResult.FAIL);
|
if (mc.player != player) return;
|
||||||
|
InteractEntityEvent event = EVENT_BUS.post(new InteractEntityEvent(entity, hand));
|
||||||
|
if (event.isCancelled()) cir.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "attackEntity", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onAttackEntity(PlayerEntity player, Entity target, CallbackInfo ci) {
|
||||||
|
if (player != client.player) return;
|
||||||
|
AttackEntityEvent event = EVENT_BUS.post(new AttackEntityEvent(target));
|
||||||
|
if (event.isCancelled()) ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.events.camtweaks.AddEntityEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.camtweaks.RemoveEntityEvent;
|
||||||
|
import net.minecraft.client.world.ClientWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||||
|
|
||||||
|
@Mixin(ClientWorld.class)
|
||||||
|
public abstract class ClientWorldMixin {
|
||||||
|
|
||||||
|
@Shadow @Nullable
|
||||||
|
public abstract Entity getEntityById(int id);
|
||||||
|
|
||||||
|
@Inject(method = "addEntity", at = @At("HEAD"))
|
||||||
|
private void onEntityAdded(Entity entity, CallbackInfo ci) {
|
||||||
|
if (entity != null) EVENT_BUS.post(new AddEntityEvent(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "removeEntity", at = @At("HEAD"))
|
||||||
|
private void onRemoveEntity(int entityId, Entity.RemovalReason removalReason, CallbackInfo ci) {
|
||||||
|
Entity entity = getEntityById(entityId);
|
||||||
|
if (entity != null) EVENT_BUS.post(new RemoveEntityEvent(entity));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
package me.retucio.camtweaks.mixin;
|
|
||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
|
||||||
import me.retucio.camtweaks.CameraTweaks;
|
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
|
||||||
import me.retucio.camtweaks.module.modules.Freecam;
|
|
||||||
import net.minecraft.client.render.Camera;
|
|
||||||
import net.minecraft.client.render.item.property.numeric.CompassState;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Vec3d;
|
|
||||||
import org.spongepowered.asm.mixin.Final;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
|
|
||||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
|
||||||
|
|
||||||
@Mixin(CompassState.class)
|
|
||||||
public abstract class CompassStateMixin {
|
|
||||||
|
|
||||||
@Unique
|
|
||||||
private static Freecam freecam;
|
|
||||||
|
|
||||||
@Inject(method = "<init>", at = @At("TAIL"))
|
|
||||||
private void getModules(boolean wobble, CompassState.Target target, CallbackInfo ci) {
|
|
||||||
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ModifyExpressionValue(method = "getBodyYaw", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getBodyYaw()F"))
|
|
||||||
private static float getBodyYaw(float original) {
|
|
||||||
if (freecam.isEnabled()) return mc.gameRenderer.getCamera().getYaw();
|
|
||||||
return original;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ModifyReturnValue(method = "getAngleTo(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/BlockPos;)D", at = @At("RETURN"))
|
|
||||||
private static double getAngleTo(double original, Entity entity, BlockPos blockPos) {
|
|
||||||
if (freecam.isEnabled()) {
|
|
||||||
Vec3d vec3d = Vec3d.ofCenter(blockPos);
|
|
||||||
Camera camera = mc.gameRenderer.getCamera();
|
|
||||||
return Math.atan2(vec3d.getZ() - camera.getPos().z, vec3d.getX() - camera.getPos().x) / (float) (Math.PI * 2);
|
|
||||||
}
|
|
||||||
return original;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.RPackBypass;
|
||||||
|
import me.retucio.camtweaks.util.interfaces.IConfirmScreen;
|
||||||
|
import net.minecraft.client.gui.screen.ConfirmScreen;
|
||||||
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||||
|
import net.minecraft.client.gui.widget.DirectionalLayoutWidget;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(ConfirmScreen.class)
|
||||||
|
public abstract class ConfirmScreenMixin extends Screen implements IConfirmScreen {
|
||||||
|
|
||||||
|
@Shadow protected DirectionalLayoutWidget layout;
|
||||||
|
@Unique private Runnable bypassAction = null;
|
||||||
|
|
||||||
|
protected ConfirmScreenMixin(final Text title) {
|
||||||
|
super(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ConfirmScreen;addButtons(Lnet/minecraft/client/gui/widget/DirectionalLayoutWidget;)V", shift = At.Shift.AFTER))
|
||||||
|
protected void addBypassButton(CallbackInfo ci) {
|
||||||
|
RPackBypass bypassPack = ModuleManager.INSTANCE.getModuleByClass(RPackBypass.class);
|
||||||
|
if (this.bypassAction != null && bypassPack.isEnabled())
|
||||||
|
this.layout.add(ButtonWidget.builder(bypassPack.BYPASS_TEXT, $ -> this.bypassAction.run()).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void smegma$setBypassAction(Runnable bypass) {
|
||||||
|
this.bypassAction = bypass;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,8 @@ package me.retucio.camtweaks.mixin;
|
|||||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
import me.retucio.camtweaks.module.modules.CritsPlus;
|
import me.retucio.camtweaks.module.modules.CritsPlus;
|
||||||
|
import me.retucio.camtweaks.util.Colors;
|
||||||
|
import net.minecraft.client.particle.BillboardParticle;
|
||||||
import net.minecraft.client.particle.DamageParticle;
|
import net.minecraft.client.particle.DamageParticle;
|
||||||
import net.minecraft.client.particle.ParticleTextureSheet;
|
import net.minecraft.client.particle.ParticleTextureSheet;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
@@ -14,9 +16,9 @@ import java.awt.*;
|
|||||||
@Mixin(DamageParticle.class)
|
@Mixin(DamageParticle.class)
|
||||||
public abstract class DamageParticleMixin {
|
public abstract class DamageParticleMixin {
|
||||||
|
|
||||||
@ModifyReturnValue(method = "getType", at = @At("RETURN"))
|
@ModifyReturnValue(method = "getRenderType", at = @At("RETURN"))
|
||||||
private ParticleTextureSheet makeCritsTranslucent(ParticleTextureSheet original) {
|
private BillboardParticle.RenderType makeCritsTranslucent(BillboardParticle.RenderType original) {
|
||||||
if (ModuleManager.INSTANCE.getModuleByClass(CritsPlus.class).isEnabled()) return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT;
|
if (ModuleManager.INSTANCE.getModuleByClass(CritsPlus.class).isEnabled()) return BillboardParticle.RenderType.PARTICLE_ATLAS_TRANSLUCENT;
|
||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,15 +27,13 @@ public abstract class DamageParticleMixin {
|
|||||||
@Mixin(DamageParticle.Factory.class)
|
@Mixin(DamageParticle.Factory.class)
|
||||||
abstract class DamageParticleFactoryMixin {
|
abstract class DamageParticleFactoryMixin {
|
||||||
|
|
||||||
@ModifyVariable(method = "createParticle(Lnet/minecraft/particle/SimpleParticleType;Lnet/minecraft/client/world/ClientWorld;DDDDDD)Lnet/minecraft/client/particle/Particle;", at = @At(value = "STORE"))
|
@ModifyVariable(method = "createParticle(Lnet/minecraft/particle/SimpleParticleType;Lnet/minecraft/client/world/ClientWorld;DDDDDDLnet/minecraft/util/math/random/Random;)Lnet/minecraft/client/particle/Particle;", at = @At(value = "STORE"))
|
||||||
private DamageParticle modifyCritColor(DamageParticle original) {
|
private DamageParticle modifyCritColor(DamageParticle original) {
|
||||||
CritsPlus crits = ModuleManager.INSTANCE.getModuleByClass(CritsPlus.class);
|
CritsPlus crits = ModuleManager.INSTANCE.getModuleByClass(CritsPlus.class);
|
||||||
if (!crits.isEnabled()) return original;
|
if (!crits.isEnabled()) return original;
|
||||||
|
|
||||||
if (crits.rainbow.isEnabled()) {
|
if (crits.rainbow.isEnabled()) {
|
||||||
float speed = 10001 - crits.rainbowSpeed.getFloatValue();
|
Color gamning = Colors.rainbowColor(crits.rainbowSpeed.getIntValue(), crits.alpha.getIntValue());
|
||||||
float hue = (System.currentTimeMillis() % (int) speed) / speed;
|
|
||||||
Color gamning = Color.getHSBColor(hue, 1, 1);
|
|
||||||
original.setColor(
|
original.setColor(
|
||||||
gamning.getRed() / 255f,
|
gamning.getRed() / 255f,
|
||||||
gamning.getGreen() / 255f,
|
gamning.getGreen() / 255f,
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package me.retucio.camtweaks.mixin;
|
|
||||||
|
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
|
||||||
import me.retucio.camtweaks.module.modules.NoRender;
|
|
||||||
import net.minecraft.particle.EntityEffectParticleEffect;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|
||||||
|
|
||||||
@Mixin(EntityEffectParticleEffect.class)
|
|
||||||
public abstract class EntityEffectParticleEffectMixin {
|
|
||||||
|
|
||||||
@Inject(method = "getAlpha", at = @At("HEAD"), cancellable = true)
|
|
||||||
private void noRenderPotionParticles(CallbackInfoReturnable<Float> cir) {
|
|
||||||
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
|
||||||
if (noRender.isEnabled()) cir.setReturnValue(256 - noRender.potionParticleAlpha.getFloatValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,9 @@
|
|||||||
package me.retucio.camtweaks.mixin;
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
import me.retucio.camtweaks.event.events.ChangeRotationEvent;
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
import me.retucio.camtweaks.module.modules.AntiInvis;
|
import me.retucio.camtweaks.module.modules.*;
|
||||||
import me.retucio.camtweaks.module.modules.Freecam;
|
|
||||||
import me.retucio.camtweaks.module.modules.Freelook;
|
|
||||||
import me.retucio.camtweaks.module.modules.Nametags;
|
|
||||||
import me.retucio.camtweaks.util.ChatUtil;
|
|
||||||
import net.minecraft.entity.*;
|
import net.minecraft.entity.*;
|
||||||
import net.minecraft.entity.passive.TameableEntity;
|
import net.minecraft.entity.passive.TameableEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
@@ -14,7 +11,6 @@ import net.minecraft.entity.projectile.PersistentProjectileEntity;
|
|||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
@@ -23,6 +19,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
@Mixin(Entity.class)
|
@Mixin(Entity.class)
|
||||||
@@ -34,6 +31,12 @@ public abstract class EntityMixin {
|
|||||||
@Shadow
|
@Shadow
|
||||||
public abstract EntityType<?> getType();
|
public abstract EntityType<?> getType();
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
private float yaw;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
private float pitch;
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
Freecam freecam;
|
Freecam freecam;
|
||||||
|
|
||||||
@@ -43,12 +46,16 @@ public abstract class EntityMixin {
|
|||||||
@Unique
|
@Unique
|
||||||
Nametags nametags;
|
Nametags nametags;
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
Rotations rotations;
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
@Inject(method = "<init>", at = @At("TAIL"))
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
private void getModules(EntityType type, World world, CallbackInfo ci) {
|
private void getModules(EntityType type, World world, CallbackInfo ci) {
|
||||||
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
||||||
freelook = ModuleManager.INSTANCE.getModuleByClass(Freelook.class);
|
freelook = ModuleManager.INSTANCE.getModuleByClass(Freelook.class);
|
||||||
nametags = ModuleManager.INSTANCE.getModuleByClass(Nametags.class);
|
nametags = ModuleManager.INSTANCE.getModuleByClass(Nametags.class);
|
||||||
|
rotations = ModuleManager.INSTANCE.getModuleByClass(Rotations.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -64,10 +71,10 @@ public abstract class EntityMixin {
|
|||||||
ci.cancel();
|
ci.cancel();
|
||||||
|
|
||||||
} else if (freelook.isEnabled() && freelook.mode.is(Freelook.CameraMode.CAMERA)) {
|
} else if (freelook.isEnabled() && freelook.mode.is(Freelook.CameraMode.CAMERA)) {
|
||||||
freelook.setYaw(freelook.getYaw() + (float) (cursorDeltaX / freelook.mouseSens.getFloatValue()));
|
freelook.setYaw(freelook.getYaw() + (float) (cursorDeltaX * freelook.mouseSens.getFloatValue()));
|
||||||
freelook.setPitch(freelook.getPitch() + (float) (cursorDeltaY / freelook.mouseSens.getFloatValue()));
|
freelook.setPitch(freelook.getPitch() + (float) (cursorDeltaY * freelook.mouseSens.getFloatValue()));
|
||||||
|
|
||||||
if (Math.abs(freelook.getPitch()) > 90.0F) freelook.setPitch(freelook.getPitch() > 0 ? 90 : -90);
|
if (Math.abs(freelook.getPitch()) > 90) freelook.setPitch(freelook.getPitch() > 0 ? 90 : -90);
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,6 +87,7 @@ public abstract class EntityMixin {
|
|||||||
private boolean renderEntityNametags(boolean original) {
|
private boolean renderEntityNametags(boolean original) {
|
||||||
if (!nametags.isEnabled()) return original;
|
if (!nametags.isEnabled()) return original;
|
||||||
if ((Object) this instanceof PersistentProjectileEntity p && p.isOnGround()) return false;
|
if ((Object) this instanceof PersistentProjectileEntity p && p.isOnGround()) return false;
|
||||||
|
if ((Object) this instanceof ItemEntity i && !nametags.items.isEnabled(i.getStack().getItem())) return false;
|
||||||
return nametags.entities.isEnabled((this.getType()));
|
return nametags.entities.isEnabled((this.getType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,6 +124,30 @@ public abstract class EntityMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// rotaciones
|
||||||
|
|
||||||
|
@Inject(method = "setRotation", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onRotation(float yaw, float pitch, CallbackInfo ci) {
|
||||||
|
if ((Object) this != mc.player) return;
|
||||||
|
ChangeRotationEvent event = EVENT_BUS.post(new ChangeRotationEvent(yaw, pitch));
|
||||||
|
if (event.isCancelled()) ci.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "setYaw", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onChangeYaw(float yaw, CallbackInfo ci) {
|
||||||
|
if ((Object) this != mc.player) return;
|
||||||
|
ChangeRotationEvent event = EVENT_BUS.post(new ChangeRotationEvent(yaw, this.pitch));
|
||||||
|
if (event.isCancelled()) ci.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "setPitch", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onChangePitch(float pitch, CallbackInfo ci) {
|
||||||
|
if ((Object) this != mc.player) return;
|
||||||
|
ChangeRotationEvent event = EVENT_BUS.post(new ChangeRotationEvent(this.yaw, pitch));
|
||||||
|
if (event.isCancelled()) ci.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// otros
|
// otros
|
||||||
|
|
||||||
@Inject(method = "isInvisibleTo", at = @At("RETURN"), cancellable = true)
|
@Inject(method = "isInvisibleTo", at = @At("RETURN"), cancellable = true)
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.GlintPlus;
|
||||||
|
import net.minecraft.client.render.RenderLayer;
|
||||||
|
import net.minecraft.client.render.entity.equipment.EquipmentRenderer;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
@Mixin(EquipmentRenderer.class)
|
||||||
|
public abstract class EquipmentRendererMixin {
|
||||||
|
|
||||||
|
@Redirect(method = "render(Lnet/minecraft/client/render/entity/equipment/EquipmentModel$LayerType;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/client/model/Model;Ljava/lang/Object;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/command/OrderedRenderCommandQueue;ILnet/minecraft/util/Identifier;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/RenderLayer;getArmorEntityGlint()Lnet/minecraft/client/render/RenderLayer;"))
|
||||||
|
private RenderLayer redirectArmorEntityGlint() {
|
||||||
|
GlintPlus glintPlus = ModuleManager.INSTANCE.getModuleByClass(GlintPlus.class);
|
||||||
|
return glintPlus.getArmorEntityGlint();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,8 +36,7 @@ public abstract class FogRendererMixin {
|
|||||||
if ((className.equals("BlindnessEffectFogModifier") && !noRender.blindnessEffect.isEnabled())
|
if ((className.equals("BlindnessEffectFogModifier") && !noRender.blindnessEffect.isEnabled())
|
||||||
|| (className.equals("DarknessEffectFogModifier") && !noRender.darknessEffect.isEnabled())
|
|| (className.equals("DarknessEffectFogModifier") && !noRender.darknessEffect.isEnabled())
|
||||||
|| ((className.equals("LavaFogModifier") || className.equals("WaterFogModifier")
|
|| ((className.equals("LavaFogModifier") || className.equals("WaterFogModifier")
|
||||||
|| className.equals("PowederSnowFogModifier")) && !noRender.fluidOverlay.isEnabled())
|
|| className.equals("PowederSnowFogModifier")) && !noRender.fluidOverlay.isEnabled()))
|
||||||
|| (className.equals("DimensionOrBossFogModifier") && !noRender.dimensionFog.isEnabled()))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return instance.shouldApply(cameraSubmersionType, entity);
|
return instance.shouldApply(cameraSubmersionType, entity);
|
||||||
|
|||||||
@@ -1,19 +1,27 @@
|
|||||||
package me.retucio.camtweaks.mixin;
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
|
||||||
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
import me.retucio.camtweaks.event.events.GetFOVEvent;
|
import me.retucio.camtweaks.event.events.GetFOVEvent;
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
import me.retucio.camtweaks.module.modules.Freecam;
|
import me.retucio.camtweaks.module.modules.Freecam;
|
||||||
|
import me.retucio.camtweaks.module.modules.NoMiningInterruptions;
|
||||||
import me.retucio.camtweaks.module.modules.NoRender;
|
import me.retucio.camtweaks.module.modules.NoRender;
|
||||||
import me.retucio.camtweaks.module.modules.Zoom;
|
import me.retucio.camtweaks.module.modules.Zoom;
|
||||||
import me.retucio.camtweaks.util.interfaces.IVec3d;
|
import me.retucio.camtweaks.util.interfaces.IVec3d;
|
||||||
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.render.BufferBuilderStorage;
|
import net.minecraft.client.render.BufferBuilderStorage;
|
||||||
import net.minecraft.client.render.GameRenderer;
|
import net.minecraft.client.render.GameRenderer;
|
||||||
|
import net.minecraft.client.render.block.BlockRenderManager;
|
||||||
import net.minecraft.client.render.item.HeldItemRenderer;
|
import net.minecraft.client.render.item.HeldItemRenderer;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
|
import net.minecraft.util.hit.EntityHitResult;
|
||||||
|
import net.minecraft.util.hit.HitResult;
|
||||||
import org.joml.Matrix4f;
|
import org.joml.Matrix4f;
|
||||||
import org.joml.Vector3d;
|
import org.joml.Vector3d;
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
@@ -22,9 +30,11 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
|
||||||
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||||
|
|
||||||
|
|
||||||
@Mixin(GameRenderer.class)
|
@Mixin(GameRenderer.class)
|
||||||
public abstract class GameRendererMixin {
|
public abstract class GameRendererMixin {
|
||||||
|
|
||||||
@@ -47,7 +57,7 @@ public abstract class GameRendererMixin {
|
|||||||
public abstract void updateCrosshairTarget(float tickDelta);
|
public abstract void updateCrosshairTarget(float tickDelta);
|
||||||
|
|
||||||
@Inject(method = "<init>", at = @At("TAIL"))
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
private void getModules(MinecraftClient client, HeldItemRenderer firstPersonHeldItemRenderer, BufferBuilderStorage buffers, CallbackInfo ci) {
|
private void getModules(MinecraftClient client, HeldItemRenderer firstPersonHeldItemRenderer, BufferBuilderStorage buffers, BlockRenderManager blockRenderManager, CallbackInfo ci) {
|
||||||
zoom = ModuleManager.INSTANCE.getModuleByClass(Zoom.class);;
|
zoom = ModuleManager.INSTANCE.getModuleByClass(Zoom.class);;
|
||||||
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
||||||
noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
@@ -78,7 +88,7 @@ public abstract class GameRendererMixin {
|
|||||||
float lastYaw = cameraEntity.lastYaw;
|
float lastYaw = cameraEntity.lastYaw;
|
||||||
float lastPitch = cameraEntity.lastPitch;
|
float lastPitch = cameraEntity.lastPitch;
|
||||||
|
|
||||||
((IVec3d) cameraEntity.getPos()).smegma$set(pos.x, pos.y - cameraEntity.getEyeHeight(cameraEntity.getPose()), pos.z);
|
((IVec3d) cameraEntity.getEntityPos()).smegma$set(pos.x, pos.y - cameraEntity.getEyeHeight(cameraEntity.getPose()), pos.z);
|
||||||
cameraEntity.lastX = prevPos.x;
|
cameraEntity.lastX = prevPos.x;
|
||||||
cameraEntity.lastY = prevPos.y - cameraEntity.getEyeHeight(cameraEntity.getPose());
|
cameraEntity.lastY = prevPos.y - cameraEntity.getEyeHeight(cameraEntity.getPose());
|
||||||
cameraEntity.lastZ = prevPos.z;
|
cameraEntity.lastZ = prevPos.z;
|
||||||
@@ -91,7 +101,7 @@ public abstract class GameRendererMixin {
|
|||||||
updateCrosshairTarget(tickDelta);
|
updateCrosshairTarget(tickDelta);
|
||||||
freecamDone = false;
|
freecamDone = false;
|
||||||
|
|
||||||
((IVec3d) cameraEntity.getPos()).smegma$set(x, y, z);
|
((IVec3d) cameraEntity.getEntityPos()).smegma$set(x, y, z);
|
||||||
cameraEntity.lastX = lastX;
|
cameraEntity.lastX = lastX;
|
||||||
cameraEntity.lastY = lastY;
|
cameraEntity.lastY = lastY;
|
||||||
cameraEntity.lastZ = lastZ;
|
cameraEntity.lastZ = lastZ;
|
||||||
@@ -113,4 +123,15 @@ public abstract class GameRendererMixin {
|
|||||||
private float noRenderNauseaDistortion(float scaledNauseaEffectFactor) {
|
private float noRenderNauseaDistortion(float scaledNauseaEffectFactor) {
|
||||||
return (noRender.isEnabled() && !noRender.nauseaEffect.isEnabled()) ? 0 : scaledNauseaEffectFactor;
|
return (noRender.isEnabled() && !noRender.nauseaEffect.isEnabled()) ? 0 : scaledNauseaEffectFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ModifyReturnValue(method = "findCrosshairTarget", at = @At("RETURN"))
|
||||||
|
private HitResult onTargetEntity(HitResult original, @Local HitResult hitResult) {
|
||||||
|
NoMiningInterruptions nmi = ModuleManager.INSTANCE.getModuleByClass(NoMiningInterruptions.class);
|
||||||
|
|
||||||
|
Entity entity = original instanceof EntityHitResult result ? result.getEntity() : null;
|
||||||
|
if (nmi.shouldIgnoreEntity(entity) && hitResult.getType() == HitResult.Type.BLOCK)
|
||||||
|
return hitResult;
|
||||||
|
|
||||||
|
return original;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
import me.retucio.camtweaks.CameraTweaks;
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.BungeecordSpoofer;
|
||||||
|
import net.minecraft.network.packet.c2s.handshake.ConnectionIntent;
|
||||||
|
import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket;
|
||||||
|
import org.spongepowered.asm.mixin.*;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
|
@Mixin(HandshakeC2SPacket.class)
|
||||||
|
public abstract class HandshakeC2SPacketMixin {
|
||||||
|
|
||||||
|
@Shadow @Mutable @Final
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private final Gson gson = new Gson();
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private static final ExecutorService executor = Executors.newCachedThreadPool();
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract ConnectionIntent intendedState();
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@Inject(method = "<init>(ILjava/lang/String;ILnet/minecraft/network/packet/c2s/handshake/ConnectionIntent;)V", at = @At("RETURN"))
|
||||||
|
private void onHandshakeC2SPacket(int i, String string, int j, ConnectionIntent connectionIntent, CallbackInfo ci) {
|
||||||
|
BungeecordSpoofer spoofer = ModuleManager.INSTANCE.getModuleByClass(BungeecordSpoofer.class);
|
||||||
|
if (!spoofer.isEnabled()) return;
|
||||||
|
|
||||||
|
if (this.intendedState() != ConnectionIntent.LOGIN) return;
|
||||||
|
|
||||||
|
final String[] spoofedUUID = {CameraTweaks.mc.getSession().getUuidOrNull().toString()};
|
||||||
|
String URL = "https://api.mojang.com/users/profiles/minecraft/" + mc.getSession().getUsername();
|
||||||
|
|
||||||
|
executor.execute(() -> {
|
||||||
|
try {
|
||||||
|
HttpURLConnection req = (HttpURLConnection) new URL(URL).openConnection();
|
||||||
|
req.setRequestMethod("GET");
|
||||||
|
req.setConnectTimeout(5000);
|
||||||
|
req.setReadTimeout(5000);
|
||||||
|
|
||||||
|
if (req.getResponseCode() != 200) {
|
||||||
|
this.address += "\u0000" + spoofer.address.getValue() + "\u0000" + spoofedUUID[0];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonObject obj = JsonParser.parseReader(new InputStreamReader(req.getInputStream())).getAsJsonObject();
|
||||||
|
|
||||||
|
if (obj.has("id"))
|
||||||
|
spoofedUUID[0] = obj.get("id").getAsString();
|
||||||
|
|
||||||
|
this.address += "\u0000" + spoofer.address.getValue() + "\u0000" + spoofedUUID[0];
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
this.address += "\u0000" + spoofer.address.getValue() + "\u0000" + spoofedUUID[0];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -9,7 +9,8 @@ import net.minecraft.client.MinecraftClient;
|
|||||||
import net.minecraft.client.item.ItemModelManager;
|
import net.minecraft.client.item.ItemModelManager;
|
||||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
import net.minecraft.client.render.VertexConsumerProvider;
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
import net.minecraft.client.render.command.OrderedRenderCommandQueue;
|
||||||
|
import net.minecraft.client.render.entity.EntityRenderManager;
|
||||||
import net.minecraft.client.render.item.HeldItemRenderer;
|
import net.minecraft.client.render.item.HeldItemRenderer;
|
||||||
import net.minecraft.client.render.item.ItemRenderer;
|
import net.minecraft.client.render.item.ItemRenderer;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
@@ -49,17 +50,17 @@ public abstract class HeldItemRendererMixin {
|
|||||||
protected abstract boolean shouldSkipHandAnimationOnSwap(ItemStack from, ItemStack to);
|
protected abstract boolean shouldSkipHandAnimationOnSwap(ItemStack from, ItemStack to);
|
||||||
|
|
||||||
@Inject(method = "<init>", at = @At("TAIL"))
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
private void getModules(MinecraftClient client, EntityRenderDispatcher entityRenderDispatcher, ItemRenderer itemRenderer, ItemModelManager itemModelManager, CallbackInfo ci) {
|
private void getModules(MinecraftClient client, EntityRenderManager entityRenderDispatcher, ItemRenderer itemRenderer, ItemModelManager itemModelManager, CallbackInfo ci) {
|
||||||
handView = ModuleManager.INSTANCE.getModuleByClass(HandView.class);
|
handView = ModuleManager.INSTANCE.getModuleByClass(HandView.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderFirstPersonItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/item/HeldItemRenderer;renderItem(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemDisplayContext;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", shift = At.Shift.BEFORE))
|
@Inject(method = "renderFirstPersonItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/item/HeldItemRenderer;renderItem(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemDisplayContext;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/command/OrderedRenderCommandQueue;I)V", shift = At.Shift.BEFORE))
|
||||||
private void onRenderItem(AbstractClientPlayerEntity player, float tickDelta, float pitch, Hand hand, float swingProgress, ItemStack item, float equipProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) {
|
private void onRenderItem(AbstractClientPlayerEntity player, float tickProgress, float pitch, Hand hand, float swingProgress, ItemStack item, float equipProgress, MatrixStack matrices, OrderedRenderCommandQueue orderedRenderCommandQueue, int light, CallbackInfo ci) {
|
||||||
EVENT_BUS.post(new RenderHeldItemEvent(matrices, hand));
|
EVENT_BUS.post(new RenderHeldItemEvent(matrices, hand));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderFirstPersonItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/item/HeldItemRenderer;renderArmHoldingItem(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IFFLnet/minecraft/util/Arm;)V"))
|
@Inject(method = "renderFirstPersonItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/item/HeldItemRenderer;renderArmHoldingItem(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/command/OrderedRenderCommandQueue;IFFLnet/minecraft/util/Arm;)V"))
|
||||||
private void onRenderArm(AbstractClientPlayerEntity player, float tickDelta, float pitch, Hand hand, float swingProgress, ItemStack item, float equipProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) {
|
private void onRenderArm(AbstractClientPlayerEntity player, float tickProgress, float pitch, Hand hand, float swingProgress, ItemStack item, float equipProgress, MatrixStack matrices, OrderedRenderCommandQueue orderedRenderCommandQueue, int light, CallbackInfo ci) {
|
||||||
EVENT_BUS.post(new RenderArmEvent(matrices, hand));
|
EVENT_BUS.post(new RenderArmEvent(matrices, hand));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import me.retucio.camtweaks.module.ModuleManager;
|
|||||||
import me.retucio.camtweaks.module.modules.ChatPlus;
|
import me.retucio.camtweaks.module.modules.ChatPlus;
|
||||||
import me.retucio.camtweaks.module.modules.Freecam;
|
import me.retucio.camtweaks.module.modules.Freecam;
|
||||||
import me.retucio.camtweaks.module.modules.NoRender;
|
import me.retucio.camtweaks.module.modules.NoRender;
|
||||||
import me.retucio.camtweaks.ui.HUD;
|
import me.retucio.camtweaks.ui.HudRenderer;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.hud.InGameHud;
|
import net.minecraft.client.gui.hud.InGameHud;
|
||||||
@@ -66,7 +66,7 @@ public abstract class InGameHudMixin {
|
|||||||
|
|
||||||
@Inject(method = "render", at = @At("RETURN"))
|
@Inject(method = "render", at = @At("RETURN"))
|
||||||
private void renderHUD(DrawContext ctx, RenderTickCounter tc, CallbackInfo ci) {
|
private void renderHUD(DrawContext ctx, RenderTickCounter tc, CallbackInfo ci) {
|
||||||
HUD.render(ctx, tc);
|
HudRenderer.render(ctx, tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModifyExpressionValue(method = "renderCrosshair", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/Perspective;isFirstPerson()Z"))
|
@ModifyExpressionValue(method = "renderCrosshair", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/Perspective;isFirstPerson()Z"))
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import me.retucio.camtweaks.module.modules.NoRender;
|
|||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.gui.hud.InGameOverlayRenderer;
|
import net.minecraft.client.gui.hud.InGameOverlayRenderer;
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
import net.minecraft.client.render.VertexConsumerProvider;
|
||||||
|
import net.minecraft.client.texture.Sprite;
|
||||||
|
import net.minecraft.client.texture.SpriteHolder;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
@@ -19,12 +21,12 @@ public abstract class InGameOverlayRendererMixin {
|
|||||||
private static NoRender noRender;
|
private static NoRender noRender;
|
||||||
|
|
||||||
@Inject(method = "<init>", at = @At("TAIL"))
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
private void getModules(MinecraftClient client, VertexConsumerProvider vertexConsumers, CallbackInfo ci) {
|
private void getModules(MinecraftClient client, SpriteHolder spriteHolder, VertexConsumerProvider vertexConsumers, CallbackInfo ci) {
|
||||||
noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderFireOverlay", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderFireOverlay", at = @At("HEAD"), cancellable = true)
|
||||||
private static void noRenderFireOverlay(MatrixStack matrices, VertexConsumerProvider vertexConsumers, CallbackInfo ci) {
|
private static void noRenderFireOverlay(MatrixStack matrices, VertexConsumerProvider vertexConsumers, Sprite sprite, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled() && !noRender.fireOverlay.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.fireOverlay.isEnabled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ import me.retucio.camtweaks.module.ModuleManager;
|
|||||||
import me.retucio.camtweaks.module.modules.Nametags;
|
import me.retucio.camtweaks.module.modules.Nametags;
|
||||||
import net.minecraft.entity.ItemEntity;
|
import net.minecraft.entity.ItemEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.text.MutableText;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
import net.minecraft.util.Formatting;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
@@ -22,7 +24,15 @@ public abstract class ItemEntityMixin {
|
|||||||
if (!nametags.isEnabled()) return original;
|
if (!nametags.isEnabled()) return original;
|
||||||
|
|
||||||
int count = this.getStack().getCount();
|
int count = this.getStack().getCount();
|
||||||
if (nametags.countItems.isEnabled() && count > 1) return original.copy().append(" x" + count);
|
MutableText name = this.getStack().getCustomName() != null ? this.getStack().getCustomName().copyContentOnly() : original.copyContentOnly();
|
||||||
|
|
||||||
|
if (!name.equals(original)) name = name.formatted(Formatting.ITALIC);
|
||||||
|
|
||||||
|
if (nametags.countItems.isEnabled()) {
|
||||||
|
if (count > 1) return name.copy().append(" x" + count);
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.ShulkerPeek;
|
||||||
|
import net.minecraft.block.ShulkerBoxBlock;
|
||||||
|
import net.minecraft.component.type.TooltipDisplayComponent;
|
||||||
|
import net.minecraft.item.BlockItem;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.tooltip.TooltipType;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
import net.minecraft.util.Formatting;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
@Mixin(Item.class)
|
||||||
|
public abstract class ItemMixin {
|
||||||
|
|
||||||
|
@Inject(method = "appendTooltip", at = @At("HEAD"))
|
||||||
|
private void onAppendTooltip(ItemStack stack, Item.TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type, CallbackInfo ci) {
|
||||||
|
ShulkerPeek shulkerPeek = ModuleManager.INSTANCE.getModuleByClass(ShulkerPeek.class);
|
||||||
|
if (!shulkerPeek.isEnabled() || !shulkerPeek.showTooltips.isEnabled()) return;
|
||||||
|
|
||||||
|
if (stack.getItem() instanceof BlockItem blockItem && blockItem.getBlock() instanceof ShulkerBoxBlock) {
|
||||||
|
if (ShulkerPeek.isShulkerEmpty(stack)) {
|
||||||
|
textConsumer.accept(Text.literal("vacío").formatted(Formatting.GRAY, Formatting.ITALIC));
|
||||||
|
} else {
|
||||||
|
textConsumer.accept(
|
||||||
|
Text.literal("mantén ")
|
||||||
|
.append(Text.literal(shulkerPeek.previewKey.getKeyName())
|
||||||
|
.formatted(Formatting.GOLD, Formatting.BOLD))
|
||||||
|
.append(" para previsualizar")
|
||||||
|
.formatted(Formatting.GRAY)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.GlintPlus;
|
||||||
|
import net.minecraft.client.render.RenderLayer;
|
||||||
|
import net.minecraft.client.render.item.ItemRenderer;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(ItemRenderer.class)
|
||||||
|
public abstract class ItemRendererMixin {
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private static GlintPlus glintPlus;
|
||||||
|
|
||||||
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
|
private void getModules(CallbackInfo ci) {
|
||||||
|
glintPlus = ModuleManager.INSTANCE.getModuleByClass(GlintPlus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(method = "getItemGlintConsumer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/RenderLayer;getGlint()Lnet/minecraft/client/render/RenderLayer;"))
|
||||||
|
private static RenderLayer getGlint() {
|
||||||
|
return glintPlus.getGlint();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(method = "getItemGlintConsumer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/RenderLayer;getEntityGlint()Lnet/minecraft/client/render/RenderLayer;"))
|
||||||
|
private static RenderLayer getEntityGlint() {
|
||||||
|
return glintPlus.getEntityGlint();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.events.DamageItemEvent;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||||
|
|
||||||
|
@Mixin(ItemStack.class)
|
||||||
|
public abstract class ItemStackMixin {
|
||||||
|
|
||||||
|
@Inject(method = "setDamage", at = @At("HEAD"))
|
||||||
|
private void onDamage(int damage, CallbackInfo ci) {
|
||||||
|
ItemStack stack = (ItemStack) (Object) this;
|
||||||
|
EVENT_BUS.post(new DamageItemEvent(damage, stack));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,9 @@ package me.retucio.camtweaks.mixin;
|
|||||||
|
|
||||||
import me.retucio.camtweaks.CameraTweaks;
|
import me.retucio.camtweaks.CameraTweaks;
|
||||||
import me.retucio.camtweaks.event.events.KeyEvent;
|
import me.retucio.camtweaks.event.events.KeyEvent;
|
||||||
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
import net.minecraft.client.Keyboard;
|
import net.minecraft.client.Keyboard;
|
||||||
|
import net.minecraft.client.input.KeyInput;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
@@ -14,10 +16,10 @@ import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
|||||||
public abstract class KeyboardMixin {
|
public abstract class KeyboardMixin {
|
||||||
|
|
||||||
@Inject(method = "onKey", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "onKey", at = @At("HEAD"), cancellable = true)
|
||||||
private void onKeyPress(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) {
|
private void onKeyPress(long window, int action, KeyInput input, CallbackInfo ci) {
|
||||||
CameraTweaks.INSTANCE.onKeyPress(key, action);
|
if (input.key() == -1) return;
|
||||||
|
CameraTweaks.INSTANCE.onKeyPress(input.key(), action);
|
||||||
KeyEvent event = EVENT_BUS.post(new KeyEvent(key, scancode, action));
|
KeyEvent event = EVENT_BUS.post(new KeyEvent(input.key(), input.scancode(), action));
|
||||||
if (event.isCancelled()) ci.cancel();
|
if (event.isCancelled()) ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,9 +5,11 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
|||||||
import com.mojang.blaze3d.textures.GpuTexture;
|
import com.mojang.blaze3d.textures.GpuTexture;
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
import me.retucio.camtweaks.module.modules.Fullbright;
|
import me.retucio.camtweaks.module.modules.Fullbright;
|
||||||
|
import me.retucio.camtweaks.module.modules.NoRender;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.render.GameRenderer;
|
import net.minecraft.client.render.GameRenderer;
|
||||||
import net.minecraft.client.render.LightmapTextureManager;
|
import net.minecraft.client.render.LightmapTextureManager;
|
||||||
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.util.math.ColorHelper;
|
import net.minecraft.util.math.ColorHelper;
|
||||||
import net.minecraft.util.profiler.Profiler;
|
import net.minecraft.util.profiler.Profiler;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
@@ -17,6 +19,7 @@ import org.spongepowered.asm.mixin.Unique;
|
|||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(LightmapTextureManager.class)
|
@Mixin(LightmapTextureManager.class)
|
||||||
public abstract class LightmapTextureManagerMixin {
|
public abstract class LightmapTextureManagerMixin {
|
||||||
@@ -24,12 +27,16 @@ public abstract class LightmapTextureManagerMixin {
|
|||||||
@Unique
|
@Unique
|
||||||
Fullbright fullbright;
|
Fullbright fullbright;
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
NoRender noRender;
|
||||||
|
|
||||||
@Shadow @Final
|
@Shadow @Final
|
||||||
private GpuTexture glTexture;
|
private GpuTexture glTexture;
|
||||||
|
|
||||||
@Inject(method = "<init>", at = @At("TAIL"))
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
private void getModules(GameRenderer renderer, MinecraftClient client, CallbackInfo ci) {
|
private void getModules(GameRenderer renderer, MinecraftClient client, CallbackInfo ci) {
|
||||||
fullbright = ModuleManager.INSTANCE.getModuleByClass(Fullbright.class);
|
fullbright = ModuleManager.INSTANCE.getModuleByClass(Fullbright.class);
|
||||||
|
noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V", shift = At.Shift.AFTER), cancellable = true)
|
@Inject(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V", shift = At.Shift.AFTER), cancellable = true)
|
||||||
@@ -45,4 +52,9 @@ public abstract class LightmapTextureManagerMixin {
|
|||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "getDarkness", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void noRenderDarkness(LivingEntity entity, float factor, float tickProgress, CallbackInfoReturnable<Float> cir) {
|
||||||
|
if (noRender.isEnabled() && !noRender.darknessEffect.isEnabled()) cir.setReturnValue(0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,6 @@ import me.retucio.camtweaks.module.modules.Freecam;
|
|||||||
import me.retucio.camtweaks.module.modules.Nametags;
|
import me.retucio.camtweaks.module.modules.Nametags;
|
||||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||||
import net.minecraft.client.render.entity.LivingEntityRenderer;
|
import net.minecraft.client.render.entity.LivingEntityRenderer;
|
||||||
import net.minecraft.client.render.entity.PlayerEntityRenderer;
|
|
||||||
import net.minecraft.client.render.entity.model.EntityModel;
|
import net.minecraft.client.render.entity.model.EntityModel;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityType;
|
import net.minecraft.entity.EntityType;
|
||||||
@@ -19,6 +18,9 @@ import org.spongepowered.asm.mixin.Unique;
|
|||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
@Mixin(LivingEntityRenderer.class)
|
@Mixin(LivingEntityRenderer.class)
|
||||||
public abstract class LivingEntityRendererMixin<T extends LivingEntity> {
|
public abstract class LivingEntityRendererMixin<T extends LivingEntity> {
|
||||||
@@ -52,4 +54,14 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity> {
|
|||||||
if (nametags.isEnabled() && livingEntity instanceof PlayerEntity) return nametags.entities.isEnabled(EntityType.PLAYER) && original;
|
if (nametags.isEnabled() && livingEntity instanceof PlayerEntity) return nametags.entities.isEnabled(EntityType.PLAYER) && original;
|
||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "hasLabel(Lnet/minecraft/entity/LivingEntity;D)Z", at = @At("RETURN"), cancellable = true)
|
||||||
|
private void renderSelfNametag(T livingEntity, double d, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
if (livingEntity instanceof PlayerEntity player) {
|
||||||
|
if (player == mc.player && nametags.showSelf.isEnabled()) {
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
cir.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,35 @@
|
|||||||
package me.retucio.camtweaks.mixin;
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import com.ibm.icu.util.CodePointTrie;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
import me.retucio.camtweaks.CameraTweaks;
|
import me.retucio.camtweaks.CameraTweaks;
|
||||||
import me.retucio.camtweaks.event.events.OpenScreenEvent;
|
import me.retucio.camtweaks.event.events.OpenScreenEvent;
|
||||||
import me.retucio.camtweaks.event.events.ShutdownEvent;
|
import me.retucio.camtweaks.event.events.ShutdownEvent;
|
||||||
import me.retucio.camtweaks.event.events.TickEvent;
|
import me.retucio.camtweaks.event.events.TickEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.UseItemEvent;
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.FastUse;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.Hand;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
@Mixin(MinecraftClient.class)
|
@Mixin(MinecraftClient.class)
|
||||||
public abstract class MinecraftClientMixin {
|
public abstract class MinecraftClientMixin {
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
private int itemUseCooldown;
|
||||||
|
|
||||||
@Inject(method = "tick", at = @At("HEAD"))
|
@Inject(method = "tick", at = @At("HEAD"))
|
||||||
private void onTickPre(CallbackInfo ci) {
|
private void onTickPre(CallbackInfo ci) {
|
||||||
CameraTweaks.INSTANCE.onTick();
|
CameraTweaks.INSTANCE.onTick();
|
||||||
@@ -37,4 +51,23 @@ public abstract class MinecraftClientMixin {
|
|||||||
OpenScreenEvent event = EVENT_BUS.post(new OpenScreenEvent(screen));
|
OpenScreenEvent event = EVENT_BUS.post(new OpenScreenEvent(screen));
|
||||||
if (event.isCancelled()) ci.cancel();
|
if (event.isCancelled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "isTelemetryEnabledByApi", at = @At("RETURN"), cancellable = true)
|
||||||
|
private void disableMicropenisTelemetryShi(CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
cir.setReturnValue(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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 (event.isCancelled()) ci.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isItemEnabled(Lnet/minecraft/resource/featuretoggle/FeatureSet;)Z"))
|
||||||
|
private void modifyItemUseCooldown(CallbackInfo ci, @Local ItemStack stack) {
|
||||||
|
FastUse fastUse = ModuleManager.INSTANCE.getModuleByClass(FastUse.class);
|
||||||
|
if (!fastUse.isEnabled()) return;
|
||||||
|
itemUseCooldown = fastUse.getCooldown(stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@ import me.retucio.camtweaks.CameraTweaks;
|
|||||||
import me.retucio.camtweaks.event.events.MouseClickEvent;
|
import me.retucio.camtweaks.event.events.MouseClickEvent;
|
||||||
import me.retucio.camtweaks.event.events.MouseScrollEvent;
|
import me.retucio.camtweaks.event.events.MouseScrollEvent;
|
||||||
import net.minecraft.client.Mouse;
|
import net.minecraft.client.Mouse;
|
||||||
|
import net.minecraft.client.input.MouseInput;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
@@ -15,8 +16,8 @@ import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
|||||||
public abstract class MouseMixin {
|
public abstract class MouseMixin {
|
||||||
|
|
||||||
@Inject(method = "onMouseButton", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "onMouseButton", at = @At("HEAD"), cancellable = true)
|
||||||
private void onMouseButton(long window, int button, int action, int mods, CallbackInfo ci) {
|
private void onMouseButton(long window, MouseInput input, int action, CallbackInfo ci) {
|
||||||
MouseClickEvent event = EVENT_BUS.post(new MouseClickEvent(action, button));
|
MouseClickEvent event = EVENT_BUS.post(new MouseClickEvent(action, input.button()));
|
||||||
if (event.isCancelled()) ci.cancel();
|
if (event.isCancelled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.RPackBypass;
|
||||||
|
import net.minecraft.client.network.ServerInfo;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@Mixin(ServerInfo.ResourcePackPolicy.class)
|
||||||
|
public abstract class ResourcePackPolicyMixin {
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private static ServerInfo.ResourcePackPolicy BYPASS;
|
||||||
|
|
||||||
|
@Invoker("<init>")
|
||||||
|
public static ServerInfo.ResourcePackPolicy init(final String enumName, final int enumOrdinal, final String name) {
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "values", at = @At("TAIL"), cancellable = true)
|
||||||
|
private static void addVariant(CallbackInfoReturnable<ServerInfo.ResourcePackPolicy[]> cir) {
|
||||||
|
RPackBypass bypassPack = ModuleManager.INSTANCE.getModuleByClass(RPackBypass.class);
|
||||||
|
if (!bypassPack.isEnabled()) return;
|
||||||
|
|
||||||
|
ServerInfo.ResourcePackPolicy[] values = cir.getReturnValue();
|
||||||
|
final int ordinal = values.length;
|
||||||
|
cir.setReturnValue(values = Arrays.copyOfRange(values, 0, ordinal + 1));
|
||||||
|
values[ordinal] = BYPASS = init(bypassPack.ENUM_NAME, ordinal, "bypass");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "getName", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void addToGetName(final CallbackInfoReturnable<Text> cir) {
|
||||||
|
RPackBypass bypassPack = ModuleManager.INSTANCE.getModuleByClass(RPackBypass.class);
|
||||||
|
if (BYPASS == (Object) this && bypassPack.isEnabled())
|
||||||
|
cir.setReturnValue(bypassPack.BYPASS_TEXT);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
package me.retucio.camtweaks.mixin;
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
|
import me.retucio.camtweaks.CameraTweaks;
|
||||||
import me.retucio.camtweaks.command.CommandManager;
|
import me.retucio.camtweaks.command.CommandManager;
|
||||||
|
import me.retucio.camtweaks.config.ConfigManager;
|
||||||
import me.retucio.camtweaks.event.events.ClientClickEvent;
|
import me.retucio.camtweaks.event.events.ClientClickEvent;
|
||||||
|
import me.retucio.camtweaks.ui.frames.ClientSettingsFrame;
|
||||||
|
import net.minecraft.SharedConstants;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.text.ClickEvent;
|
import net.minecraft.text.ClickEvent;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
@@ -11,6 +16,11 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.getVersionName;
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
@Mixin(Screen.class)
|
@Mixin(Screen.class)
|
||||||
public class ScreenMixin {
|
public class ScreenMixin {
|
||||||
|
|
||||||
@@ -19,4 +29,19 @@ public class ScreenMixin {
|
|||||||
if (clickEvent instanceof ClientClickEvent event && event.getValue().startsWith(CommandManager.INSTANCE.getPrefix()))
|
if (clickEvent instanceof ClientClickEvent event && event.getValue().startsWith(CommandManager.INSTANCE.getPrefix()))
|
||||||
CommandManager.dispatch(event.getValue().substring(CommandManager.INSTANCE.getPrefix().length()));
|
CommandManager.dispatch(event.getValue().substring(CommandManager.INSTANCE.getPrefix().length()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "render", at = @At("HEAD"))
|
||||||
|
private void renderWatermark(DrawContext context, int mouseX, int mouseY, float deltaTicks, CallbackInfo ci) {
|
||||||
|
if (!ConfigManager.hasLoaded()) return; // para evitar dibujar la marca de agua por defecto
|
||||||
|
String watermark = ClientSettingsFrame.guiSettings.watermark.getValue();
|
||||||
|
if (watermark == null || watermark.isEmpty()) return;
|
||||||
|
context.drawText(mc.textRenderer, watermark,
|
||||||
|
mc.getWindow().getScaledWidth() - mc.textRenderer.getWidth(watermark) - 2, 2,
|
||||||
|
new Color((int) ClientSettingsFrame.guiSettings.red.getDefaultValue(),
|
||||||
|
(int) ClientSettingsFrame.guiSettings.green.getDefaultValue(),
|
||||||
|
(int) ClientSettingsFrame.guiSettings.blue.getDefaultValue(),
|
||||||
|
(int) ClientSettingsFrame.guiSettings.alpha.getDefaultValue()
|
||||||
|
).getRGB(), false
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,8 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
@Mixin(ScreenshotRecorder.class)
|
@Mixin(ScreenshotRecorder.class)
|
||||||
public abstract class ScreenshotRecorderMixin {
|
public abstract class ScreenshotRecorderMixin {
|
||||||
|
|
||||||
@@ -35,7 +37,8 @@ public abstract class ScreenshotRecorderMixin {
|
|||||||
|
|
||||||
if (!screenshotPlus.isEnabled()) return;
|
if (!screenshotPlus.isEnabled()) return;
|
||||||
|
|
||||||
screenshotPlus.sendScreenshotMessage();
|
// por los threads o lo que sea
|
||||||
|
mc.execute(screenshotPlus::sendScreenshotMessage);
|
||||||
|
|
||||||
switch (screenshotPlus.defaultAction.getValue()) {
|
switch (screenshotPlus.defaultAction.getValue()) {
|
||||||
case COPY -> screenshotPlus.copyScreenshot(nativeImage);
|
case COPY -> screenshotPlus.copyScreenshot(nativeImage);
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.RPackBypass;
|
||||||
|
import net.minecraft.client.network.ServerInfo;
|
||||||
|
import net.minecraft.client.resource.server.ServerResourcePackManager;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(targets = "net.minecraft.client.gui.screen.multiplayer.ConnectScreen$1")
|
||||||
|
public abstract class ServerConnectorMixin {
|
||||||
|
|
||||||
|
@Inject(method = "toAcceptanceStatus", at = @At("HEAD"), cancellable = true)
|
||||||
|
private static void guardSwitchCase(ServerInfo.ResourcePackPolicy policy, CallbackInfoReturnable<ServerResourcePackManager.AcceptanceStatus> cir) {
|
||||||
|
RPackBypass bypassPack = ModuleManager.INSTANCE.getModuleByClass(RPackBypass.class);
|
||||||
|
if (!bypassPack.isEnabled()) return;
|
||||||
|
if (policy == bypassPack.getPolicy())
|
||||||
|
cir.setReturnValue(ServerResourcePackManager.AcceptanceStatus.ALLOWED);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.RPackBypass;
|
||||||
|
import net.minecraft.client.network.ServerInfo;
|
||||||
|
import net.minecraft.nbt.NbtCompound;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(ServerInfo.class)
|
||||||
|
public abstract class ServerInfoMixin {
|
||||||
|
|
||||||
|
@Shadow private ServerInfo.ResourcePackPolicy resourcePackPolicy;
|
||||||
|
@Unique private boolean isBypassStatus;
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private static RPackBypass bypassPack;
|
||||||
|
|
||||||
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
|
private void getModules(String name, String address, ServerInfo.ServerType serverType, CallbackInfo ci) {
|
||||||
|
bypassPack = ModuleManager.INSTANCE.getModuleByClass(RPackBypass.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "fromNbt", at = @At("TAIL"))
|
||||||
|
private static void addToRead(NbtCompound root, CallbackInfoReturnable<ServerInfo> cir) {
|
||||||
|
if (!bypassPack.isEnabled()) return;
|
||||||
|
if (root.getBoolean(bypassPack.TAG_NAME, false))
|
||||||
|
cir.getReturnValue().setResourcePackPolicy(bypassPack.getPolicy());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "toNbt", at = @At("HEAD"))
|
||||||
|
private void preWrite(CallbackInfoReturnable<NbtCompound> cir) {
|
||||||
|
if (!bypassPack.isEnabled()) return;
|
||||||
|
if (this.resourcePackPolicy == bypassPack.getPolicy()) {
|
||||||
|
this.isBypassStatus = true;
|
||||||
|
this.resourcePackPolicy = ServerInfo.ResourcePackPolicy.PROMPT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "toNbt", at = @At("TAIL"))
|
||||||
|
private void addToWrite(CallbackInfoReturnable<NbtCompound> cir) {
|
||||||
|
if (!bypassPack.isEnabled()) return;
|
||||||
|
if (this.isBypassStatus) {
|
||||||
|
cir.getReturnValue().putBoolean(bypassPack.TAG_NAME, true);
|
||||||
|
this.resourcePackPolicy = bypassPack.getPolicy();
|
||||||
|
this.isBypassStatus = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package me.retucio.camtweaks.mixin;
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.buffers.GpuBuffer;
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.NoRender;
|
||||||
import me.retucio.camtweaks.module.modules.PerspectivePlus;
|
import me.retucio.camtweaks.module.modules.PerspectivePlus;
|
||||||
import me.retucio.camtweaks.module.modules.TimeChanger;
|
import me.retucio.camtweaks.module.modules.TimeChanger;
|
||||||
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
import net.minecraft.client.render.SkyRendering;
|
import net.minecraft.client.render.SkyRendering;
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
import net.minecraft.client.render.VertexConsumerProvider;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
@@ -11,6 +14,7 @@ import org.spongepowered.asm.mixin.Unique;
|
|||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(SkyRendering.class)
|
@Mixin(SkyRendering.class)
|
||||||
public abstract class SkyRendererMixin {
|
public abstract class SkyRendererMixin {
|
||||||
@@ -24,12 +28,12 @@ public abstract class SkyRendererMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderSun", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderSun", at = @At("HEAD"), cancellable = true)
|
||||||
private void onRenderSun(float alpha, VertexConsumerProvider vertexConsumers, MatrixStack matrices, CallbackInfo ci) {
|
private void onRenderSun(float alpha, MatrixStack matrices, CallbackInfo ci) {
|
||||||
if (timeChanger.isEnabled() && !timeChanger.renderSun.isEnabled()) ci.cancel();
|
if (timeChanger.isEnabled() && !timeChanger.renderSun.isEnabled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderMoon", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderMoon", at = @At("HEAD"), cancellable = true)
|
||||||
private void onRenderMoon(int phase, float alpha, VertexConsumerProvider vertexConsumers, MatrixStack matrices, CallbackInfo ci) {
|
private void onRenderMoon(int phase, float alpha, MatrixStack matrixStack, CallbackInfo ci) {
|
||||||
if (timeChanger.isEnabled() && !timeChanger.renderMoon.isEnabled()) ci.cancel();
|
if (timeChanger.isEnabled() && !timeChanger.renderMoon.isEnabled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,4 +41,10 @@ public abstract class SkyRendererMixin {
|
|||||||
private void onRenderStars(float brightness, MatrixStack matrices, CallbackInfo ci) {
|
private void onRenderStars(float brightness, MatrixStack matrices, CallbackInfo ci) {
|
||||||
if (timeChanger.isEnabled() && !timeChanger.renderStars.isEnabled()) ci.cancel();
|
if (timeChanger.isEnabled() && !timeChanger.renderStars.isEnabled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "drawEndLightFlash", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onEndFlash(MatrixStack matrixStack, float f, float skyFactor, float pitch, CallbackInfo ci) {
|
||||||
|
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
|
if (noRender.isEnabled() && !noRender.endFlashes.isEnabled()) ci.cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.NoRender;
|
||||||
|
import net.minecraft.client.render.fog.StatusEffectFogModifier;
|
||||||
|
import net.minecraft.entity.effect.StatusEffect;
|
||||||
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
|
import net.minecraft.registry.entry.RegistryEntry;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(StatusEffectFogModifier.class)
|
||||||
|
public abstract class StatusEffectFogModifierMixin {
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract RegistryEntry<StatusEffect> getStatusEffect();
|
||||||
|
|
||||||
|
@ModifyReturnValue(method = "shouldApply", at = @At("RETURN"))
|
||||||
|
public boolean noRenderBadEffects(boolean original) {
|
||||||
|
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
|
if (!noRender.isEnabled()) return original;
|
||||||
|
if (getStatusEffect() == StatusEffects.BLINDNESS && !noRender.blindnessEffect.isEnabled()) return false;
|
||||||
|
if (getStatusEffect() == StatusEffects.DARKNESS && !noRender.darknessEffect.isEnabled()) return false;
|
||||||
|
return original;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.client.session.telemetry.TelemetryManager;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Coerce;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
@Mixin(TelemetryManager.class)
|
||||||
|
public class TelemetryManagerMixin {
|
||||||
|
|
||||||
|
@Redirect(method = "computeSender", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;isTelemetryEnabledByApi()Z"))
|
||||||
|
private boolean disableTelemetry(@Coerce Object minecraftClient) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,22 @@
|
|||||||
package me.retucio.camtweaks.mixin;
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
import me.retucio.camtweaks.module.modules.NoRender;
|
import me.retucio.camtweaks.module.modules.NoRender;
|
||||||
|
import net.minecraft.client.font.BakedGlyph;
|
||||||
|
import net.minecraft.client.font.GlyphProvider;
|
||||||
import net.minecraft.client.font.TextRenderer;
|
import net.minecraft.client.font.TextRenderer;
|
||||||
import net.minecraft.text.Style;
|
import net.minecraft.text.Style;
|
||||||
import net.minecraft.text.TextColor;
|
import net.minecraft.text.TextColor;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
import org.spongepowered.asm.mixin.injection.*;
|
import org.spongepowered.asm.mixin.injection.*;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
// falta italics pero no sé dónde se comprueba eso, no es aquí :P
|
// falta italics pero no sé dónde se comprueba eso, no es aquí :P
|
||||||
@Mixin(TextRenderer.Drawer.class)
|
@Mixin(TextRenderer.Drawer.class)
|
||||||
public abstract class TextRendererDrawerMixin {
|
public abstract class TextRendererDrawerMixin {
|
||||||
@@ -22,27 +29,22 @@ public abstract class TextRendererDrawerMixin {
|
|||||||
noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "accept", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isBold()Z"))
|
@Redirect(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isBold()Z"))
|
||||||
private boolean noRenderBold(Style style) {
|
private boolean noRenderBold(Style style) {
|
||||||
return !(noRender.isEnabled() && !noRender.bold.isEnabled()) && style.isBold();
|
return !(noRender.isEnabled() && !noRender.bold.isEnabled()) && style.isBold();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "accept", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isUnderlined()Z"))
|
@Redirect(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isUnderlined()Z"))
|
||||||
private boolean noRenderUnderlined(Style style) {
|
private boolean noRenderUnderlined(Style style) {
|
||||||
return !(noRender.isEnabled() && !noRender.underlined.isEnabled()) && style.isUnderlined();
|
return !(noRender.isEnabled() && !noRender.underlined.isEnabled()) && style.isUnderlined();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "accept", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isStrikethrough()Z"))
|
@Redirect(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isStrikethrough()Z"))
|
||||||
private boolean noRenderStrikethrough(Style style) {
|
private boolean noRenderStrikethrough(Style style) {
|
||||||
return !(noRender.isEnabled() && !noRender.strikethrough.isEnabled()) && style.isStrikethrough();
|
return !(noRender.isEnabled() && !noRender.strikethrough.isEnabled()) && style.isStrikethrough();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "accept", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isObfuscated()Z"))
|
@ModifyArg(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer$Drawer;getRenderColor(Lnet/minecraft/text/TextColor;)I"))
|
||||||
private boolean noRenderMTS(Style style) {
|
|
||||||
return !(noRender.isEnabled() && !noRender.scrambledText.isEnabled()) && style.isObfuscated();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ModifyArg(method = "accept", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer$Drawer;getRenderColor(Lnet/minecraft/text/TextColor;)I"))
|
|
||||||
private TextColor noRenderColor(TextColor original) {
|
private TextColor noRenderColor(TextColor original) {
|
||||||
return !noRender.color.is(NoRender.Colors.DEFAULT) ? TextColor.fromFormatting(noRender.color.getValue().toFormatting()) : original;
|
return !noRender.color.is(NoRender.Colors.DEFAULT) ? TextColor.fromFormatting(noRender.color.getValue().toFormatting()) : original;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.NoRender;
|
||||||
|
import net.minecraft.client.font.TextRenderer;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(TextRenderer.class)
|
||||||
|
public abstract class TextRendererMixin {
|
||||||
|
|
||||||
|
@ModifyExpressionValue(method = "getGlyph", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isObfuscated()Z"))
|
||||||
|
private boolean noRenderMTS(boolean original) {
|
||||||
|
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
|
return (!noRender.isEnabled() || noRender.scrambledText.isEnabled()) && original;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import me.retucio.camtweaks.module.modules.NoRender;
|
|||||||
import net.minecraft.client.render.Camera;
|
import net.minecraft.client.render.Camera;
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
import net.minecraft.client.render.VertexConsumerProvider;
|
||||||
import net.minecraft.client.render.WeatherRendering;
|
import net.minecraft.client.render.WeatherRendering;
|
||||||
|
import net.minecraft.client.render.state.WeatherRenderState;
|
||||||
import net.minecraft.client.world.ClientWorld;
|
import net.minecraft.client.world.ClientWorld;
|
||||||
import net.minecraft.particle.ParticlesMode;
|
import net.minecraft.particle.ParticlesMode;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
@@ -33,11 +34,11 @@ public abstract class WeatherRenderingMixin {
|
|||||||
if (noRender.isEnabled() && !noRender.rain.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.rain.isEnabled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderPrecipitation(Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/util/math/Vec3d;IFLjava/util/List;Ljava/util/List;)V", at = @At("HEAD"))
|
@Inject(method = "renderPrecipitation", at = @At("HEAD"))
|
||||||
private void noRenderRainAndSnow(VertexConsumerProvider vertexConsumers, Vec3d pos, int range, float gradient, List<?> rainPieces, List<?> snowPieces, CallbackInfo ci) {
|
private void noRenderRainAndSnow(VertexConsumerProvider vertexConsumers, Vec3d pos, WeatherRenderState weatherRenderState, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled()) {
|
if (noRender.isEnabled()) {
|
||||||
if (!noRender.rain.isEnabled()) rainPieces.clear();
|
if (!noRender.rain.isEnabled()) weatherRenderState.rainPieces.clear();
|
||||||
if (!noRender.snow.isEnabled()) snowPieces.clear();
|
if (!noRender.snow.isEnabled()) weatherRenderState.snowPieces.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,75 @@
|
|||||||
package me.retucio.camtweaks.mixin;
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
|
import com.mojang.blaze3d.buffers.GpuBufferSlice;
|
||||||
|
import me.retucio.camtweaks.CameraTweaks;
|
||||||
|
import me.retucio.camtweaks.event.events.RenderWorldEvent;
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
import me.retucio.camtweaks.module.modules.BlockOutline;
|
import me.retucio.camtweaks.module.modules.BlockOutline;
|
||||||
import me.retucio.camtweaks.module.modules.Freecam;
|
import me.retucio.camtweaks.module.modules.Freecam;
|
||||||
import net.minecraft.client.render.WorldRenderer;
|
import me.retucio.camtweaks.module.modules.NoRender;
|
||||||
|
import me.retucio.camtweaks.util.Colors;
|
||||||
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
import net.minecraft.client.render.*;
|
||||||
|
import net.minecraft.client.render.state.WorldRenderState;
|
||||||
|
import net.minecraft.client.util.ObjectAllocator;
|
||||||
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.math.ColorHelper;
|
import net.minecraft.util.math.ColorHelper;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
import net.minecraft.util.math.RotationAxis;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import net.minecraft.util.profiler.Profiler;
|
||||||
|
import org.joml.Matrix4f;
|
||||||
|
import org.joml.Vector4f;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
@Mixin(WorldRenderer.class)
|
@Mixin(WorldRenderer.class)
|
||||||
public abstract class WorldRendererMixin {
|
public abstract class WorldRendererMixin {
|
||||||
|
|
||||||
@ModifyArg(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;setupTerrain(Lnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/Frustum;ZZ)V"), index = 3)
|
@ModifyArg(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;method_74752(Lnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/Frustum;Z)V"), index = 2)
|
||||||
private boolean renderSetupTerrainModifyArg(boolean hasForcedFrustum) {
|
private boolean renderSetupTerrainModifyArg(boolean spectator) {
|
||||||
return ModuleManager.INSTANCE.getModuleByClass(Freecam.class).isEnabled() || hasForcedFrustum;
|
return ModuleManager.INSTANCE.getModuleByClass(Freecam.class).isEnabled() || spectator;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "render", at = @At("RETURN"))
|
||||||
|
private void render(ObjectAllocator allocator, RenderTickCounter tickCounter, boolean renderBlockOutline, Camera camera, Matrix4f positionMatrix, Matrix4f matrix4f, Matrix4f projectionMatrix, GpuBufferSlice fogBuffer, Vector4f fogColor, boolean renderSky, CallbackInfo ci, @Local Profiler profiler) {
|
||||||
|
if (mc == null || mc.world == null) return;
|
||||||
|
|
||||||
|
MatrixStack matrices = new MatrixStack();
|
||||||
|
matrices.push();
|
||||||
|
|
||||||
|
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(camera.getPitch()));
|
||||||
|
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(camera.getYaw() + 180f));
|
||||||
|
|
||||||
|
profiler.push(CameraTweaks.MOD_ID + "-3d");
|
||||||
|
EVENT_BUS.post(new RenderWorldEvent(matrices, tickCounter, camera));
|
||||||
|
|
||||||
|
profiler.pop();
|
||||||
|
matrices.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "renderTargetBlockOutline", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void noRenderBlockOutlinesFreecam(VertexConsumerProvider.Immediate immediate, MatrixStack matrices, boolean renderBlockOutline, WorldRenderState renderStates, CallbackInfo ci) {
|
||||||
|
Freecam freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
||||||
|
if (freecam.isEnabled() && !freecam.blockOutlines.isEnabled()) ci.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "hasBlindnessOrDarkness(Lnet/minecraft/client/render/Camera;)Z", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void hasBlindnessOrDarkness(Camera camera, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
|
if (!noRender.isEnabled()) return;
|
||||||
|
if (!noRender.blindnessEffect.isEnabled() || !noRender.darknessEffect.isEnabled()) cir.setReturnValue(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "renderTargetBlockOutline", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/ColorHelper;withAlpha(II)I"))
|
@Redirect(method = "renderTargetBlockOutline", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/ColorHelper;withAlpha(II)I"))
|
||||||
@@ -26,16 +78,7 @@ public abstract class WorldRendererMixin {
|
|||||||
if (!outline.isEnabled()) return ColorHelper.withAlpha(alpha, rgb);
|
if (!outline.isEnabled()) return ColorHelper.withAlpha(alpha, rgb);
|
||||||
|
|
||||||
if (outline.rainbow.isEnabled()) {
|
if (outline.rainbow.isEnabled()) {
|
||||||
float speed = 10001 - outline.rainbowSpeed.getFloatValue(); // 10001 para evitar divisiones por cero
|
return Colors.rainbowInt(outline.rainbowSpeed.getIntValue(), outline.alpha.getIntValue());
|
||||||
float hue = (System.currentTimeMillis() % (int) speed) / speed;
|
|
||||||
Color gamingProMax = Color.getHSBColor(hue, 1, 1);
|
|
||||||
|
|
||||||
return new Color(
|
|
||||||
gamingProMax.getRed(),
|
|
||||||
gamingProMax.getGreen(),
|
|
||||||
gamingProMax.getBlue(),
|
|
||||||
outline.alpha.getIntValue()
|
|
||||||
).getRGB();
|
|
||||||
} else {
|
} else {
|
||||||
return new Color(
|
return new Color(
|
||||||
outline.red.getIntValue(),
|
outline.red.getIntValue(),
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package me.retucio.camtweaks.mixin;
|
||||||
|
|
||||||
|
import com.mojang.authlib.yggdrasil.YggdrasilUserApiService;
|
||||||
|
import com.mojang.authlib.yggdrasil.response.UserAttributesResponse;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
// código robado de: https://github.com/kb-1000/no-telemetry
|
||||||
|
|
||||||
|
@Mixin(YggdrasilUserApiService.class)
|
||||||
|
public abstract class YggdrasilUserApiServiceMixin {
|
||||||
|
|
||||||
|
@Redirect(method = "fetchProperties", at = @At(value = "INVOKE", target = "Lcom/mojang/authlib/yggdrasil/response/UserAttributesResponse$Privileges;getTelemetry()Z", remap = false), remap = false, require = 0)
|
||||||
|
private boolean getTelemetry(UserAttributesResponse.Privileges instance) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package me.retucio.camtweaks.mixin.accessor;
|
||||||
|
|
||||||
|
import net.minecraft.block.entity.SignBlockEntity;
|
||||||
|
import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
@Mixin(AbstractSignEditScreen.class)
|
||||||
|
public interface AbstractSignEditScreenAccessor {
|
||||||
|
|
||||||
|
@Accessor("blockEntity")
|
||||||
|
SignBlockEntity getBlockEntity();
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
package me.retucio.camtweaks.mixin.accessor;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mixin(ClientCommonNetworkHandler.ConfirmServerResourcePackScreen.class)
|
||||||
|
public interface ConfirmServerResourcePackScreenAccessor {
|
||||||
|
|
||||||
|
@Accessor("parent")
|
||||||
|
Screen getParentScreen();
|
||||||
|
|
||||||
|
@Accessor("packs")
|
||||||
|
List<? extends PackAccessor> getRequests();
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package me.retucio.camtweaks.mixin.accessor;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||||
|
import net.minecraft.screen.slot.Slot;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
@Mixin(HandledScreen.class)
|
||||||
|
public interface HandledScreenAccessor {
|
||||||
|
|
||||||
|
@Accessor("focusedSlot")
|
||||||
|
Slot getFocusedSlot();
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package me.retucio.camtweaks.mixin.accessor;
|
||||||
|
|
||||||
|
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Mixin(ClientCommonNetworkHandler.ConfirmServerResourcePackScreen.Pack.class)
|
||||||
|
public interface PackAccessor {
|
||||||
|
|
||||||
|
@Invoker
|
||||||
|
UUID callId();
|
||||||
|
}
|
||||||
@@ -26,22 +26,36 @@ public class ModuleManager {
|
|||||||
// por orden alfabético y todo, flipas
|
// por orden alfabético y todo, flipas
|
||||||
private void addModules() {
|
private void addModules() {
|
||||||
modules.add(new AntiInvis());
|
modules.add(new AntiInvis());
|
||||||
|
modules.add(new AttributeSwapper());
|
||||||
|
modules.add(new AutoSign());
|
||||||
modules.add(new BlockOutline());
|
modules.add(new BlockOutline());
|
||||||
modules.add(new BossbarStack());
|
modules.add(new BossbarStack());
|
||||||
|
modules.add(new BungeecordSpoofer());
|
||||||
modules.add(new ChatPlus());
|
modules.add(new ChatPlus());
|
||||||
|
modules.add(new ColoredSigns());
|
||||||
modules.add(new CritsPlus());
|
modules.add(new CritsPlus());
|
||||||
modules.add(new DamageOverlay());
|
modules.add(new DamageOverlay());
|
||||||
modules.add(new FakePlayer());
|
modules.add(new FakePlayer());
|
||||||
|
modules.add(new FastUse());
|
||||||
modules.add(new Freecam());
|
modules.add(new Freecam());
|
||||||
modules.add(new Freelook());
|
modules.add(new Freelook());
|
||||||
modules.add(new Fullbright());
|
modules.add(new Fullbright());
|
||||||
|
modules.add(new GlintPlus());
|
||||||
modules.add(new HandView());
|
modules.add(new HandView());
|
||||||
|
modules.add(new Headhitters());
|
||||||
modules.add(new HUD());
|
modules.add(new HUD());
|
||||||
|
modules.add(new LogoutSpots());
|
||||||
modules.add(new Nametags());
|
modules.add(new Nametags());
|
||||||
|
modules.add(new NoMiningInterruptions());
|
||||||
modules.add(new NoRender());
|
modules.add(new NoRender());
|
||||||
modules.add(new PerspectivePlus());
|
modules.add(new PerspectivePlus());
|
||||||
|
modules.add(new PortalGUI());
|
||||||
|
modules.add(new Rotations());
|
||||||
|
modules.add(new RPackBypass());
|
||||||
modules.add(new ScreenshotPlus());
|
modules.add(new ScreenshotPlus());
|
||||||
|
modules.add(new ShulkerPeek());
|
||||||
modules.add(new TimeChanger());
|
modules.add(new TimeChanger());
|
||||||
|
modules.add(new WarnLowDurability());
|
||||||
modules.add(new Zoom());
|
modules.add(new Zoom());
|
||||||
|
|
||||||
modules.sort(Comparator.comparing(module -> module.getName().toLowerCase()));
|
modules.sort(Comparator.comparing(module -> module.getName().toLowerCase()));
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.AttackEntityEvent;
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||||
|
import me.retucio.camtweaks.module.settings.NumberSetting;
|
||||||
|
|
||||||
|
public class AttributeSwapper extends Module {
|
||||||
|
|
||||||
|
public NumberSetting slot = addSetting(new NumberSetting("slot", "slot al que cambiar", 1, 1, 9, 1));
|
||||||
|
public BooleanSetting swap = addSetting(new BooleanSetting("cambiar de vuelta", "volver al slot inicial tras haber aplicado el swapping", true));
|
||||||
|
public NumberSetting swapDelay = addSetting(new NumberSetting("delay de cambio de vuelta", "tiempo que se tarda en volver al slot inicial", 1, 1, 20, 1));
|
||||||
|
|
||||||
|
private int delay = 0;
|
||||||
|
private int prevSlot = -1;
|
||||||
|
|
||||||
|
public AttributeSwapper() {
|
||||||
|
super("attribute-swapper", "utiliza el \"attribute swapping\" entre dos herramientas para negar daño de durabilidad o aplicar encantamientos adicionales a estas");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick() {
|
||||||
|
if (mc.player == null || !swap.isEnabled()) return;
|
||||||
|
if (delay < swapDelay.getIntValue()) delay++;
|
||||||
|
if (delay >= swapDelay.getIntValue() && prevSlot != -1) {
|
||||||
|
mc.player.getInventory().setSelectedSlot(prevSlot);
|
||||||
|
prevSlot = -1;
|
||||||
|
delay = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onAttack(AttackEntityEvent event) {
|
||||||
|
prevSlot = mc.player.getInventory().getSelectedSlot();
|
||||||
|
mc.player.getInventory().setSelectedSlot(slot.getIntValue() - 1);
|
||||||
|
delay = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.OpenScreenEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.PacketEvent;
|
||||||
|
import me.retucio.camtweaks.mixin.accessor.AbstractSignEditScreenAccessor;
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
|
import net.minecraft.block.entity.SignBlockEntity;
|
||||||
|
import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen;
|
||||||
|
import net.minecraft.network.packet.c2s.play.UpdateSignC2SPacket;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
|
public class AutoSign extends Module {
|
||||||
|
|
||||||
|
public String[] text = null;
|
||||||
|
|
||||||
|
public AutoSign() {
|
||||||
|
super("autocartel", "te permite colocar carteles con el mismo texto sin tener que escribirlo uno por uno");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
if (text == null) ChatUtil.info("coloca un primer cartel, del cual copiar el contenido");
|
||||||
|
super.onEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
text = null;
|
||||||
|
super.onDisable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onOpenScreen(OpenScreenEvent event) {
|
||||||
|
if (event.getScreen() instanceof AbstractSignEditScreen screen && text != null && mc != null && mc.player != null) {
|
||||||
|
event.cancel();
|
||||||
|
SignBlockEntity sign = ((AbstractSignEditScreenAccessor) screen).getBlockEntity();
|
||||||
|
fillText(sign.getPos(), sign.isPlayerFacingFront(mc.player), text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onSendPacket(PacketEvent.Send event) {
|
||||||
|
if (event.getPacket() instanceof UpdateSignC2SPacket packet) {
|
||||||
|
if (text == null) text = packet.getText().clone();
|
||||||
|
else System.arraycopy(text, 0, packet.getText(), 0, 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillText(BlockPos blockPos, boolean front, String[] text) {
|
||||||
|
mc.getNetworkHandler().sendPacket(new UpdateSignC2SPacket(
|
||||||
|
blockPos, front, text[0], text[1], text[2], text[3]
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.module.settings.StringSetting;
|
||||||
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
|
|
||||||
|
public class BungeecordSpoofer extends Module {
|
||||||
|
|
||||||
|
public StringSetting address = addSetting(new StringSetting("dirección", "la dirección IP que será enviada al server", "127.0.0.1", 15));
|
||||||
|
|
||||||
|
public BungeecordSpoofer() {
|
||||||
|
super("spoofer de bungeecord", "te permite conectarte a los servidores backend de un server bungeecord mal configurado");
|
||||||
|
|
||||||
|
address.onUpdate(text -> {
|
||||||
|
if (!text.matches("^[0-9a-f\\\\.:]{0,45}$")) {
|
||||||
|
address.setValue(address.getDefaultValue());
|
||||||
|
ChatUtil.error("dirección IP inválida");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -162,7 +162,7 @@ public class ChatPlus extends Module {
|
|||||||
GameProfile sender = getSender(line, text);
|
GameProfile sender = getSender(line, text);
|
||||||
if (sender == null) return;
|
if (sender == null) return;
|
||||||
|
|
||||||
PlayerListEntry entry = mc.getNetworkHandler().getPlayerListEntry(sender.getId());
|
PlayerListEntry entry = mc.getNetworkHandler().getPlayerListEntry(sender.id());
|
||||||
if (entry == null) return;
|
if (entry == null) return;
|
||||||
|
|
||||||
PlayerSkinDrawer.draw(context, entry.getSkinTextures(), 0, y, 8);
|
PlayerSkinDrawer.draw(context, entry.getSkinTextures(), 0, y, 8);
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.PacketEvent;
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.module.settings.StringSetting;
|
||||||
|
import net.minecraft.network.packet.c2s.play.UpdateSignC2SPacket;
|
||||||
|
|
||||||
|
public class ColoredSigns extends Module {
|
||||||
|
|
||||||
|
public StringSetting symbol = addSetting(new StringSetting("símbolo", "símbolo a reemplazar por \"§\"", "&", 5));
|
||||||
|
|
||||||
|
public ColoredSigns() {
|
||||||
|
super("carteles gays", "te permite usar un símbolo a elegir como § para añadir formato a estos.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onSendPacket(PacketEvent.Send event) {
|
||||||
|
if (event.getPacket() instanceof UpdateSignC2SPacket packet) {
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
packet.getText()[i] = packet.getText()[i].replace(symbol.getValue(), "\247" + "\247a");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,7 +23,7 @@ public class CritsPlus extends Module {
|
|||||||
public NumberSetting multiplier; // no sé dónde se calcula cuántas partículas aparecen :/
|
public NumberSetting multiplier; // no sé dónde se calcula cuántas partículas aparecen :/
|
||||||
public NumberSetting velocityMultipler = addSetting(new NumberSetting("dispersión", "multiplicador de la velocidad de dispersión", 1, 0, 10, 0.1));
|
public NumberSetting velocityMultipler = addSetting(new NumberSetting("dispersión", "multiplicador de la velocidad de dispersión", 1, 0, 10, 0.1));
|
||||||
public NumberSetting gravity = addSetting(new NumberSetting("gravedad", "multiplicador de fuerza de gravedad", 1, 0, 10, 0.1));
|
public NumberSetting gravity = addSetting(new NumberSetting("gravedad", "multiplicador de fuerza de gravedad", 1, 0, 10, 0.1));
|
||||||
public NumberSetting maxAge = addSetting(new NumberSetting("vida máxima", "cuánto persiste la partícula", 4, 0, 50, 1));
|
public NumberSetting maxAge = addSetting(new NumberSetting("vida máxima", "cuánto persiste la partícula", 10, 0, 50, 1));
|
||||||
public BooleanSetting collide = addSetting(new BooleanSetting("colisionar", "colisionar con bloques", false));
|
public BooleanSetting collide = addSetting(new BooleanSetting("colisionar", "colisionar con bloques", false));
|
||||||
|
|
||||||
public CritsPlus() {
|
public CritsPlus() {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import me.retucio.camtweaks.module.Module;
|
|||||||
import me.retucio.camtweaks.module.settings.StringSetting;
|
import me.retucio.camtweaks.module.settings.StringSetting;
|
||||||
import net.minecraft.client.network.OtherClientPlayerEntity;
|
import net.minecraft.client.network.OtherClientPlayerEntity;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@@ -21,24 +22,28 @@ public class FakePlayer extends Module {
|
|||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
if (mc.world == null) return;
|
if (mc.world == null) return;
|
||||||
|
addPlayer(mc.player, name.getValue());
|
||||||
player = new OtherClientPlayerEntity(mc.world, new GameProfile(UUID.randomUUID(), name.getValue()));
|
|
||||||
// player.copyPositionAndRotation(mc.player);
|
|
||||||
player.copyFrom(mc.player);
|
|
||||||
|
|
||||||
mc.world.addEntity(player);
|
|
||||||
|
|
||||||
super.onEnable();
|
super.onEnable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (mc.world == null || player == null) return;
|
if (mc.world == null || player == null) return;
|
||||||
|
removePlayer();
|
||||||
|
super.onDisable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public OtherClientPlayerEntity addPlayer(PlayerEntity playerToCopy, String dummyName) {
|
||||||
|
player = new OtherClientPlayerEntity(mc.world, new GameProfile(UUID.randomUUID(), dummyName));
|
||||||
|
player.copyFrom(playerToCopy);
|
||||||
|
player.setCustomNameVisible(true);
|
||||||
|
mc.world.addEntity(player);
|
||||||
|
return player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removePlayer() {
|
||||||
player.setRemoved(Entity.RemovalReason.KILLED);
|
player.setRemoved(Entity.RemovalReason.KILLED);
|
||||||
player.onRemoved();
|
player.onRemoved();
|
||||||
player = null;
|
player = null;
|
||||||
|
|
||||||
super.onDisable();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||||
|
import me.retucio.camtweaks.module.settings.NumberSetting;
|
||||||
|
import net.minecraft.item.BlockItem;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class FastUse extends Module {
|
||||||
|
|
||||||
|
public BooleanSetting items = addSetting(new BooleanSetting("items", "usar items precozmente", true));
|
||||||
|
public NumberSetting itemCooldown = addSetting(new NumberSetting("cooldown de items", "cooldown para usar items en ticks", 0, 0, 4, 1));
|
||||||
|
|
||||||
|
public BooleanSetting blocks = addSetting(new BooleanSetting("bloques", "colocar bloques precozmente", true));
|
||||||
|
public NumberSetting blockCooldown = addSetting(new NumberSetting("cooldown de bloques", "cooldown para colocar bloques en ticks", 0, 0, 4, 1));
|
||||||
|
|
||||||
|
public FastUse() {
|
||||||
|
super("precoz", "hace cosas como usar items o colocar bloques más rápido");
|
||||||
|
|
||||||
|
items.onUpdate(v -> itemCooldown.setVisible(v));
|
||||||
|
blocks.onUpdate(v -> blockCooldown.setVisible(v));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCooldown(ItemStack stack) {
|
||||||
|
if (stack.getItem() instanceof BlockItem && blocks.isEnabled()) return blockCooldown.getIntValue();
|
||||||
|
if (items.isEnabled() && !(stack.getItem() instanceof BlockItem)) return itemCooldown.getIntValue();
|
||||||
|
else return 4; // cooldown por defecto, 4 ticks
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,10 +5,14 @@ import me.retucio.camtweaks.event.SubscribeEvent;
|
|||||||
import me.retucio.camtweaks.event.events.*;
|
import me.retucio.camtweaks.event.events.*;
|
||||||
import me.retucio.camtweaks.module.Module;
|
import me.retucio.camtweaks.module.Module;
|
||||||
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||||
|
import me.retucio.camtweaks.module.settings.KeySetting;
|
||||||
import me.retucio.camtweaks.module.settings.NumberSetting;
|
import me.retucio.camtweaks.module.settings.NumberSetting;
|
||||||
import me.retucio.camtweaks.util.ChatUtil;
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
import me.retucio.camtweaks.util.KeyUtil;
|
import me.retucio.camtweaks.util.KeyUtil;
|
||||||
import me.retucio.camtweaks.util.MiscUtil;
|
import me.retucio.camtweaks.util.MiscUtil;
|
||||||
|
import net.minecraft.client.gui.Click;
|
||||||
|
import net.minecraft.client.input.KeyInput;
|
||||||
|
import net.minecraft.client.input.MouseInput;
|
||||||
import net.minecraft.client.option.Perspective;
|
import net.minecraft.client.option.Perspective;
|
||||||
import net.minecraft.network.packet.Packet;
|
import net.minecraft.network.packet.Packet;
|
||||||
import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket;
|
import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket;
|
||||||
@@ -17,6 +21,7 @@ import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
|
|||||||
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
|
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.DeathMessageS2CPacket;
|
import net.minecraft.network.packet.s2c.play.DeathMessageS2CPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket;
|
import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import org.joml.Vector3d;
|
import org.joml.Vector3d;
|
||||||
@@ -26,7 +31,6 @@ import org.lwjgl.glfw.GLFW;
|
|||||||
* @see me.retucio.camtweaks.mixin.CameraMixin
|
* @see me.retucio.camtweaks.mixin.CameraMixin
|
||||||
* @see me.retucio.camtweaks.mixin.ChunkBorderDebugRendererMixin
|
* @see me.retucio.camtweaks.mixin.ChunkBorderDebugRendererMixin
|
||||||
* @see me.retucio.camtweaks.mixin.ClientPlayerInteractionManagerMixin
|
* @see me.retucio.camtweaks.mixin.ClientPlayerInteractionManagerMixin
|
||||||
* @see me.retucio.camtweaks.mixin.CompassStateMixin
|
|
||||||
* @see me.retucio.camtweaks.mixin.EntityMixin
|
* @see me.retucio.camtweaks.mixin.EntityMixin
|
||||||
* @see me.retucio.camtweaks.mixin.GameRendererMixin
|
* @see me.retucio.camtweaks.mixin.GameRendererMixin
|
||||||
* @see me.retucio.camtweaks.mixin.KeyInputMixin
|
* @see me.retucio.camtweaks.mixin.KeyInputMixin
|
||||||
@@ -44,17 +48,18 @@ public class Freecam extends Module {
|
|||||||
public BooleanSetting stayCrouching = addSetting(new BooleanSetting("mantenerse agachado", "mantener al jugador agachado tras entrar en el modo de cámara libre", false));
|
public BooleanSetting stayCrouching = addSetting(new BooleanSetting("mantenerse agachado", "mantener al jugador agachado tras entrar en el modo de cámara libre", false));
|
||||||
public BooleanSetting staticView = addSetting(new BooleanSetting("visión estática", "desactiva ajustes que muevan la cámara", true));
|
public BooleanSetting staticView = addSetting(new BooleanSetting("visión estática", "desactiva ajustes que muevan la cámara", true));
|
||||||
public BooleanSetting cancelActionPackets = addSetting(new BooleanSetting("cancelar paquetes", "evita flaggear el anticheat al interactuar con bloques / entidades", true));
|
public BooleanSetting cancelActionPackets = addSetting(new BooleanSetting("cancelar paquetes", "evita flaggear el anticheat al interactuar con bloques / entidades", true));
|
||||||
|
public BooleanSetting blockOutlines = addSetting(new BooleanSetting("contorno de bloques", "mostrar el contorno de los bloques estando en el modo de cámara libre", true));
|
||||||
|
|
||||||
public NumberSetting speedSetting = addSetting(new NumberSetting(
|
public NumberSetting speedSetting = addSetting(new NumberSetting(
|
||||||
"velocidad", "velocidad de movimiento de la cámara",
|
"velocidad", "velocidad de movimiento de la cámara",
|
||||||
1, 0, 10, 0.2));
|
1, 0, 10, 0.2));
|
||||||
|
|
||||||
|
public KeySetting scrollKey = addSetting(new KeySetting("tecla del scroll", "tecla a mantener pulsada para cambiar velocidad con el scroll", GLFW.GLFW_KEY_LEFT_CONTROL));
|
||||||
public NumberSetting scrollSens = addSetting(new NumberSetting(
|
public NumberSetting scrollSens = addSetting(new NumberSetting(
|
||||||
"sensibilidad del scroll", "sensibilidad de la rueda del ratón para modificar la velocidad, 0 para desactivar",
|
"sensibilidad del scroll", "sensibilidad de la rueda del ratón para modificar la velocidad, 0 para desactivar",
|
||||||
0, 0, 2, 0.1));
|
1, 0, 2, 0.1));
|
||||||
|
|
||||||
|
|
||||||
// rotate?
|
|
||||||
|
|
||||||
private final Vector3d prevPos = new Vector3d();
|
private final Vector3d prevPos = new Vector3d();
|
||||||
private float prevYaw, prevPitch;
|
private float prevYaw, prevPitch;
|
||||||
|
|
||||||
@@ -141,9 +146,9 @@ public class Freecam extends Module {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTick() {
|
public void onTick() {
|
||||||
if (mc.cameraEntity == null || perspective == null) return;
|
if (mc.getCameraEntity() == null || perspective == null) return;
|
||||||
|
|
||||||
mc.cameraEntity.noClip = mc.cameraEntity.isInsideWall();
|
mc.getCameraEntity().noClip = mc.getCameraEntity().isInsideWall();
|
||||||
if (!perspective.isFirstPerson()) mc.options.setPerspective(Perspective.FIRST_PERSON);
|
if (!perspective.isFirstPerson()) mc.options.setPerspective(Perspective.FIRST_PERSON);
|
||||||
|
|
||||||
Vec3d forward = Vec3d.fromPolar(0, yaw);
|
Vec3d forward = Vec3d.fromPolar(0, yaw);
|
||||||
@@ -187,7 +192,7 @@ public class Freecam extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onPacketSend(PacketEvent.Send event) {
|
public void onSendPacket(PacketEvent.Send event) {
|
||||||
if (!isEnabled() || !cancelActionPackets.isEnabled()) return;
|
if (!isEnabled() || !cancelActionPackets.isEnabled()) return;
|
||||||
if (event.getStage() != Stage.PRE) return;
|
if (event.getStage() != Stage.PRE) return;
|
||||||
|
|
||||||
@@ -204,24 +209,25 @@ public class Freecam extends Module {
|
|||||||
public void onKey(KeyEvent event) {
|
public void onKey(KeyEvent event) {
|
||||||
if (mc.currentScreen != null) return;
|
if (mc.currentScreen != null) return;
|
||||||
if (KeyUtil.isKeyDown(GLFW.GLFW_KEY_F3)) return;
|
if (KeyUtil.isKeyDown(GLFW.GLFW_KEY_F3)) return;
|
||||||
|
KeyInput key = new KeyInput(event.getKey(), event.getScancode(), 0);
|
||||||
|
|
||||||
boolean shouldCancel = true;
|
boolean shouldCancel = true;
|
||||||
if (mc.options.forwardKey.matchesKey(event.getKey(), event.getScancode())) {
|
if (mc.options.forwardKey.matchesKey(key)) {
|
||||||
forward = event.getAction() != GLFW.GLFW_RELEASE;
|
forward = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.forwardKey.setPressed(false);
|
mc.options.forwardKey.setPressed(false);
|
||||||
} else if (mc.options.backKey.matchesKey(event.getKey(), event.getScancode())) {
|
} else if (mc.options.backKey.matchesKey(key)) {
|
||||||
backward = event.getAction() != GLFW.GLFW_RELEASE;
|
backward = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.backKey.setPressed(false);
|
mc.options.backKey.setPressed(false);
|
||||||
} else if (mc.options.rightKey.matchesKey(event.getKey(), event.getScancode())) {
|
} else if (mc.options.rightKey.matchesKey(key)) {
|
||||||
right = event.getAction() != GLFW.GLFW_RELEASE;
|
right = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.rightKey.setPressed(false);
|
mc.options.rightKey.setPressed(false);
|
||||||
} else if (mc.options.leftKey.matchesKey(event.getKey(), event.getScancode())) {
|
} else if (mc.options.leftKey.matchesKey(key)) {
|
||||||
left = event.getAction() != GLFW.GLFW_RELEASE;
|
left = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.leftKey.setPressed(false);
|
mc.options.leftKey.setPressed(false);
|
||||||
} else if (mc.options.jumpKey.matchesKey(event.getKey(), event.getScancode())) {
|
} else if (mc.options.jumpKey.matchesKey(key)) {
|
||||||
up = event.getAction() != GLFW.GLFW_RELEASE;
|
up = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.jumpKey.setPressed(false);
|
mc.options.jumpKey.setPressed(false);
|
||||||
} else if (mc.options.sneakKey.matchesKey(event.getKey(), event.getScancode())) {
|
} else if (mc.options.sneakKey.matchesKey(key)) {
|
||||||
down = event.getAction() != GLFW.GLFW_RELEASE;
|
down = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.sneakKey.setPressed(false);
|
mc.options.sneakKey.setPressed(false);
|
||||||
} else {
|
} else {
|
||||||
@@ -234,24 +240,25 @@ public class Freecam extends Module {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMouseClick(MouseClickEvent event) { // por si el restrasado del usuario usa el ratón para moverse
|
public void onMouseClick(MouseClickEvent event) { // por si el restrasado del usuario usa el ratón para moverse
|
||||||
if (mc.currentScreen != null) return;
|
if (mc.currentScreen != null) return;
|
||||||
|
Click click = new Click(0, 0, new MouseInput(event.getButton(), 0));
|
||||||
|
|
||||||
boolean shouldCancel = true;
|
boolean shouldCancel = true;
|
||||||
if (mc.options.forwardKey.matchesKey(event.getButton(), 0)) {
|
if (mc.options.forwardKey.matchesMouse(click)) {
|
||||||
forward = event.getAction() != GLFW.GLFW_RELEASE;
|
forward = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.forwardKey.setPressed(false);
|
mc.options.forwardKey.setPressed(false);
|
||||||
} else if (mc.options.backKey.matchesKey(event.getButton(), 0)) {
|
} else if (mc.options.backKey.matchesMouse(click)) {
|
||||||
backward = event.getAction() != GLFW.GLFW_RELEASE;
|
backward = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.backKey.setPressed(false);
|
mc.options.backKey.setPressed(false);
|
||||||
} else if (mc.options.rightKey.matchesKey(event.getButton(), 0)) {
|
} else if (mc.options.rightKey.matchesMouse(click)) {
|
||||||
right = event.getAction() != GLFW.GLFW_RELEASE;
|
right = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.rightKey.setPressed(false);
|
mc.options.rightKey.setPressed(false);
|
||||||
} else if (mc.options.leftKey.matchesKey(event.getButton(), 0)) {
|
} else if (mc.options.leftKey.matchesMouse(click)) {
|
||||||
left = event.getAction() != GLFW.GLFW_RELEASE;
|
left = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.leftKey.setPressed(false);
|
mc.options.leftKey.setPressed(false);
|
||||||
} else if (mc.options.jumpKey.matchesKey(event.getButton(), 0)) {
|
} else if (mc.options.jumpKey.matchesMouse(click)) {
|
||||||
up = event.getAction() != GLFW.GLFW_RELEASE;
|
up = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.jumpKey.setPressed(false);
|
mc.options.jumpKey.setPressed(false);
|
||||||
} else if (mc.options.sneakKey.matchesKey(event.getButton(), 0)) {
|
} else if (mc.options.sneakKey.matchesMouse(click)) {
|
||||||
down = event.getAction() != GLFW.GLFW_RELEASE;
|
down = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
mc.options.sneakKey.setPressed(false);
|
mc.options.sneakKey.setPressed(false);
|
||||||
} else {
|
} else {
|
||||||
@@ -263,7 +270,7 @@ public class Freecam extends Module {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
private void onMouseScroll(MouseScrollEvent event) {
|
private void onMouseScroll(MouseScrollEvent event) {
|
||||||
if (scrollSens.getValue() > 0 && mc.currentScreen == null) {
|
if (scrollSens.getValue() > 0 && mc.currentScreen == null && KeyUtil.isKeyDown(scrollKey.getKey())) {
|
||||||
speed += event.getVertical() / 4 * (scrollSens.getValue() * speed);
|
speed += event.getVertical() / 4 * (scrollSens.getValue() * speed);
|
||||||
if (speed < 0.1) speed = 0.1;
|
if (speed < 0.1) speed = 0.1;
|
||||||
event.cancel();
|
event.cancel();
|
||||||
@@ -303,6 +310,28 @@ public class Freecam extends Module {
|
|||||||
prevPitch = pitch;
|
prevPitch = pitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// los paquetes ya se cancelan, pero visualmente estos eventos se siguen dando
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onBreakBlock(BreakBlockEvent event) {
|
||||||
|
if (cancelActionPackets.isEnabled()) event.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onPlaceBlock(PlaceBlockEvent event) {
|
||||||
|
if (cancelActionPackets.isEnabled()) event.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onInteractEntity(InteractEntityEvent event) {
|
||||||
|
if (cancelActionPackets.isEnabled()) event.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onAttack(AttackEntityEvent event) {
|
||||||
|
if (cancelActionPackets.isEnabled()) event.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
public void changeLookDirection(double deltaX, double deltaY) {
|
public void changeLookDirection(double deltaX, double deltaY) {
|
||||||
prevYaw = yaw;
|
prevYaw = yaw;
|
||||||
prevPitch = pitch;
|
prevPitch = pitch;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class Freelook extends Module {
|
|||||||
4, 0, 10, 0.1));
|
4, 0, 10, 0.1));
|
||||||
|
|
||||||
public NumberSetting mouseSens = addSetting(new NumberSetting("sensibilidad del ratón", ".",
|
public NumberSetting mouseSens = addSetting(new NumberSetting("sensibilidad del ratón", ".",
|
||||||
8, 0, 10, 0.1));
|
0.1, 0, 2, 0.05));
|
||||||
|
|
||||||
private float yaw;
|
private float yaw;
|
||||||
private float pitch;
|
private float pitch;
|
||||||
@@ -31,7 +31,11 @@ public class Freelook extends Module {
|
|||||||
public Freelook() {
|
public Freelook() {
|
||||||
super("perspectiva libre", "te permite mover la cámara de la perspectiva sin mover la del jugador, o vice versa");
|
super("perspectiva libre", "te permite mover la cámara de la perspectiva sin mover la del jugador, o vice versa");
|
||||||
assignKey(GLFW.GLFW_KEY_B);
|
assignKey(GLFW.GLFW_KEY_B);
|
||||||
|
|
||||||
|
keyMode.setDefaultValue(KeyModes.HOLD);
|
||||||
keyMode.setValue(KeyModes.HOLD);
|
keyMode.setValue(KeyModes.HOLD);
|
||||||
|
|
||||||
|
notify.setDefaultValue(false);
|
||||||
notify.setEnabled(false);
|
notify.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ public class Fullbright extends Module {
|
|||||||
green.setVisible(v);
|
green.setVisible(v);
|
||||||
blue.setVisible(v);
|
blue.setVisible(v);
|
||||||
alpha.setVisible(v);
|
alpha.setVisible(v);
|
||||||
|
|
||||||
|
if (v) disableNightVision();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public class GUI extends Module {
|
|||||||
// ^^^ no sé de qué sirve porque está todo en minúsculas pero bueno
|
// ^^^ no sé de qué sirve porque está todo en minúsculas pero bueno
|
||||||
|
|
||||||
public BooleanSetting blur = addSetting(new BooleanSetting("desenfoque", "desenfocar el fondo mientras la interfaz está abierta", true));
|
public BooleanSetting blur = addSetting(new BooleanSetting("desenfoque", "desenfocar el fondo mientras la interfaz está abierta", true));
|
||||||
|
public StringSetting watermark = addSetting(new StringSetting("marca de agua", "marca de agua para interfaces (dejar vacío para desactivar)", CameraTweaks.getVersionName(), 40));
|
||||||
|
|
||||||
public StringSetting commandPrefix = addSetting(new StringSetting("prefijo", "prefijo de los comandos", "$", 10));
|
public StringSetting commandPrefix = addSetting(new StringSetting("prefijo", "prefijo de los comandos", "$", 10));
|
||||||
public StringSetting chatName = addSetting(new StringSetting("nombre", "qué nombre usar en notificaciones por el chat", "smegma", 20));
|
public StringSetting chatName = addSetting(new StringSetting("nombre", "qué nombre usar en notificaciones por el chat", "smegma", 20));
|
||||||
@@ -103,14 +104,18 @@ public class GUI extends Module {
|
|||||||
green.onUpdate(g -> applyRGBAColorUpdates());
|
green.onUpdate(g -> applyRGBAColorUpdates());
|
||||||
blue.onUpdate(b -> applyRGBAColorUpdates());
|
blue.onUpdate(b -> applyRGBAColorUpdates());
|
||||||
alpha.onUpdate(a -> applyRGBAColorUpdates());
|
alpha.onUpdate(a -> applyRGBAColorUpdates());
|
||||||
|
|
||||||
|
// muy mierdas la solución pero funciona
|
||||||
|
red.reset();
|
||||||
|
green.reset();
|
||||||
|
blue.reset();
|
||||||
|
alpha.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onTick(TickEvent.Post event) {
|
public void onTick(TickEvent.Post event) {
|
||||||
if (rainbow.isEnabled()) {
|
if (rainbow.isEnabled()) {
|
||||||
float speed = (float) (rainbowSpeed.getMax() - rainbowSpeed.getValue());
|
Color color = Colors.rainbowColor(rainbowSpeed.getIntValue(), alpha.getIntValue(), saturation.getFloatValue(), brightness.getFloatValue());
|
||||||
float hue = (System.currentTimeMillis() % (long) speed) / speed;
|
|
||||||
Color color = Color.getHSBColor(hue, saturation.getFloatValue(), brightness.getFloatValue());
|
|
||||||
|
|
||||||
Colors.red = color.getRed();
|
Colors.red = color.getRed();
|
||||||
Colors.green = color.getGreen();
|
Colors.green = color.getGreen();
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||||
|
import me.retucio.camtweaks.module.settings.EnumSetting;
|
||||||
|
import me.retucio.camtweaks.util.render.GlintRenderLayer;
|
||||||
|
import net.minecraft.client.render.RenderLayer;
|
||||||
|
import net.minecraft.util.DyeColor;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
/** continúa en:
|
||||||
|
* @see me.retucio.camtweaks.mixin.BufferStorageMixin
|
||||||
|
* @see me.retucio.camtweaks.mixin.EquipmentRendererMixin
|
||||||
|
* @see me.retucio.camtweaks.mixin.ItemRendererMixin
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class GlintPlus extends Module {
|
||||||
|
|
||||||
|
public BooleanSetting items = addSetting(new BooleanSetting("items", "modificar el destello de encantamiento de los items", true));
|
||||||
|
public BooleanSetting armor = addSetting(new BooleanSetting("armadura", "modificar el destello de encantamiento de la armadura", true));
|
||||||
|
public EnumSetting<GlintColors> glintColor = addSetting(new EnumSetting<>("colores", "color del glint", GlintColors.class, GlintColors.PURPLE));
|
||||||
|
|
||||||
|
public GlintPlus() {
|
||||||
|
super("destello de enchants.", "modifica el color del brillo de los encantamientos");
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderLayer getGlint() {
|
||||||
|
int color = getColor();
|
||||||
|
if (!isEnabled() || !items.isEnabled()) return RenderLayer.getGlint();
|
||||||
|
return GlintRenderLayer.glintColor.get(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderLayer getEntityGlint() {
|
||||||
|
int color = getColor();
|
||||||
|
if (!isEnabled() || !items.isEnabled()) return RenderLayer.getEntityGlint();
|
||||||
|
return GlintRenderLayer.entityGlintColor.get(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderLayer getArmorEntityGlint() {
|
||||||
|
int color = getColor();
|
||||||
|
if (!isEnabled() || !armor.isEnabled()) return RenderLayer.getArmorEntityGlint();
|
||||||
|
return GlintRenderLayer.armorEntityGlintColor.get(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColor() {
|
||||||
|
String colorName = glintColor.getValue().getRealName().toLowerCase();
|
||||||
|
|
||||||
|
switch (colorName) {
|
||||||
|
case "rainbow":
|
||||||
|
return DyeColor.values().length;
|
||||||
|
case "none":
|
||||||
|
return DyeColor.values().length + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (DyeColor dye : DyeColor.values())
|
||||||
|
if (dye.name().equalsIgnoreCase(colorName)) return dye.getIndex();
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GlintColors {
|
||||||
|
RED("rojo"),
|
||||||
|
ORANGE("naranja"),
|
||||||
|
YELLOW("amarillo"),
|
||||||
|
LIME("lima"),
|
||||||
|
GREEN("verde"),
|
||||||
|
CYAN("cian"),
|
||||||
|
LIGHT_BLUE("celeste"),
|
||||||
|
BLUE("azul"),
|
||||||
|
PURPLE("morado"),
|
||||||
|
MAGENTA("magenta"),
|
||||||
|
PINK("rosa"),
|
||||||
|
BROWN("marrón"),
|
||||||
|
BLACK("negro"),
|
||||||
|
GRAY("gris"),
|
||||||
|
LIGHT_GRAY("plata"),
|
||||||
|
WHITE("blanco"),
|
||||||
|
RAINBOW("gay."),
|
||||||
|
NONE("desactivado");
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
GlintColors(String name) { this.name = name; }
|
||||||
|
@Override public String toString() { return name; }
|
||||||
|
public String getRealName() { return super.toString(); }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,22 @@
|
|||||||
package me.retucio.camtweaks.module.modules;
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
import me.retucio.camtweaks.module.Module;
|
import me.retucio.camtweaks.module.Module;
|
||||||
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
import me.retucio.camtweaks.module.settings.*;
|
||||||
import me.retucio.camtweaks.module.settings.EnumSetting;
|
import me.retucio.camtweaks.ui.screen.HudEditorScreen;
|
||||||
import me.retucio.camtweaks.module.settings.NumberSetting;
|
import org.lwjgl.glfw.GLFW;
|
||||||
import me.retucio.camtweaks.module.settings.StringSetting;
|
|
||||||
|
/** lógica del HUD manejada en:
|
||||||
|
* @see me.retucio.camtweaks.ui.HudRenderer
|
||||||
|
* @see me.retucio.camtweaks.ui.widgets.HudElement
|
||||||
|
* @see HudEditorScreen
|
||||||
|
*/
|
||||||
|
|
||||||
public class HUD extends Module {
|
public class HUD extends Module {
|
||||||
|
|
||||||
|
// editor
|
||||||
|
public KeySetting editorKey = addSetting(new KeySetting("tecla del editor", "tecla asignada al editor de elementos del hud", GLFW.GLFW_KEY_PAGE_UP));
|
||||||
|
|
||||||
|
// colores
|
||||||
public NumberSetting red = addSetting(new NumberSetting("rojo", "cantidad de rojo", 255, 0, 255, 1));
|
public NumberSetting red = addSetting(new NumberSetting("rojo", "cantidad de rojo", 255, 0, 255, 1));
|
||||||
public NumberSetting green = addSetting(new NumberSetting("verde", "cantidad de verde", 255, 0, 255, 1));
|
public NumberSetting green = addSetting(new NumberSetting("verde", "cantidad de verde", 255, 0, 255, 1));
|
||||||
public NumberSetting blue = addSetting(new NumberSetting("azul", "cantidad de azul", 255, 0, 255, 1));
|
public NumberSetting blue = addSetting(new NumberSetting("azul", "cantidad de azul", 255, 0, 255, 1));
|
||||||
@@ -16,18 +25,15 @@ public class HUD extends Module {
|
|||||||
public NumberSetting rainbowSpeed = addSetting(new NumberSetting("velocidad del arcoíris", "velocidad del arcoíris", 1000, 0, 10000, 2));
|
public NumberSetting rainbowSpeed = addSetting(new NumberSetting("velocidad del arcoíris", "velocidad del arcoíris", 1000, 0, 10000, 2));
|
||||||
|
|
||||||
public NumberSetting alpha = addSetting(new NumberSetting("opacidad", "antitransparencia", 255, 0, 255, 1));
|
public NumberSetting alpha = addSetting(new NumberSetting("opacidad", "antitransparencia", 255, 0, 255, 1));
|
||||||
|
|
||||||
|
// ajustes
|
||||||
|
public BooleanSetting showOnF3 = addSetting(new BooleanSetting("mostrar en F3", "renderizar HUD en el menú de debug", false));
|
||||||
|
public BooleanSetting showOnChat = addSetting(new BooleanSetting("mostrar en chat", "renderizar HUD en la pantalla del chat", false));
|
||||||
|
|
||||||
public BooleanSetting shadow = addSetting(new BooleanSetting("sombra", "texto con sombra", true));
|
public BooleanSetting shadow = addSetting(new BooleanSetting("sombra", "texto con sombra", true));
|
||||||
|
|
||||||
public BooleanSetting dontOverride = addSetting(new BooleanSetting("no sobreescribir", "evita dibujar por encima de otros elementos de la interfaz", true));
|
|
||||||
|
|
||||||
public EnumSetting<TimeFormat> timeFormat = addSetting(new EnumSetting<>("formato de la hora", "12h o 24h", TimeFormat.class, TimeFormat.TWENTY_FOUR_HOUR));
|
|
||||||
public NumberSetting timezone = addSetting(new NumberSetting("zona horaria", "zona horaria en UTC+n", 1, -6, 6, 1));
|
public NumberSetting timezone = addSetting(new NumberSetting("zona horaria", "zona horaria en UTC+n", 1, -6, 6, 1));
|
||||||
|
public EnumSetting<TimeFormat> timeFormat = addSetting(new EnumSetting<>("formato de la hora", "12h o 24h", TimeFormat.class, TimeFormat.TWENTY_FOUR_HOUR));
|
||||||
public BooleanSetting coords = addSetting(new BooleanSetting("coordenadas", "mostrar coordenadas", true));
|
public StringSetting customText = addSetting(new StringSetting("texto custom", "marca de agua (dejar vacío para quitar)", "adolf jitler inshtagram feishbuc twiter", 40));
|
||||||
public StringSetting customText = addSetting(new StringSetting("texto custom", "marca de agua (dejar vacío para quitar)", "ESCROTO", 40));
|
|
||||||
public BooleanSetting fps = addSetting(new BooleanSetting("fps", "mostrar frames por segundo", true));
|
|
||||||
public BooleanSetting tps = addSetting(new BooleanSetting("tps", "mostrar tasa de ticks por segundo del server", true));
|
|
||||||
public BooleanSetting time = addSetting(new BooleanSetting("hora", "mostrar hora actual", true));
|
|
||||||
|
|
||||||
public HUD() {
|
public HUD() {
|
||||||
super("HUD", "superposición de la pantalla con info. adicional");
|
super("HUD", "superposición de la pantalla con info. adicional");
|
||||||
@@ -38,11 +44,6 @@ public class HUD extends Module {
|
|||||||
green.setVisible(!v);
|
green.setVisible(!v);
|
||||||
blue.setVisible(!v);
|
blue.setVisible(!v);
|
||||||
});
|
});
|
||||||
|
|
||||||
time.onUpdate(v -> {
|
|
||||||
timeFormat.setVisible(v);
|
|
||||||
timezone.setVisible(v);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum TimeFormat {
|
public enum TimeFormat {
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
|
||||||
|
public class Headhitters extends Module {
|
||||||
|
|
||||||
|
public Headhitters() {
|
||||||
|
super("headhitters", "mantén pulsado el espacio para hacer headhitting sin tener que espamearlo");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick() {
|
||||||
|
if (mc.player == null) return;
|
||||||
|
mc.player.jumpingCooldown = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.RenderWorldEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.camtweaks.AddEntityEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.camtweaks.RemoveEntityEvent;
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||||
|
import me.retucio.camtweaks.module.settings.NumberSetting;
|
||||||
|
import me.retucio.camtweaks.util.render.RenderUtil;
|
||||||
|
|
||||||
|
import net.minecraft.client.network.OtherClientPlayerEntity;
|
||||||
|
import net.minecraft.client.render.*;
|
||||||
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
|
||||||
|
import org.joml.*;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public class LogoutSpots extends Module {
|
||||||
|
|
||||||
|
public BooleanSetting filledBox = addSetting(new BooleanSetting("caja rellena", "rellenar caja", true));
|
||||||
|
public BooleanSetting outlineBox = addSetting(new BooleanSetting("caja de esquinas", "contorno de caja", true));
|
||||||
|
|
||||||
|
public NumberSetting red = addSetting(new NumberSetting("rojo", "cantidad de rojo", 200, 0, 255, 1));
|
||||||
|
public NumberSetting green = addSetting(new NumberSetting("verde", "cantidad de verde", 90, 0, 255, 1));
|
||||||
|
public NumberSetting blue = addSetting(new NumberSetting("azul", "cantidad de azul", 255, 0, 255, 1));
|
||||||
|
public NumberSetting alpha = addSetting(new NumberSetting("opacidad", "antitransparencia", 50, 0, 255, 1));
|
||||||
|
|
||||||
|
public NumberSetting lineWidth = addSetting(new NumberSetting("grosor", "grosor de las líneas a dibujar",
|
||||||
|
2, 1, 10, 0.5f));
|
||||||
|
|
||||||
|
private final List<LogoutBox> boxes = new ArrayList<>();
|
||||||
|
|
||||||
|
public LogoutSpots() {
|
||||||
|
super("puntos de desconexión", "te muestra los puntos donde se desconectan los jugadores");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onWorldRender(RenderWorldEvent event) {
|
||||||
|
if (mc.player == null || mc.world == null) return;
|
||||||
|
|
||||||
|
int r = red.getIntValue();
|
||||||
|
int g = green.getIntValue();
|
||||||
|
int b = blue.getIntValue();
|
||||||
|
int a = alpha.getIntValue();
|
||||||
|
|
||||||
|
MatrixStack matrices = event.getMatrices();
|
||||||
|
|
||||||
|
for (LogoutBox box : boxes) {
|
||||||
|
if (filledBox.isEnabled())
|
||||||
|
RenderUtil.drawFilledBox(matrices, box.dummy.getBoundingBox(), new Color(r, g, b, a));
|
||||||
|
if (outlineBox.isEnabled())
|
||||||
|
RenderUtil.drawOutlineBox(matrices, box.dummy.getBoundingBox(), new Color(r, g, b, a), lineWidth.getFloatValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onEntityRemoved(RemoveEntityEvent event) {
|
||||||
|
if (event.getEntity() instanceof PlayerEntity player && player != mc.player) {
|
||||||
|
if (mc.world != null && mc.world.hasEntity(player)) return; // asegurarse de que salirse de la distancia de renderizado no cuenta como "desconectarse"
|
||||||
|
String playerName = player.getName().getString() + " (" + getLogoutTime(System.currentTimeMillis()) + ")";
|
||||||
|
|
||||||
|
boxes.add(new LogoutBox(
|
||||||
|
ModuleManager.INSTANCE.getModuleByClass(FakePlayer.class).addPlayer(player, playerName),
|
||||||
|
System.currentTimeMillis()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onEntityAdded(AddEntityEvent event) {
|
||||||
|
boxes.removeIf(box -> event.getEntity().getUuid().equals(box.dummy.getUuid()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
boxes.forEach(box -> {
|
||||||
|
box.dummy.setRemoved(Entity.RemovalReason.KILLED);
|
||||||
|
box.dummy.onRemoved();
|
||||||
|
});
|
||||||
|
|
||||||
|
boxes.clear();
|
||||||
|
super.onDisable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getLogoutTime(long logoutTimeMillis) {
|
||||||
|
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
|
||||||
|
|
||||||
|
Instant instant = Instant.ofEpochMilli(logoutTimeMillis);
|
||||||
|
|
||||||
|
ZoneOffset offset = ZoneOffset.ofHours(hud.timezone.getIntValue());
|
||||||
|
LocalTime logoutTime = LocalTime.from(instant.atOffset(offset));
|
||||||
|
|
||||||
|
boolean is24 = hud.timeFormat.is(HUD.TimeFormat.TWENTY_FOUR_HOUR);
|
||||||
|
DateTimeFormatter format = DateTimeFormatter.ofPattern(is24 ? "HH:mm" : "hh:mm a");
|
||||||
|
|
||||||
|
return logoutTime.format(format);
|
||||||
|
}
|
||||||
|
|
||||||
|
public record LogoutBox(
|
||||||
|
OtherClientPlayerEntity dummy,
|
||||||
|
long logoutTime
|
||||||
|
) {}
|
||||||
|
}
|
||||||
@@ -14,8 +14,11 @@ import net.minecraft.entity.LivingEntity;
|
|||||||
import net.minecraft.entity.damage.DamageSource;
|
import net.minecraft.entity.damage.DamageSource;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.projectile.PersistentProjectileEntity;
|
import net.minecraft.entity.projectile.PersistentProjectileEntity;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.world.entity.EntityQueriable;
|
||||||
|
import net.minecraft.world.entity.UniquelyIdentifiable;
|
||||||
|
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
@@ -44,8 +47,11 @@ public class Nametags extends Module {
|
|||||||
public EnumSetting<HealthMode> healthMode = addSetting(new EnumSetting<>("mostrar vida en", "de qué manera mostrar la vida", HealthMode.class, HealthMode.POINTS));
|
public EnumSetting<HealthMode> healthMode = addSetting(new EnumSetting<>("mostrar vida en", "de qué manera mostrar la vida", HealthMode.class, HealthMode.POINTS));
|
||||||
|
|
||||||
public BooleanSetting countItems = addSetting(new BooleanSetting("contar items", "muestra cuánto de un item hay en un stack dropeado", true));
|
public BooleanSetting countItems = addSetting(new BooleanSetting("contar items", "muestra cuánto de un item hay en un stack dropeado", true));
|
||||||
|
public ListSetting<Item> items = addSetting(new ListSetting<>("items", "te permite elegir cuáles items tienen su nombre visible",
|
||||||
|
Lists.itemList, Lists.allTrue(Lists.itemList), Lists.itemNames));
|
||||||
public BooleanSetting showProjectileDamage = addSetting(new BooleanSetting("daño del proyectil", "muestra cuánto daño hace un proyectil en su nametag", true));
|
public BooleanSetting showProjectileDamage = addSetting(new BooleanSetting("daño del proyectil", "muestra cuánto daño hace un proyectil en su nametag", true));
|
||||||
|
|
||||||
|
public BooleanSetting showSelf = addSetting(new BooleanSetting("mostrar propio", "mostrar nametag propio", false));
|
||||||
public BooleanSetting distinguishBabies = addSetting(new BooleanSetting("distinguir bebés", "cambia el nametag cuando una entidad está en su fase bebé", false));
|
public BooleanSetting distinguishBabies = addSetting(new BooleanSetting("distinguir bebés", "cambia el nametag cuando una entidad está en su fase bebé", false));
|
||||||
public BooleanSetting petOwner = addSetting(new BooleanSetting("mostrar dueño", "muestra el dueño de una mascota (no funciona en servers no premium)", false));
|
public BooleanSetting petOwner = addSetting(new BooleanSetting("mostrar dueño", "muestra el dueño de una mascota (no funciona en servers no premium)", false));
|
||||||
|
|
||||||
@@ -64,6 +70,10 @@ public class Nametags extends Module {
|
|||||||
entities.setDefaultValues(entities.getValues());
|
entities.setDefaultValues(entities.getValues());
|
||||||
|
|
||||||
health.onUpdate(v -> healthMode.setVisible(v));
|
health.onUpdate(v -> healthMode.setVisible(v));
|
||||||
|
|
||||||
|
entities.onUpdate(entities -> {
|
||||||
|
items.setVisible(entities.get(EntityType.ITEM));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// literalmente cómo lo calcula Minecraft
|
// literalmente cómo lo calcula Minecraft
|
||||||
@@ -74,7 +84,7 @@ public class Nametags extends Module {
|
|||||||
double velocity = arrow.getVelocity().length();
|
double velocity = arrow.getVelocity().length();
|
||||||
DamageSource damageSource = arrow.getDamageSources().arrow(arrow, arrow.getOwner());
|
DamageSource damageSource = arrow.getDamageSources().arrow(arrow, arrow.getOwner());
|
||||||
|
|
||||||
if (arrow.getWeaponStack() != null && arrow.getWorld() instanceof ServerWorld world)
|
if (arrow.getWeaponStack() != null && arrow.getEntityWorld() instanceof ServerWorld world)
|
||||||
initialDamage = EnchantmentHelper.getDamage(world, arrow.getWeaponStack(), mc.player, damageSource, (float) initialDamage);
|
initialDamage = EnchantmentHelper.getDamage(world, arrow.getWeaponStack(), mc.player, damageSource, (float) initialDamage);
|
||||||
|
|
||||||
int finalDamage = MathHelper.ceil(MathHelper.clamp(velocity * initialDamage, 0, 2.147483647E9));
|
int finalDamage = MathHelper.ceil(MathHelper.clamp(velocity * initialDamage, 0, 2.147483647E9));
|
||||||
@@ -88,9 +98,11 @@ public class Nametags extends Module {
|
|||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public String getOwnerName(LazyEntityReference<LivingEntity> owner) {
|
public String getOwnerName(LazyEntityReference<LivingEntity> owner) {
|
||||||
// si el dueño está en línea
|
// si el dueño está en línea (de manera segura)
|
||||||
LivingEntity ownerEntity = owner.resolve(mc.world, LivingEntity.class);
|
if (mc.world instanceof EntityQueriable<?> queriableWorld) {
|
||||||
if (ownerEntity instanceof PlayerEntity playerEntity) return playerEntity.getName().getString();
|
LivingEntity ownerEntity = owner.resolve(queriableWorld, LivingEntity.class);
|
||||||
|
if (ownerEntity instanceof PlayerEntity playerEntity) return playerEntity.getName().getString();
|
||||||
|
}
|
||||||
|
|
||||||
// mirar si ya está en la caché
|
// mirar si ya está en la caché
|
||||||
UUID uuid = owner.getUuid();
|
UUID uuid = owner.getUuid();
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.registry.tag.ItemTags;
|
||||||
|
|
||||||
|
public class NoMiningInterruptions extends Module {
|
||||||
|
|
||||||
|
public BooleanSetting withPickaxeOnly = addSetting(new BooleanSetting("solo con pico", "ignorar entidades solamente cuando se sujeta un pico", false));
|
||||||
|
|
||||||
|
public NoMiningInterruptions() {
|
||||||
|
super("minar sin interrupción", "te permite minar bloques a través de entidades");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean shouldIgnoreEntity(Entity entity) {
|
||||||
|
if (entity == null || !this.isEnabled()) return false;
|
||||||
|
if (withPickaxeOnly.isEnabled())
|
||||||
|
return (mc.player.getMainHandStack().isIn(ItemTags.PICKAXES) || mc.player.getOffHandStack().isIn(ItemTags.PICKAXES));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -11,12 +11,12 @@ import net.minecraft.util.Formatting;
|
|||||||
|
|
||||||
/** continúa en:
|
/** continúa en:
|
||||||
* @see me.retucio.camtweaks.mixin.ClientPlayNetworkHandlerMixin
|
* @see me.retucio.camtweaks.mixin.ClientPlayNetworkHandlerMixin
|
||||||
* @see me.retucio.camtweaks.mixin.EntityEffectParticleEffectMixin
|
|
||||||
* @see me.retucio.camtweaks.mixin.FogRendererMixin
|
* @see me.retucio.camtweaks.mixin.FogRendererMixin
|
||||||
* @see me.retucio.camtweaks.mixin.GameRendererMixin
|
* @see me.retucio.camtweaks.mixin.GameRendererMixin
|
||||||
* @see me.retucio.camtweaks.mixin.InGameHudMixin
|
* @see me.retucio.camtweaks.mixin.InGameHudMixin
|
||||||
* @see me.retucio.camtweaks.mixin.InGameOverlayRendererMixin
|
* @see me.retucio.camtweaks.mixin.InGameOverlayRendererMixin
|
||||||
* @see me.retucio.camtweaks.mixin.ParticleManagerMixin
|
* @see me.retucio.camtweaks.mixin.ParticleManagerMixin
|
||||||
|
* @see me.retucio.camtweaks.mixin.StatusEffectFogModifierMixin
|
||||||
* @see me.retucio.camtweaks.mixin.StuckArrowsFeatureRendererMixin
|
* @see me.retucio.camtweaks.mixin.StuckArrowsFeatureRendererMixin
|
||||||
* @see me.retucio.camtweaks.mixin.TextRendererDrawerMixin
|
* @see me.retucio.camtweaks.mixin.TextRendererDrawerMixin
|
||||||
* @see me.retucio.camtweaks.mixin.WeatherRenderingMixin
|
* @see me.retucio.camtweaks.mixin.WeatherRenderingMixin
|
||||||
@@ -32,8 +32,7 @@ public class NoRender extends Module {
|
|||||||
|
|
||||||
public BooleanSetting rain = addSetting(new BooleanSetting("lluvia", "l l u v i a", true));
|
public BooleanSetting rain = addSetting(new BooleanSetting("lluvia", "l l u v i a", true));
|
||||||
public BooleanSetting snow = addSetting(new BooleanSetting("nieve", "n i e v e", true));
|
public BooleanSetting snow = addSetting(new BooleanSetting("nieve", "n i e v e", true));
|
||||||
public BooleanSetting dimensionFog = addSetting(new BooleanSetting("niebla de dimensión", "n i e b l a", true));
|
public BooleanSetting endFlashes = addSetting(new BooleanSetting("flashes del end", "renderizar los recientemente añadidos flashes en el end", true));
|
||||||
public BooleanSetting endFlashes; // para cuando actualice
|
|
||||||
|
|
||||||
public ListSetting<ParticleType<?>> particles = addSetting(new ListSetting<>("partículas", "lista de partículas que se renderizan",
|
public ListSetting<ParticleType<?>> particles = addSetting(new ListSetting<>("partículas", "lista de partículas que se renderizan",
|
||||||
Lists.particleList, Lists.allTrue(Lists.particleList), Lists.particleNames));
|
Lists.particleList, Lists.allTrue(Lists.particleList), Lists.particleNames));
|
||||||
@@ -41,9 +40,6 @@ public class NoRender extends Module {
|
|||||||
public BooleanSetting nauseaEffect = addSetting(new BooleanSetting("náusea", "renderizar borrachera", false));
|
public BooleanSetting nauseaEffect = addSetting(new BooleanSetting("náusea", "renderizar borrachera", false));
|
||||||
public BooleanSetting blindnessEffect = addSetting(new BooleanSetting("ceguera", "renderizar miopía", false));
|
public BooleanSetting blindnessEffect = addSetting(new BooleanSetting("ceguera", "renderizar miopía", false));
|
||||||
public BooleanSetting darknessEffect = addSetting(new BooleanSetting("oscuridad", "renderizar miedo a la oscuridad", false));
|
public BooleanSetting darknessEffect = addSetting(new BooleanSetting("oscuridad", "renderizar miedo a la oscuridad", false));
|
||||||
public BooleanSetting nightVisionEffect;
|
|
||||||
public NumberSetting potionParticleAlpha = addSetting(new NumberSetting("opacidad de burbujas", "opacidad de las partículas de pociones",
|
|
||||||
170, 0, 255, 1));
|
|
||||||
|
|
||||||
public BooleanSetting scoreboard = addSetting(new BooleanSetting("marcador", "mostrar marcador a la derecha", false));
|
public BooleanSetting scoreboard = addSetting(new BooleanSetting("marcador", "mostrar marcador a la derecha", false));
|
||||||
public BooleanSetting titles = addSetting(new BooleanSetting("títulos", "mostrar títulos (del comando /title)", false));
|
public BooleanSetting titles = addSetting(new BooleanSetting("títulos", "mostrar títulos (del comando /title)", false));
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
|
||||||
|
/** continúa en:
|
||||||
|
* @see me.retucio.camtweaks.mixin.ClientPlayerEntityMixin
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class PortalGUI extends Module {
|
||||||
|
|
||||||
|
public PortalGUI() {
|
||||||
|
super("interfaz en portales", "te permite abrir interfaces dentro de portales, como el chat o el inventario");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import net.minecraft.client.network.ServerInfo;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
|
|
||||||
|
/** continúa en:
|
||||||
|
* @see me.retucio.camtweaks.mixin.ClientCommonNetworkHandlerMixin
|
||||||
|
* @see me.retucio.camtweaks.mixin.ConfirmScreenMixin
|
||||||
|
* @see me.retucio.camtweaks.mixin.ResourcePackPolicyMixin
|
||||||
|
* @see me.retucio.camtweaks.mixin.ServerConnectorMixin
|
||||||
|
* @see me.retucio.camtweaks.mixin.ServerInfoMixin
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class RPackBypass extends Module {
|
||||||
|
|
||||||
|
public String TAG_NAME = "bypassTextures";
|
||||||
|
public String ENUM_NAME = "BYPASS";
|
||||||
|
public Text BYPASS_TEXT = Text.literal("nuh uh");
|
||||||
|
|
||||||
|
public RPackBypass() {
|
||||||
|
super("bypassear packs", "te permite omitir packs de recursos forzados por servers");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServerInfo.ResourcePackPolicy getPolicy() {
|
||||||
|
return ServerInfo.ResourcePackPolicy.valueOf(ENUM_NAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.ChangeRotationEvent;
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||||
|
import me.retucio.camtweaks.module.settings.NumberSetting;
|
||||||
|
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||||
|
|
||||||
|
public class Rotations extends Module {
|
||||||
|
|
||||||
|
public NumberSetting yaw = addSetting(new NumberSetting("guiñada", "eje vertical - giro horizontal (yaw)", 0, -180, 180, 1));
|
||||||
|
public NumberSetting pitch = addSetting(new NumberSetting("cabeceo", "eje horizontal - giro vertical (pitch)", 0, -90, 90, 1));
|
||||||
|
|
||||||
|
public BooleanSetting smooth = addSetting(new BooleanSetting("evitar movimiento", "cancela todo movimiento de la cámara", false));
|
||||||
|
public BooleanSetting serverSide = addSetting(new BooleanSetting("serverside", "espamea paquetes de rotación al servidor", false));
|
||||||
|
|
||||||
|
public Rotations() {
|
||||||
|
super("rotaciones", "te permite forzar una rotación específica");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick() {
|
||||||
|
if (mc.player == null) return;
|
||||||
|
|
||||||
|
mc.player.setYaw(yaw.getFloatValue());
|
||||||
|
mc.player.setPitch(pitch.getFloatValue());
|
||||||
|
|
||||||
|
if (serverSide.isEnabled())
|
||||||
|
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
|
||||||
|
yaw.getFloatValue(), pitch.getFloatValue(), mc.player.isOnGround(), mc.player.horizontalCollision));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onChangeRotation(ChangeRotationEvent event) {
|
||||||
|
if (smooth.isEnabled()
|
||||||
|
&& (event.getYaw() != yaw.getFloatValue() || event.getPitch() != pitch.getFloatValue())){
|
||||||
|
event.cancel();
|
||||||
|
}}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.KeyEvent;
|
||||||
|
import me.retucio.camtweaks.mixin.accessor.HandledScreenAccessor;
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||||
|
import me.retucio.camtweaks.module.settings.KeySetting;
|
||||||
|
import me.retucio.camtweaks.ui.screen.PreviewScreen;
|
||||||
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
|
import me.retucio.camtweaks.util.Colors;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.util.MiscUtil;
|
||||||
|
import net.minecraft.block.ShulkerBoxBlock;
|
||||||
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||||
|
import net.minecraft.component.DataComponentTypes;
|
||||||
|
import net.minecraft.component.type.ContainerComponent;
|
||||||
|
import net.minecraft.item.BlockItem;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
|
import net.minecraft.screen.slot.Slot;
|
||||||
|
|
||||||
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
|
||||||
|
public class ShulkerPeek extends Module {
|
||||||
|
|
||||||
|
public KeySetting previewKey = addSetting(new KeySetting("tecla de previsualización", "tecla a mantener para previsualizar", GLFW.GLFW_KEY_LEFT_ALT));
|
||||||
|
public BooleanSetting showTooltips = addSetting(new BooleanSetting("mostrar tooltips", "añadir texto a los tooltips (cajas de texto) de los shulkers", true));
|
||||||
|
|
||||||
|
public static final HashMap<Item, Color> SHULKER_COLORS = new HashMap<>();
|
||||||
|
|
||||||
|
public ShulkerPeek() {
|
||||||
|
super("prev. de shulkers", "te permite previsualizar el contenido de shulkers desde el inventario");
|
||||||
|
|
||||||
|
// colores y tal (https://github.com/kgriff0n/shulker-preview)
|
||||||
|
SHULKER_COLORS.put(Items.SHULKER_BOX, Colors.LAVENDER);
|
||||||
|
SHULKER_COLORS.put(Items.WHITE_SHULKER_BOX, Colors.WHITE);
|
||||||
|
SHULKER_COLORS.put(Items.LIGHT_GRAY_SHULKER_BOX, Colors.SILVER);
|
||||||
|
SHULKER_COLORS.put(Items.GRAY_SHULKER_BOX, Colors.GRAY);
|
||||||
|
SHULKER_COLORS.put(Items.BLACK_SHULKER_BOX, Colors.BLACK);
|
||||||
|
SHULKER_COLORS.put(Items.BROWN_SHULKER_BOX, Colors.BROWN);
|
||||||
|
SHULKER_COLORS.put(Items.RED_SHULKER_BOX, Colors.RED);
|
||||||
|
SHULKER_COLORS.put(Items.ORANGE_SHULKER_BOX, Colors.ORANGE);
|
||||||
|
SHULKER_COLORS.put(Items.YELLOW_SHULKER_BOX, Colors.YELLOW);
|
||||||
|
SHULKER_COLORS.put(Items.LIME_SHULKER_BOX, Colors.LIME);
|
||||||
|
SHULKER_COLORS.put(Items.GREEN_SHULKER_BOX, Colors.GREEN);
|
||||||
|
SHULKER_COLORS.put(Items.CYAN_SHULKER_BOX, Colors.CYAN);
|
||||||
|
SHULKER_COLORS.put(Items.LIGHT_BLUE_SHULKER_BOX, Colors.CELESTE);
|
||||||
|
SHULKER_COLORS.put(Items.BLUE_SHULKER_BOX, Colors.BLUE);
|
||||||
|
SHULKER_COLORS.put(Items.PURPLE_SHULKER_BOX, Colors.PURPLE);
|
||||||
|
SHULKER_COLORS.put(Items.MAGENTA_SHULKER_BOX, Colors.MAGENTA);
|
||||||
|
SHULKER_COLORS.put(Items.PINK_SHULKER_BOX, Colors.PINK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onKey(KeyEvent event) {
|
||||||
|
if (mc.player == null) return;
|
||||||
|
if (event.getKey() != previewKey.getKey()) return;
|
||||||
|
|
||||||
|
if (event.getAction() == GLFW.GLFW_PRESS) {
|
||||||
|
openPreviewScreen();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getAction() == GLFW.GLFW_REPEAT) {
|
||||||
|
if (mc.currentScreen instanceof PreviewScreen preview) {
|
||||||
|
if (preview.getType() != PreviewScreen.PreviewType.SHULKER)
|
||||||
|
openPreviewScreen();
|
||||||
|
} else openPreviewScreen();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getAction() == GLFW.GLFW_RELEASE) {
|
||||||
|
if (mc.currentScreen instanceof PreviewScreen preview)
|
||||||
|
preview.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openPreviewScreen() {
|
||||||
|
ItemStack stack;
|
||||||
|
|
||||||
|
if (mc.currentScreen instanceof PreviewScreen previewScreen) {
|
||||||
|
int focusedSlot = previewScreen.getFocusedSlot();
|
||||||
|
if (focusedSlot == -1) return;
|
||||||
|
stack = previewScreen.getInventory().get(focusedSlot);
|
||||||
|
} else if (mc.currentScreen instanceof HandledScreen<?> handledScreen) {
|
||||||
|
stack = ((HandledScreenAccessor) handledScreen).getFocusedSlot().getStack();
|
||||||
|
} else return;
|
||||||
|
|
||||||
|
if (stack.getItem() == Items.ENDER_CHEST) {
|
||||||
|
if (MiscUtil.getEchestInv() == null) {
|
||||||
|
ChatUtil.warn("abre un enderchest primero");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mc.setScreen(new PreviewScreen(MiscUtil.getEchestInv(), mc.currentScreen));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (isShulkerEmpty(stack)) return;
|
||||||
|
mc.setScreen(new PreviewScreen(stack, mc.currentScreen));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isShulkerEmpty(ItemStack stack) {
|
||||||
|
if (stack == null) return true;
|
||||||
|
if (!(stack.getItem() instanceof BlockItem blockItem)) return true;
|
||||||
|
if (!(blockItem.getBlock() instanceof ShulkerBoxBlock)) return true;
|
||||||
|
|
||||||
|
ContainerComponent container = stack.get(DataComponentTypes.CONTAINER);
|
||||||
|
if (container == null) return true;
|
||||||
|
|
||||||
|
return container.stream().allMatch(ItemStack::isEmpty);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package me.retucio.camtweaks.module.modules;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.DamageItemEvent;
|
||||||
|
import me.retucio.camtweaks.module.Module;
|
||||||
|
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||||
|
import me.retucio.camtweaks.module.settings.NumberSetting;
|
||||||
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.sound.SoundCategory;
|
||||||
|
import net.minecraft.sound.SoundEvents;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
import net.minecraft.util.Formatting;
|
||||||
|
|
||||||
|
public class WarnLowDurability extends Module {
|
||||||
|
|
||||||
|
public NumberSetting limitPercentage = addSetting(new NumberSetting("porcentaje", "porcentaje de durabilidad restante a la que se te avisa",
|
||||||
|
5, 1, 100, 1));
|
||||||
|
|
||||||
|
public BooleanSetting message = addSetting(new BooleanSetting("mensaje", "enviar un mensaje para alertar al usuario", true));
|
||||||
|
public BooleanSetting sound = addSetting(new BooleanSetting("sonido", "reproducir un sonido para alertar al usuario", true));
|
||||||
|
|
||||||
|
public WarnLowDurability() {
|
||||||
|
super("aviso de baja dur.", "te avisa cuando la herramienta que sostengas sobrepase un límite de durabilidad");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onDecreaseDurability(DamageItemEvent event) {
|
||||||
|
if (mc.player == null || mc.world == null) return;
|
||||||
|
ItemStack stack = event.getStack();
|
||||||
|
|
||||||
|
double percentage = 100 * (1 - ((double) stack.getDamage() / stack.getMaxDamage()));
|
||||||
|
if (percentage <= limitPercentage.getValue()) {
|
||||||
|
|
||||||
|
if (sound.isEnabled())
|
||||||
|
mc.world.playSound(mc.player, mc.player.getBlockPos(),
|
||||||
|
SoundEvents.BLOCK_BELL_USE, SoundCategory.AMBIENT, 1, 1);
|
||||||
|
|
||||||
|
if (message.isEnabled()) {
|
||||||
|
String customName = stack.getCustomName() == null ? "" : " \"" + stack.getCustomName().getString() + "\"";
|
||||||
|
Text text = Text.literal(Formatting.AQUA + stack.getItemName().getString()
|
||||||
|
+ Formatting.GREEN + customName + Formatting.RESET
|
||||||
|
+ " a " + Formatting.GOLD + ((int) percentage + "") + "%"
|
||||||
|
+ Formatting.RESET + " de durabilidad");
|
||||||
|
mc.execute(() -> ChatUtil.warn(text)); // en mc.execute porque si lo llamo directamente, lo hago desde el thread del server que causa un error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ public class Zoom extends Module {
|
|||||||
6, 1, 10, 0.1));
|
6, 1, 10, 0.1));
|
||||||
|
|
||||||
public NumberSetting mouseSensMultiplier = addSetting(new NumberSetting("sensibilidad", "multiplicador de la sensibilidad del ratón",
|
public NumberSetting mouseSensMultiplier = addSetting(new NumberSetting("sensibilidad", "multiplicador de la sensibilidad del ratón",
|
||||||
0.7, 0.01, 1, 0.05));
|
0.4, 0, 1, 0.05));
|
||||||
|
|
||||||
public BooleanSetting smoothCam = addSetting(new BooleanSetting("cámara cinemática", "usa la cámara cinemática mientras hagas zoom", false));
|
public BooleanSetting smoothCam = addSetting(new BooleanSetting("cámara cinemática", "usa la cámara cinemática mientras hagas zoom", false));
|
||||||
|
|
||||||
@@ -38,19 +38,19 @@ public class Zoom extends Module {
|
|||||||
|
|
||||||
public Zoom() {
|
public Zoom() {
|
||||||
super("zoom", "lupa");
|
super("zoom", "lupa");
|
||||||
super.keyMode.setValue(KeyModes.HOLD);
|
|
||||||
super.keyMode.setDefaultValue(KeyModes.HOLD);
|
|
||||||
super.notify.setEnabled(false);
|
|
||||||
super.notify.setDefaultValue(false);
|
|
||||||
assignKey(GLFW.GLFW_KEY_F);
|
assignKey(GLFW.GLFW_KEY_F);
|
||||||
|
|
||||||
|
keyMode.setDefaultValue(KeyModes.HOLD);
|
||||||
|
keyMode.setValue(KeyModes.HOLD);
|
||||||
|
|
||||||
|
notify.setDefaultValue(false);
|
||||||
|
notify.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
if (mc.options == null) return;
|
if (mc.options == null) return;
|
||||||
|
|
||||||
CameraTweaks.EVENT_BUS.register(this);
|
|
||||||
|
|
||||||
prevSmoothCam = mc.options.smoothCameraEnabled;
|
prevSmoothCam = mc.options.smoothCameraEnabled;
|
||||||
prevMouseSens = mc.options.getMouseSensitivity().getValue();
|
prevMouseSens = mc.options.getMouseSensitivity().getValue();
|
||||||
prevFov = mc.options.getFov().getValue();
|
prevFov = mc.options.getFov().getValue();
|
||||||
@@ -58,18 +58,21 @@ public class Zoom extends Module {
|
|||||||
mc.options.hudHidden = !showHUD.isEnabled();
|
mc.options.hudHidden = !showHUD.isEnabled();
|
||||||
|
|
||||||
value = defaultZoom.getValue();
|
value = defaultZoom.getValue();
|
||||||
|
|
||||||
|
super.onEnable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (mc.options == null) return;
|
if (mc.options == null) return;
|
||||||
CameraTweaks.EVENT_BUS.unregister(this);
|
|
||||||
|
|
||||||
mc.options.smoothCameraEnabled = prevSmoothCam;
|
mc.options.smoothCameraEnabled = prevSmoothCam;
|
||||||
mc.options.getMouseSensitivity().setValue(prevMouseSens);
|
mc.options.getMouseSensitivity().setValue(prevMouseSens);
|
||||||
mc.options.hudHidden = prevHUD;
|
mc.options.hudHidden = prevHUD;
|
||||||
|
|
||||||
mc.worldRenderer.scheduleTerrainUpdate();
|
mc.worldRenderer.scheduleTerrainUpdate();
|
||||||
|
|
||||||
|
super.onDisable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,110 +0,0 @@
|
|||||||
package me.retucio.camtweaks.ui;
|
|
||||||
|
|
||||||
import me.retucio.camtweaks.event.SubscribeEvent;
|
|
||||||
import me.retucio.camtweaks.event.events.PacketEvent;
|
|
||||||
import me.retucio.camtweaks.module.ModuleManager;
|
|
||||||
import me.retucio.camtweaks.module.modules.Freecam;
|
|
||||||
import me.retucio.camtweaks.module.modules.HUD.TimeFormat;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.gui.DrawContext;
|
|
||||||
import net.minecraft.client.gui.screen.ChatScreen;
|
|
||||||
import net.minecraft.client.render.RenderTickCounter;
|
|
||||||
import net.minecraft.util.math.Vec3d;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.time.LocalTime;
|
|
||||||
import java.time.ZoneOffset;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
|
|
||||||
// en un principio esto iba a mostrar en pantalla los módulos activados, pero me parece innecesario. se queda aquí por si acaso
|
|
||||||
// igual lo uso para algo...
|
|
||||||
public class HUD {
|
|
||||||
|
|
||||||
private static final MinecraftClient mc = MinecraftClient.getInstance();
|
|
||||||
|
|
||||||
private long lastPacketTime = 0;
|
|
||||||
private static float estimatedTPS = 20f;
|
|
||||||
|
|
||||||
public static void render(DrawContext ctx, RenderTickCounter tc) {
|
|
||||||
if (ModuleManager.INSTANCE == null || mc.player == null || mc.cameraEntity == null) return;
|
|
||||||
me.retucio.camtweaks.module.modules.HUD hud = ModuleManager.INSTANCE.getModuleByClass(me.retucio.camtweaks.module.modules.HUD.class);
|
|
||||||
|
|
||||||
int width = mc.getWindow().getScaledWidth();
|
|
||||||
int height = mc.getWindow().getScaledHeight();
|
|
||||||
|
|
||||||
Color color;
|
|
||||||
if (hud.rainbow.isEnabled()) {
|
|
||||||
float speed = 10001 - hud.rainbowSpeed.getFloatValue();
|
|
||||||
float hue = (System.currentTimeMillis() % (int) speed) / speed;
|
|
||||||
Color gamning = Color.getHSBColor(hue, 1, 1);
|
|
||||||
color = new Color(gamning.getRed(), gamning.getGreen(), gamning.getBlue(), hud.alpha.getIntValue());
|
|
||||||
} else {
|
|
||||||
color = new Color(hud.red.getIntValue(), hud.green.getIntValue(), hud.blue.getIntValue(), hud.alpha.getIntValue());
|
|
||||||
}
|
|
||||||
boolean shadow = hud.shadow.isEnabled();
|
|
||||||
|
|
||||||
if (hud.isEnabled()) {
|
|
||||||
|
|
||||||
// coordenadas
|
|
||||||
if (hud.coords.isEnabled()) {
|
|
||||||
Vec3d coords;
|
|
||||||
Freecam freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
|
||||||
if (freecam.isEnabled())
|
|
||||||
coords = new Vec3d(
|
|
||||||
freecam.getX(tc.getDynamicDeltaTicks()),
|
|
||||||
freecam.getY(tc.getDynamicDeltaTicks()),
|
|
||||||
freecam.getZ(tc.getDynamicDeltaTicks())
|
|
||||||
);
|
|
||||||
else
|
|
||||||
coords = mc.player.getPos();
|
|
||||||
|
|
||||||
String text = (int) coords.x + " " + (int) coords.y + " " + (int) coords.z;
|
|
||||||
ctx.drawText(mc.textRenderer, text,
|
|
||||||
width - mc.textRenderer.getWidth(text) - 2,
|
|
||||||
height - mc.textRenderer.fontHeight - 2,
|
|
||||||
color.getRGB(), shadow);
|
|
||||||
}
|
|
||||||
|
|
||||||
// fps y tps
|
|
||||||
if (hud.fps.isEnabled())
|
|
||||||
ctx.drawText(mc.textRenderer, "FPS: " + mc.getCurrentFps(), 2, 2, color.getRGB(), shadow);
|
|
||||||
|
|
||||||
if (hud.tps.isEnabled())
|
|
||||||
ctx.drawText(mc.textRenderer, "TPS: " + estimatedTPS, 2, 4 + mc.textRenderer.fontHeight, color.getRGB(), shadow);
|
|
||||||
|
|
||||||
// marca de agua
|
|
||||||
if (!hud.customText.getValue().isEmpty()) {
|
|
||||||
int y;
|
|
||||||
if (!mc.player.getActiveStatusEffects().isEmpty() && hud.dontOverride.isEnabled()) y = 26;
|
|
||||||
else y = 2;
|
|
||||||
ctx.drawText(mc.textRenderer, hud.customText.getValue(), width - mc.textRenderer.getWidth(hud.customText.getValue()) - 2, y, color.getRGB(), shadow);
|
|
||||||
}
|
|
||||||
|
|
||||||
// hora real
|
|
||||||
if (hud.time.isEnabled()) {
|
|
||||||
int y;
|
|
||||||
if (mc.currentScreen instanceof ChatScreen && hud.dontOverride.isEnabled()) y = height - mc.textRenderer.fontHeight - 14;
|
|
||||||
else y = height - mc.textRenderer.fontHeight - 2;
|
|
||||||
|
|
||||||
ZoneOffset offset = ZoneOffset.ofHours(hud.timezone.getIntValue());
|
|
||||||
LocalTime now = LocalTime.now(offset);
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(hud.timeFormat.is(TimeFormat.TWENTY_FOUR_HOUR) ? "HH:mm" : "hh:mm a");
|
|
||||||
String time = now.format(formatter);
|
|
||||||
|
|
||||||
ctx.drawText(mc.textRenderer, time, 2, y, color.getRGB(), shadow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onReceivePacket(PacketEvent.Receive event) {
|
|
||||||
// estimar el tps teniendo en cuenta el tiempo entre paquetes
|
|
||||||
long now = System.currentTimeMillis();
|
|
||||||
if (lastPacketTime > 0) {
|
|
||||||
long diff = now - lastPacketTime; // ms entre paquetes
|
|
||||||
float tps = 1000f / diff;
|
|
||||||
estimatedTPS = Math.min(20.0f, tps);
|
|
||||||
}
|
|
||||||
lastPacketTime = now;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,202 @@
|
|||||||
|
package me.retucio.camtweaks.ui;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.config.ConfigManager;
|
||||||
|
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.PacketEvent;
|
||||||
|
import me.retucio.camtweaks.event.events.camtweaks.UpdateSettingEvent;
|
||||||
|
import me.retucio.camtweaks.module.ModuleManager;
|
||||||
|
import me.retucio.camtweaks.module.modules.Freecam;
|
||||||
|
import me.retucio.camtweaks.module.modules.HUD;
|
||||||
|
import me.retucio.camtweaks.ui.screen.HudEditorScreen;
|
||||||
|
import me.retucio.camtweaks.ui.widgets.HudElement;
|
||||||
|
|
||||||
|
import me.retucio.camtweaks.util.Colors;
|
||||||
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
import net.minecraft.client.gui.DrawContext;
|
||||||
|
import net.minecraft.client.gui.screen.ChatScreen;
|
||||||
|
import net.minecraft.client.gui.screen.TitleScreen;
|
||||||
|
import net.minecraft.client.render.RenderTickCounter;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
public class HudRenderer {
|
||||||
|
|
||||||
|
private static final MinecraftClient mc = MinecraftClient.getInstance();
|
||||||
|
|
||||||
|
private static float estimatedTPS = 20f;
|
||||||
|
private long lastPacketTime = 0;
|
||||||
|
|
||||||
|
private static final Map<String, int[]> positions = ConfigManager.getConfig().hudPositions;
|
||||||
|
private static final Map<String, Boolean> visibilities = ConfigManager.getConfig().hudVisibilities;
|
||||||
|
private static final List<HudElement> elements = new ArrayList<>();
|
||||||
|
private static boolean initialized = false;
|
||||||
|
|
||||||
|
private static HudElement customTextElement = null;
|
||||||
|
|
||||||
|
public static void initElements() {
|
||||||
|
if (initialized) return;
|
||||||
|
initialized = true;
|
||||||
|
|
||||||
|
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
|
||||||
|
|
||||||
|
// coordenadas
|
||||||
|
addElement("coords", 2, mc.getWindow().getScaledHeight() - mc.textRenderer.fontHeight, (ctx, mx, my, delta) -> {
|
||||||
|
drawSnappedText(ctx, getElementText("coords", delta, hud), mx, my, getColor(hud).getRGB(), hud.shadow.isEnabled());
|
||||||
|
});
|
||||||
|
|
||||||
|
// FPS
|
||||||
|
addElement("fps", 2, 2, (ctx, mx, my, delta) -> {
|
||||||
|
drawSnappedText(ctx, getElementText("fps", 0, hud), mx, my, getColor(hud).getRGB(), hud.shadow.isEnabled());
|
||||||
|
});
|
||||||
|
|
||||||
|
// TPS
|
||||||
|
addElement("tps", 2, mc.textRenderer.fontHeight + 4, (ctx, mx, my, delta) -> {
|
||||||
|
drawSnappedText(ctx, getElementText("tps", delta, hud), mx, my, getColor(hud).getRGB(), hud.shadow.isEnabled());
|
||||||
|
});
|
||||||
|
|
||||||
|
// texto custom
|
||||||
|
addElement("customText", mc.getWindow().getScaledWidth() / 2 - mc.textRenderer.getWidth(getElementText("customText", 0, ModuleManager.INSTANCE.getModuleByClass(HUD.class))) / 2, 2, (ctx, mx, my, delta) -> {
|
||||||
|
drawSnappedText(ctx, getElementText("customText", delta, hud), mx, my, getColor(hud).getRGB(), hud.shadow.isEnabled());
|
||||||
|
});
|
||||||
|
|
||||||
|
customTextElement = elements.stream()
|
||||||
|
.filter(e -> e.getId().equals("customText"))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
|
// hora
|
||||||
|
addElement("time", mc.getWindow().getScaledWidth() - mc.textRenderer.getWidth("04:20"), mc.getWindow().getScaledHeight() - mc.textRenderer.fontHeight - 2, (ctx, mx, my, delta) -> {
|
||||||
|
drawSnappedText(ctx, getElementText("time", delta, hud), mx, my, getColor(hud).getRGB(), hud.shadow.isEnabled());
|
||||||
|
});
|
||||||
|
|
||||||
|
HudEditorScreen.INSTANCE.setElements(getElements());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addElement(String id, int defX, int defY, HudElement.Renderer renderer) {
|
||||||
|
int[] saved = positions.get(id);
|
||||||
|
Boolean visible = visibilities.get(id);
|
||||||
|
int x = saved == null ? defX : saved[0];
|
||||||
|
int y = saved == null ? defY : saved[1];
|
||||||
|
boolean v = visible == null || visible;
|
||||||
|
if (visibilities.isEmpty()) v = true;
|
||||||
|
|
||||||
|
elements.add(new HudElement(id, defX, defY, x, y, v) {
|
||||||
|
@Override public void render(DrawContext ctx, int mx, int my, float delta) {
|
||||||
|
renderer.render(ctx, x, y, delta);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Color getColor(HUD hud) {
|
||||||
|
if (hud.rainbow.isEnabled())
|
||||||
|
return Colors.rainbowColor(hud.rainbowSpeed.getIntValue(), hud.alpha.getIntValue());
|
||||||
|
|
||||||
|
return new Color(hud.red.getIntValue(), hud.green.getIntValue(), hud.blue.getIntValue(), hud.alpha.getIntValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void drawSnappedText(DrawContext ctx, String text, int x, int y, int color, boolean shadow) {
|
||||||
|
int textWidth = mc.textRenderer.getWidth(text);
|
||||||
|
int screenWidth = mc.getWindow().getScaledWidth();
|
||||||
|
int screenHeight = mc.getWindow().getScaledHeight();
|
||||||
|
|
||||||
|
boolean snapRight = x > screenWidth / 2;
|
||||||
|
int drawX = snapRight ? x + (textWidth + 2) - textWidth : x;
|
||||||
|
|
||||||
|
// clampear y
|
||||||
|
y = Math.max(0, Math.min(y, screenHeight - mc.textRenderer.fontHeight));
|
||||||
|
|
||||||
|
// clampear x
|
||||||
|
drawX = Math.max(0, Math.min(drawX, screenWidth - textWidth));
|
||||||
|
|
||||||
|
ctx.drawText(mc.textRenderer, text, drawX, y, color, shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void render(DrawContext ctx, RenderTickCounter tc) {
|
||||||
|
if (ModuleManager.INSTANCE == null
|
||||||
|
|| mc.player == null
|
||||||
|
|| mc.getCameraEntity() == null
|
||||||
|
|| mc.currentScreen instanceof TitleScreen
|
||||||
|
|| mc.options.hudHidden)
|
||||||
|
return;
|
||||||
|
|
||||||
|
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
|
||||||
|
if (!hud.isEnabled()) return;
|
||||||
|
if (mc.debugHudEntryList.isF3Enabled() && !hud.showOnF3.isEnabled()) return;
|
||||||
|
if (mc.currentScreen instanceof ChatScreen && !hud.showOnChat.isEnabled()) return;
|
||||||
|
|
||||||
|
initElements();
|
||||||
|
|
||||||
|
if (mc.currentScreen instanceof HudEditorScreen) return;
|
||||||
|
|
||||||
|
float deltaTime = tc.getDynamicDeltaTicks();
|
||||||
|
for (HudElement element : elements)
|
||||||
|
if (element.isVisible()) element.render(ctx, 0, 0, deltaTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<HudElement> getElements() {
|
||||||
|
return elements;
|
||||||
|
}
|
||||||
|
|
||||||
|
// texto a dibujar por elemento
|
||||||
|
public static String getElementText(String id, float delta, HUD hud) {
|
||||||
|
switch (id) {
|
||||||
|
case "coords" -> {
|
||||||
|
Freecam freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
||||||
|
Vec3d pos = freecam.isEnabled()
|
||||||
|
? new Vec3d(freecam.getX(delta), freecam.getY(delta), freecam.getZ(delta))
|
||||||
|
: mc.player.getEntityPos();
|
||||||
|
|
||||||
|
return (int) pos.x + " " + (int) pos.y + " " + (int) pos.z;
|
||||||
|
}
|
||||||
|
case "fps" -> {
|
||||||
|
return "FPS: " + mc.getCurrentFps();
|
||||||
|
}
|
||||||
|
case "tps" -> {
|
||||||
|
return "TPS: " + estimatedTPS;
|
||||||
|
}
|
||||||
|
case "customText" -> {
|
||||||
|
return ModuleManager.INSTANCE.getModuleByClass(HUD.class).customText.getValue();
|
||||||
|
}
|
||||||
|
case "time" -> {
|
||||||
|
ZoneOffset offset = ZoneOffset.ofHours(hud.timezone.getIntValue());
|
||||||
|
LocalTime now = LocalTime.now(offset);
|
||||||
|
|
||||||
|
boolean is24 = hud.timeFormat.is(HUD.TimeFormat.TWENTY_FOUR_HOUR);
|
||||||
|
DateTimeFormatter format = DateTimeFormatter.ofPattern(is24 ? "HH:mm" : "hh:mm a");
|
||||||
|
return now.format(format);
|
||||||
|
}
|
||||||
|
default -> { return id; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onReceivePacket(PacketEvent.Receive event) {
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
if (lastPacketTime > 0) {
|
||||||
|
float tps = 1000f / (now - lastPacketTime);
|
||||||
|
estimatedTPS = Math.min(20f, tps);
|
||||||
|
}
|
||||||
|
lastPacketTime = now;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** para cuando se cambie el valor del texto custom */
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onUpdateSetting(UpdateSettingEvent event) {
|
||||||
|
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
|
||||||
|
|
||||||
|
if (event.getSetting() == hud.customText) {
|
||||||
|
if (customTextElement != null) {
|
||||||
|
int newX = mc.getWindow().getScaledWidth() / 2 - mc.textRenderer.getWidth(hud.customText.getValue()) / 2;
|
||||||
|
customTextElement.setX(newX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,20 @@
|
|||||||
package me.retucio.camtweaks.ui.buttons;
|
package me.retucio.camtweaks.ui.buttons;
|
||||||
|
|
||||||
import me.retucio.camtweaks.module.settings.KeySetting;
|
import me.retucio.camtweaks.module.settings.KeySetting;
|
||||||
import me.retucio.camtweaks.ui.ClickGUI;
|
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||||
|
import me.retucio.camtweaks.ui.frames.ClientSettingsFrame;
|
||||||
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
||||||
|
import me.retucio.camtweaks.util.ChatUtil;
|
||||||
import me.retucio.camtweaks.util.Colors;
|
import me.retucio.camtweaks.util.Colors;
|
||||||
import me.retucio.camtweaks.util.KeyUtil;
|
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.input.KeyInput;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.client.option.KeyBinding;
|
||||||
|
import net.minecraft.client.resource.language.I18n;
|
||||||
|
import net.minecraft.util.Formatting;
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
// botón para configurar la tecla asignada a un módulo. comienza a escuchar al hacerle clic
|
// botón para configurar la tecla asignada a un módulo. comienza a escuchar al hacerle clic
|
||||||
public class BindButton extends SettingButton {
|
public class BindButton extends SettingButton {
|
||||||
|
|
||||||
@@ -36,7 +41,7 @@ public class BindButton extends SettingButton {
|
|||||||
public void mouseClicked(double mouseX, double mouseY, int button) {
|
public void mouseClicked(double mouseX, double mouseY, int button) {
|
||||||
if (isHovered((int) mouseX, (int) mouseY) && ClickGUI.INSTANCE.trySelect(this)) {
|
if (isHovered((int) mouseX, (int) mouseY) && ClickGUI.INSTANCE.trySelect(this)) {
|
||||||
if (button == 0) listening = !listening;
|
if (button == 0) listening = !listening;
|
||||||
else if (button == 1 && KeyUtil.isKeyDown(GLFW.GLFW_KEY_LEFT_SHIFT))
|
else if (button == 1 && mc.isShiftPressed())
|
||||||
setting.reset();
|
setting.reset();
|
||||||
} else {
|
} else {
|
||||||
listening = false;
|
listening = false;
|
||||||
@@ -44,15 +49,29 @@ public class BindButton extends SettingButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onKey(int key, int action) {
|
public void onKey(int key, int action) {
|
||||||
if (listening && action == GLFW.GLFW_PRESS) {
|
if (!listening || action != GLFW.GLFW_PRESS) return;
|
||||||
if (key == GLFW.GLFW_KEY_ESCAPE)
|
|
||||||
setting.setKey(GLFW.GLFW_KEY_UNKNOWN);
|
if (key == GLFW.GLFW_KEY_ESCAPE) {
|
||||||
else
|
setting.setKey(GLFW.GLFW_KEY_UNKNOWN);
|
||||||
setting.setKey(key);
|
} else {
|
||||||
listening = false;
|
for (KeyBinding bind : mc.options.allKeys) {
|
||||||
|
boolean keyAlreadyBound = bind.matchesKey(new KeyInput(key, 0, 0));
|
||||||
|
boolean allowMultiple = ClientSettingsFrame.guiSettings.multipleKeybinds.isEnabled();
|
||||||
|
|
||||||
|
if (keyAlreadyBound && !allowMultiple) {
|
||||||
|
ChatUtil.warn("esa tecla ya está cogida por "
|
||||||
|
+ Formatting.GREEN + "\"" + I18n.translate(bind.getId()) + "\"");
|
||||||
|
listening = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setting.setKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listening = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isFocused() {
|
public boolean isFocused() {
|
||||||
return listening;
|
return listening;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.camtweaks.ui.buttons;
|
package me.retucio.camtweaks.ui.buttons;
|
||||||
|
|
||||||
import me.retucio.camtweaks.module.settings.EnumSetting;
|
import me.retucio.camtweaks.module.settings.EnumSetting;
|
||||||
import me.retucio.camtweaks.ui.ClickGUI;
|
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||||
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
||||||
import me.retucio.camtweaks.util.Colors;
|
import me.retucio.camtweaks.util.Colors;
|
||||||
import me.retucio.camtweaks.util.KeyUtil;
|
import me.retucio.camtweaks.util.KeyUtil;
|
||||||
@@ -14,6 +14,8 @@ import org.lwjgl.glfw.GLFW;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
// botón para los ajustes tipo EnumSetting (de modo)
|
// botón para los ajustes tipo EnumSetting (de modo)
|
||||||
public class CycleButton<E extends Enum<E>> extends SettingButton {
|
public class CycleButton<E extends Enum<E>> extends SettingButton {
|
||||||
|
|
||||||
@@ -42,7 +44,7 @@ public class CycleButton<E extends Enum<E>> extends SettingButton {
|
|||||||
if (isHovered((int) mouseX, (int) mouseY)) {
|
if (isHovered((int) mouseX, (int) mouseY)) {
|
||||||
Screen currentScreen = parent.mc.currentScreen;
|
Screen currentScreen = parent.mc.currentScreen;
|
||||||
if (currentScreen != null) {
|
if (currentScreen != null) {
|
||||||
if (KeyUtil.isKeyDown(GLFW.GLFW_KEY_LEFT_SHIFT)) {
|
if (mc.isShiftPressed()) {
|
||||||
List<Text> lines = new ArrayList<>();
|
List<Text> lines = new ArrayList<>();
|
||||||
lines.add(Text.literal("modos disponibles:"));
|
lines.add(Text.literal("modos disponibles:"));
|
||||||
for (Enum<?> val : setting.getValues()) {
|
for (Enum<?> val : setting.getValues()) {
|
||||||
|
|||||||
@@ -3,16 +3,16 @@ package me.retucio.camtweaks.ui.buttons;
|
|||||||
import me.retucio.camtweaks.module.Module;
|
import me.retucio.camtweaks.module.Module;
|
||||||
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||||
import me.retucio.camtweaks.module.settings.ListSetting;
|
import me.retucio.camtweaks.module.settings.ListSetting;
|
||||||
import me.retucio.camtweaks.ui.ClickGUI;
|
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||||
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
||||||
import me.retucio.camtweaks.util.Colors;
|
import me.retucio.camtweaks.util.Colors;
|
||||||
import me.retucio.camtweaks.util.KeyUtil;
|
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import org.lwjgl.glfw.GLFW;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||||
|
|
||||||
public class ListButton<T> extends SettingButton {
|
public class ListButton<T> extends SettingButton {
|
||||||
|
|
||||||
private final ListSetting<T> setting;
|
private final ListSetting<T> setting;
|
||||||
@@ -58,14 +58,14 @@ public class ListButton<T> extends SettingButton {
|
|||||||
@Override
|
@Override
|
||||||
public void drawTooltip(DrawContext ctx, double mouseX, double mouseY) {
|
public void drawTooltip(DrawContext ctx, double mouseX, double mouseY) {
|
||||||
if (isHovered(mouseX, mouseY))
|
if (isHovered(mouseX, mouseY))
|
||||||
ctx.drawTooltip(Text.of(setting.getDescription() + "( " + countEnabled() + " de " + setting.getOptions().size() + ")"), (int) mouseX, (int) mouseY);
|
ctx.drawTooltip(Text.of(setting.getDescription() + " (" + countEnabled() + " de " + setting.getOptions().size() + ")"), (int) mouseX, (int) mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mouseClicked(double mouseX, double mouseY, int button) {
|
public void mouseClicked(double mouseX, double mouseY, int button) {
|
||||||
if (isHovered(mouseX, mouseY) && ClickGUI.INSTANCE.trySelect(this)) {
|
if (isHovered(mouseX, mouseY) && ClickGUI.INSTANCE.trySelect(this)) {
|
||||||
// click izquierdo / derecho: abrir marco
|
// click izquierdo / derecho: abrir marco
|
||||||
if (button <= 1 && !KeyUtil.isKeyDown(GLFW.GLFW_KEY_LEFT_SHIFT)) {
|
if (button <= 1 && !mc.isShiftPressed()) {
|
||||||
if (ClickGUI.INSTANCE.isSettingsFrameOpen(dummy)) {
|
if (ClickGUI.INSTANCE.isSettingsFrameOpen(dummy)) {
|
||||||
ClickGUI.INSTANCE.closeSettingsFrame(dummy);
|
ClickGUI.INSTANCE.closeSettingsFrame(dummy);
|
||||||
return;
|
return;
|
||||||
@@ -74,7 +74,7 @@ public class ListButton<T> extends SettingButton {
|
|||||||
rebuildDummy();
|
rebuildDummy();
|
||||||
ClickGUI.INSTANCE.openListSettingsFrame(dummy, parent.x + 40, parent.y + 40);
|
ClickGUI.INSTANCE.openListSettingsFrame(dummy, parent.x + 40, parent.y + 40);
|
||||||
// shift + clic derecho: restablecer valores
|
// shift + clic derecho: restablecer valores
|
||||||
} else if (button == 1 && KeyUtil.isKeyDown(GLFW.GLFW_KEY_LEFT_SHIFT)) {
|
} else if (button == 1 && mc.isShiftPressed()) {
|
||||||
setting.reset();
|
setting.reset();
|
||||||
refreshDummy();
|
refreshDummy();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
package me.retucio.camtweaks.ui.buttons;
|
package me.retucio.camtweaks.ui.buttons;
|
||||||
|
|
||||||
import me.retucio.camtweaks.module.Module;
|
import me.retucio.camtweaks.module.Module;
|
||||||
import me.retucio.camtweaks.ui.ClickGUI;
|
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||||
import me.retucio.camtweaks.ui.frames.ModuleFrame;
|
import me.retucio.camtweaks.ui.frames.ModuleFrame;
|
||||||
import me.retucio.camtweaks.util.Colors;
|
import me.retucio.camtweaks.util.Colors;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
// clase para el botón para cada módulo
|
// clase para el botón para cada módulo
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package me.retucio.camtweaks.ui.buttons;
|
package me.retucio.camtweaks.ui.buttons;
|
||||||
|
|
||||||
import me.retucio.camtweaks.module.settings.AbstractSetting;
|
import me.retucio.camtweaks.module.settings.AbstractSetting;
|
||||||
import me.retucio.camtweaks.ui.ClickGUI;
|
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||||
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
// clase base para los botones de los ajustes
|
// clase base para los botones de los ajustes
|
||||||
|
|||||||
Loaded 100 of 165 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user