Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2329476fe4 | ||
|
|
6b2ec0e69a | ||
|
|
6fa409d60a |
No files matched your search
@@ -42,9 +42,5 @@ replay_*.log
|
||||
# otros
|
||||
|
||||
todo.txt
|
||||
test.java
|
||||
cambios.md
|
||||
# no está terminado
|
||||
src/main/java/me/retucio/camtweaks/module/modules/TooltipsPlus.java
|
||||
|
||||
remappedSrc/
|
||||
@@ -65,4 +65,22 @@ no sé, haz lo que quieras con esto, es puta basura xd
|
||||
|
||||
aunque estaría guay que acreditases
|
||||
|
||||
pero bueno
|
||||
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"
|
||||
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}"
|
||||
|
||||
}
|
||||
|
||||
+17
-7
@@ -1,19 +1,29 @@
|
||||
# v1.5
|
||||
# v1.7
|
||||
|
||||
## novedades
|
||||
|
||||
sigo vivo (creo)
|
||||
|
||||
### adiciones
|
||||
|
||||
- editor de hud bastante básico pero por lo general funcional (`pág. arriba` por defecto). viene con muchos bugs, ojalá me caiga un rayo.
|
||||
- comando `$echest` (o `$ec` si eres un puto vago) para previsualizar los contenidos del enderchest en cualquier momento
|
||||
- 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ó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
|
||||
|
||||
- ya no salta un error al hacer una captura con los módulos `capturas de pantalla` y `chat plus` activos
|
||||
- ahora la telemetría (abuso de privacidad al usuario de microshit) está desactivado por huevos. si quieres activarlo te jodes.
|
||||
- ahora ya no puedes abrir interfaces del mod si no estás en un mundo
|
||||
- mejorada la seguridad de algunas operaciones
|
||||
- ahora puedes volver a abrir el clickgui y el editor de hud en la pantalla de inicio
|
||||
- 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 se pueden previsualizar enderchests igual que shulkers, desde el inventario (prev. de shulkers)
|
||||
- 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)
|
||||
- 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
|
||||
- arreglado el problema donde se muestra la marca de agua por defecto en la pantalla de inicio si no se abre un mundo primero
|
||||
|
||||
## problemas reconocidos
|
||||
|
||||
|
||||
+11
-5
@@ -1,5 +1,11 @@
|
||||
meteor client dev team
|
||||
oyvey client (1.21 port by mioclient)
|
||||
lennyboi (youtube)
|
||||
packbar by cattyn on github
|
||||
shotify mod
|
||||
Meteor Client: https://github.com/MeteorDevelopment/meteor-client | https://meteorclient.com
|
||||
OyVey Port: https://github.com/mioclient/oyvey-ported/
|
||||
Lenny Boi: https://www.youtube.com/@lennyboi7195
|
||||
Shotify: https://modrinth.com/mod/shotify
|
||||
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 :)
|
||||
+1
-6
@@ -1,18 +1,13 @@
|
||||
# Done to increase the memory available to gradle.
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
org.gradle.parallel=true
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=1.21.10
|
||||
yarn_mappings=1.21.10+build.2
|
||||
loader_version=0.17.3
|
||||
loom_version=1.11-SNAPSHOT
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.5
|
||||
mod_version=1.8
|
||||
maven_group=me.retucio
|
||||
archives_base_name=camtweaks
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.135.0+1.21.10
|
||||
@@ -17,8 +17,8 @@ import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
|
||||
import me.retucio.camtweaks.module.modules.HUD;
|
||||
import me.retucio.camtweaks.ui.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.HudEditorScreen;
|
||||
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.SettingButton;
|
||||
@@ -34,10 +34,11 @@ import me.retucio.camtweaks.util.MiscUtil;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
|
||||
import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -48,21 +49,35 @@ import org.lwjgl.glfw.GLFW;
|
||||
public class CameraTweaks implements ClientModInitializer {
|
||||
|
||||
// cosas necesarias
|
||||
public static final String MOD_ID = "camtweaks";
|
||||
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 Logger LOGGER = LogManager.getLogger(CameraTweaks.class);
|
||||
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;
|
||||
public boolean settingsApplied = false;
|
||||
|
||||
|
||||
@Override
|
||||
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
|
||||
System.setProperty("java.awt.headless", "false");
|
||||
|
||||
mc = MinecraftClient.getInstance();
|
||||
ConfigManager.load();
|
||||
|
||||
EVENT_BUS.register(this);
|
||||
EVENT_BUS.register(MiscUtil.class);
|
||||
@@ -81,8 +96,6 @@ public class CameraTweaks implements ClientModInitializer {
|
||||
HudEditorScreen.INSTANCE = new HudEditorScreen();
|
||||
EVENT_BUS.post(new LoadClickGUIEvent());
|
||||
|
||||
ConfigManager.load();
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
ConfigManager.save();
|
||||
EVENT_BUS.post(new ShutdownEvent());
|
||||
@@ -91,14 +104,14 @@ public class CameraTweaks implements ClientModInitializer {
|
||||
|
||||
// se ejecuta cada tick, es decir, 20 veces por segundo
|
||||
public void onTick() {
|
||||
ModuleManager.INSTANCE.getEnabledModules().forEach(Module::onTick);
|
||||
|
||||
if (!settingsApplied
|
||||
&& ConfigManager.getConfig() != null
|
||||
&& mc.player != null && mc.world != null) {
|
||||
&& !ConfigManager.hasLoaded()) {
|
||||
ConfigManager.applyConfig();
|
||||
settingsApplied = true;
|
||||
}
|
||||
|
||||
ModuleManager.INSTANCE.getEnabledModules().forEach(Module::onTick);
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +172,6 @@ public class CameraTweaks implements ClientModInitializer {
|
||||
// maneja la lógica de apertura de la interfaz
|
||||
private void handleClickGUIKey(int key, boolean anyFocused) {
|
||||
if (key != ClientSettingsFrame.guiSettings.getKey() || anyFocused) return;
|
||||
if (!(mc != null && mc.world != null && mc.player != null)) return;
|
||||
|
||||
// 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
|
||||
@@ -175,7 +187,6 @@ 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 != null && mc.world != null && mc.player != null)) return;
|
||||
|
||||
if (mc.currentScreen != HudEditorScreen.INSTANCE) {
|
||||
prevScreen = mc.currentScreen;
|
||||
@@ -199,4 +210,8 @@ public class CameraTweaks implements ClientModInitializer {
|
||||
public void onStop(ShutdownEvent event) {
|
||||
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.exceptions.CommandSyntaxException;
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
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.command.CommandSource;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Comparator;
|
||||
@@ -30,7 +34,8 @@ public class CommandManager {
|
||||
public static void registerCommands() {
|
||||
addCommand(new BindCommand());
|
||||
addCommand(new CopyScreenshotCommand());
|
||||
// addCommand(new EnderChestCommand()); no funciona D:
|
||||
addCommand(new EnderChestCommand());
|
||||
addCommand(new GarbageCleanerCommand());
|
||||
addCommand(new PeekCommand());
|
||||
addCommand(new PrefixCommand());
|
||||
addCommand(new PurgeCommand());
|
||||
@@ -39,6 +44,15 @@ public class CommandManager {
|
||||
addCommand(new ToggleCommand());
|
||||
|
||||
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) {
|
||||
|
||||
@@ -1,37 +1,59 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
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.command.CommandSource;
|
||||
import net.minecraft.inventory.EnderChestInventory;
|
||||
import net.minecraft.inventory.Inventories;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.inventory.SimpleInventory;
|
||||
import net.minecraft.network.packet.s2c.play.CloseScreenS2CPacket;
|
||||
import net.minecraft.screen.GenericContainerScreenHandler;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
|
||||
// accede a los contenidos de tu enderchest
|
||||
public class EnderChestCommand extends Command {
|
||||
|
||||
private boolean shouldOpenEchest = false;
|
||||
|
||||
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
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||
builder.executes(ctx -> {
|
||||
mc.execute(() -> { // para evitar llamar setScreen desde el hilo equivocado, que causa crashes
|
||||
EnderChestInventory enderChestInv = mc.player.getEnderChestInventory();
|
||||
mc.execute(() -> {
|
||||
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
|
||||
mc.setScreen(new GenericContainerScreen(
|
||||
GenericContainerScreenHandler.createGeneric9x3(mc.player.currentScreenHandler.syncId + 1, mc.player.getInventory(), enderChestInv),
|
||||
mc.player.getInventory(),
|
||||
Text.translatable("container.enderchest")
|
||||
));
|
||||
shouldOpenEchest = true;
|
||||
});
|
||||
|
||||
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.events.camtweaks.*;
|
||||
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.Map;
|
||||
|
||||
@@ -6,7 +6,7 @@ import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
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.SettingsFrame;
|
||||
|
||||
@@ -23,6 +23,7 @@ public class ConfigManager {
|
||||
|
||||
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
||||
private static final File CONFIG_FILE = new File("camera_tweaks.json");
|
||||
private static boolean loaded = false;
|
||||
|
||||
private static ClientConfig config = null;
|
||||
|
||||
@@ -93,6 +94,8 @@ public class ConfigManager {
|
||||
|
||||
CameraTweaks.LOGGER.info("posiciones de frames cargadas");
|
||||
ClickGUI.INSTANCE.refreshListButtons();
|
||||
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
public static ClientConfig getConfig() {
|
||||
@@ -166,4 +169,8 @@ public class ConfigManager {
|
||||
private static void ensureConfig() {
|
||||
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)))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,14 @@
|
||||
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.modules.Freecam;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
@@ -12,16 +19,24 @@ import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
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.CallbackInfo;
|
||||
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)
|
||||
public abstract class ClientPlayerInteractionManagerMixin {
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private MinecraftClient client;
|
||||
@Unique
|
||||
Freecam freecam;
|
||||
|
||||
@@ -30,19 +45,31 @@ public abstract class ClientPlayerInteractionManagerMixin {
|
||||
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)
|
||||
private void cancelBlockBreaking(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (freecam.isEnabled() && freecam.cancelActionPackets.isEnabled()) cir.setReturnValue(false);
|
||||
private void onBlockBreak(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
||||
BreakBlockEvent event = EVENT_BUS.post(new BreakBlockEvent(pos));
|
||||
if (event.isCancelled()) cir.cancel();
|
||||
}
|
||||
|
||||
@Inject(method = "interactBlock", at = @At("HEAD"), cancellable = true)
|
||||
private void cancelBlockPlacement(ClientPlayerEntity player, Hand hand, BlockHitResult hitResult, CallbackInfoReturnable<ActionResult> cir) {
|
||||
if (freecam.isEnabled() && freecam.cancelActionPackets.isEnabled()) cir.setReturnValue(ActionResult.FAIL);
|
||||
private void onBlockPlace(ClientPlayerEntity player, Hand hand, BlockHitResult result, CallbackInfoReturnable<ActionResult> cir) {
|
||||
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)
|
||||
private void cancelEntityInteractions(PlayerEntity player, Entity entity, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
||||
if (freecam.isEnabled() && freecam.cancelActionPackets.isEnabled()) cir.setReturnValue(ActionResult.FAIL);
|
||||
private void onEntityInteract(PlayerEntity player, Entity entity, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -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,7 @@ package me.retucio.camtweaks.mixin;
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
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.ParticleTextureSheet;
|
||||
@@ -32,9 +33,7 @@ abstract class DamageParticleFactoryMixin {
|
||||
if (!crits.isEnabled()) return original;
|
||||
|
||||
if (crits.rainbow.isEnabled()) {
|
||||
float speed = 10001 - crits.rainbowSpeed.getFloatValue();
|
||||
float hue = (System.currentTimeMillis() % (int) speed) / speed;
|
||||
Color gamning = Color.getHSBColor(hue, 1, 1);
|
||||
Color gamning = Colors.rainbowColor(crits.rainbowSpeed.getIntValue(), crits.alpha.getIntValue());
|
||||
original.setColor(
|
||||
gamning.getRed() / 255f,
|
||||
gamning.getGreen() / 255f,
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import me.retucio.camtweaks.event.events.ChangeRotationEvent;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.AntiInvis;
|
||||
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.module.modules.*;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.passive.TameableEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -21,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.CallbackInfoReturnable;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
@@ -32,6 +31,12 @@ public abstract class EntityMixin {
|
||||
@Shadow
|
||||
public abstract EntityType<?> getType();
|
||||
|
||||
@Shadow
|
||||
private float yaw;
|
||||
|
||||
@Shadow
|
||||
private float pitch;
|
||||
|
||||
@Unique
|
||||
Freecam freecam;
|
||||
|
||||
@@ -41,12 +46,16 @@ public abstract class EntityMixin {
|
||||
@Unique
|
||||
Nametags nametags;
|
||||
|
||||
@Unique
|
||||
Rotations rotations;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void getModules(EntityType type, World world, CallbackInfo ci) {
|
||||
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
||||
freelook = ModuleManager.INSTANCE.getModuleByClass(Freelook.class);
|
||||
nametags = ModuleManager.INSTANCE.getModuleByClass(Nametags.class);
|
||||
rotations = ModuleManager.INSTANCE.getModuleByClass(Rotations.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,10 +71,10 @@ public abstract class EntityMixin {
|
||||
ci.cancel();
|
||||
|
||||
} else if (freelook.isEnabled() && freelook.mode.is(Freelook.CameraMode.CAMERA)) {
|
||||
freelook.setYaw(freelook.getYaw() + (float) (cursorDeltaX / freelook.mouseSens.getFloatValue()));
|
||||
freelook.setPitch(freelook.getPitch() + (float) (cursorDeltaY / freelook.mouseSens.getFloatValue()));
|
||||
freelook.setYaw(freelook.getYaw() + (float) (cursorDeltaX * 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();
|
||||
}
|
||||
}
|
||||
@@ -115,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
|
||||
|
||||
@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())
|
||||
|| (className.equals("DarknessEffectFogModifier") && !noRender.darknessEffect.isEnabled())
|
||||
|| ((className.equals("LavaFogModifier") || className.equals("WaterFogModifier")
|
||||
|| className.equals("PowederSnowFogModifier")) && !noRender.fluidOverlay.isEnabled())
|
||||
|| (className.equals("DimensionOrBossFogModifier") && !noRender.dimensionFog.isEnabled()))
|
||||
|| className.equals("PowederSnowFogModifier")) && !noRender.fluidOverlay.isEnabled()))
|
||||
return false;
|
||||
|
||||
return instance.shouldApply(cameraSubmersionType, entity);
|
||||
|
||||
@@ -1,20 +1,27 @@
|
||||
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.module.ModuleManager;
|
||||
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.Zoom;
|
||||
import me.retucio.camtweaks.util.interfaces.IVec3d;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.BufferBuilderStorage;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.client.render.block.BlockRenderManager;
|
||||
import net.minecraft.client.render.item.HeldItemRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
import net.minecraft.util.hit.EntityHitResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import org.joml.Matrix4f;
|
||||
import org.joml.Vector3d;
|
||||
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -23,9 +30,11 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||
|
||||
|
||||
@Mixin(GameRenderer.class)
|
||||
public abstract class GameRendererMixin {
|
||||
|
||||
@@ -114,4 +123,15 @@ public abstract class GameRendererMixin {
|
||||
private float noRenderNauseaDistortion(float 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];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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,6 +2,7 @@ package me.retucio.camtweaks.mixin;
|
||||
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.event.events.KeyEvent;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import net.minecraft.client.Keyboard;
|
||||
import net.minecraft.client.input.KeyInput;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -16,8 +17,8 @@ public abstract class KeyboardMixin {
|
||||
|
||||
@Inject(method = "onKey", at = @At("HEAD"), cancellable = true)
|
||||
private void onKeyPress(long window, int action, KeyInput input, CallbackInfo ci) {
|
||||
if (input.key() == -1) return;
|
||||
CameraTweaks.INSTANCE.onKeyPress(input.key(), action);
|
||||
|
||||
KeyEvent event = EVENT_BUS.post(new KeyEvent(input.key(), input.scancode(), action));
|
||||
if (event.isCancelled()) ci.cancel();
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.textures.GpuTexture;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.Fullbright;
|
||||
import me.retucio.camtweaks.module.modules.NoRender;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.client.render.LightmapTextureManager;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.util.math.ColorHelper;
|
||||
import net.minecraft.util.profiler.Profiler;
|
||||
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.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(LightmapTextureManager.class)
|
||||
public abstract class LightmapTextureManagerMixin {
|
||||
@@ -24,12 +27,16 @@ public abstract class LightmapTextureManagerMixin {
|
||||
@Unique
|
||||
Fullbright fullbright;
|
||||
|
||||
@Unique
|
||||
NoRender noRender;
|
||||
|
||||
@Shadow @Final
|
||||
private GpuTexture glTexture;
|
||||
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void getModules(GameRenderer renderer, MinecraftClient client, CallbackInfo ci) {
|
||||
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)
|
||||
@@ -45,4 +52,9 @@ public abstract class LightmapTextureManagerMixin {
|
||||
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 net.minecraft.client.render.entity.EntityRendererFactory;
|
||||
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.entity.Entity;
|
||||
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.Inject;
|
||||
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)
|
||||
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;
|
||||
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,23 +1,35 @@
|
||||
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.event.events.OpenScreenEvent;
|
||||
import me.retucio.camtweaks.event.events.ShutdownEvent;
|
||||
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.gui.screen.Screen;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Hand;
|
||||
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 org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
|
||||
@Mixin(MinecraftClient.class)
|
||||
public abstract class MinecraftClientMixin {
|
||||
|
||||
@Shadow
|
||||
private int itemUseCooldown;
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"))
|
||||
private void onTickPre(CallbackInfo ci) {
|
||||
CameraTweaks.INSTANCE.onTick();
|
||||
@@ -44,4 +56,18 @@ public abstract class MinecraftClientMixin {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.command.CommandManager;
|
||||
import me.retucio.camtweaks.config.ConfigManager;
|
||||
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.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.text.ClickEvent;
|
||||
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.callback.CallbackInfo;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.getVersionName;
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
|
||||
@Mixin(Screen.class)
|
||||
public class ScreenMixin {
|
||||
|
||||
@@ -19,4 +29,19 @@ public class ScreenMixin {
|
||||
if (clickEvent instanceof ClientClickEvent event && event.getValue().startsWith(CommandManager.INSTANCE.getPrefix()))
|
||||
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
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
import com.mojang.blaze3d.buffers.GpuBuffer;
|
||||
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.TimeChanger;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import net.minecraft.client.render.SkyRendering;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
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.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(SkyRendering.class)
|
||||
public abstract class SkyRendererMixin {
|
||||
@@ -37,4 +41,10 @@ public abstract class SkyRendererMixin {
|
||||
private void onRenderStars(float brightness, MatrixStack matrices, CallbackInfo ci) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,26 @@
|
||||
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.modules.BlockOutline;
|
||||
import me.retucio.camtweaks.module.modules.Freecam;
|
||||
import me.retucio.camtweaks.module.modules.NoRender;
|
||||
import net.minecraft.client.render.Camera;
|
||||
import net.minecraft.client.render.Frustum;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.WorldRenderer;
|
||||
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.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.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
@@ -21,6 +31,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
|
||||
@Mixin(WorldRenderer.class)
|
||||
public abstract class WorldRendererMixin {
|
||||
|
||||
@@ -29,6 +42,23 @@ public abstract class WorldRendererMixin {
|
||||
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);
|
||||
@@ -48,16 +78,7 @@ public abstract class WorldRendererMixin {
|
||||
if (!outline.isEnabled()) return ColorHelper.withAlpha(alpha, rgb);
|
||||
|
||||
if (outline.rainbow.isEnabled()) {
|
||||
float speed = 10001 - outline.rainbowSpeed.getFloatValue(); // 10001 para evitar divisiones por cero
|
||||
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();
|
||||
return Colors.rainbowInt(outline.rainbowSpeed.getIntValue(), outline.alpha.getIntValue());
|
||||
} else {
|
||||
return new Color(
|
||||
outline.red.getIntValue(),
|
||||
|
||||
@@ -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,24 +26,36 @@ public class ModuleManager {
|
||||
// por orden alfabético y todo, flipas
|
||||
private void addModules() {
|
||||
modules.add(new AntiInvis());
|
||||
modules.add(new AttributeSwapper());
|
||||
modules.add(new AutoSign());
|
||||
modules.add(new BlockOutline());
|
||||
modules.add(new BossbarStack());
|
||||
modules.add(new BungeecordSpoofer());
|
||||
modules.add(new ChatPlus());
|
||||
modules.add(new ColoredSigns());
|
||||
modules.add(new CritsPlus());
|
||||
modules.add(new DamageOverlay());
|
||||
modules.add(new FakePlayer());
|
||||
modules.add(new FastUse());
|
||||
modules.add(new Freecam());
|
||||
modules.add(new Freelook());
|
||||
modules.add(new Fullbright());
|
||||
modules.add(new GlintPlus());
|
||||
modules.add(new HandView());
|
||||
modules.add(new Headhitters());
|
||||
modules.add(new HUD());
|
||||
modules.add(new LogoutSpots());
|
||||
modules.add(new Nametags());
|
||||
modules.add(new NoMiningInterruptions());
|
||||
modules.add(new NoRender());
|
||||
modules.add(new PerspectivePlus());
|
||||
modules.add(new PortalGUI());
|
||||
modules.add(new Rotations());
|
||||
modules.add(new RPackBypass());
|
||||
modules.add(new ScreenshotPlus());
|
||||
modules.add(new ShulkerPeek());
|
||||
modules.add(new TimeChanger());
|
||||
// modules.add(new TooltipsPlus());
|
||||
modules.add(new WarnLowDurability());
|
||||
modules.add(new Zoom());
|
||||
|
||||
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");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -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 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 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 CritsPlus() {
|
||||
|
||||
@@ -5,6 +5,7 @@ import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.settings.StringSetting;
|
||||
import net.minecraft.client.network.OtherClientPlayerEntity;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -21,24 +22,28 @@ public class FakePlayer extends Module {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
if (mc.world == null) return;
|
||||
|
||||
player = new OtherClientPlayerEntity(mc.world, new GameProfile(UUID.randomUUID(), name.getValue()));
|
||||
// player.copyPositionAndRotation(mc.player);
|
||||
player.copyFrom(mc.player);
|
||||
|
||||
mc.world.addEntity(player);
|
||||
|
||||
addPlayer(mc.player, name.getValue());
|
||||
super.onEnable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
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.onRemoved();
|
||||
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,6 +5,7 @@ import me.retucio.camtweaks.event.SubscribeEvent;
|
||||
import me.retucio.camtweaks.event.events.*;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
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.util.ChatUtil;
|
||||
import me.retucio.camtweaks.util.KeyUtil;
|
||||
@@ -12,7 +13,6 @@ 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.KeyBinding;
|
||||
import net.minecraft.client.option.Perspective;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket;
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.play.DeathMessageS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import org.joml.Vector3d;
|
||||
@@ -30,7 +31,6 @@ import org.lwjgl.glfw.GLFW;
|
||||
* @see me.retucio.camtweaks.mixin.CameraMixin
|
||||
* @see me.retucio.camtweaks.mixin.ChunkBorderDebugRendererMixin
|
||||
* @see me.retucio.camtweaks.mixin.ClientPlayerInteractionManagerMixin
|
||||
* @see me.retucio.camtweaks.mixin.CompassStateMixin
|
||||
* @see me.retucio.camtweaks.mixin.EntityMixin
|
||||
* @see me.retucio.camtweaks.mixin.GameRendererMixin
|
||||
* @see me.retucio.camtweaks.mixin.KeyInputMixin
|
||||
@@ -53,13 +53,13 @@ public class Freecam extends Module {
|
||||
public NumberSetting speedSetting = addSetting(new NumberSetting(
|
||||
"velocidad", "velocidad de movimiento de la cámara",
|
||||
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(
|
||||
"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 float prevYaw, prevPitch;
|
||||
|
||||
@@ -192,7 +192,7 @@ public class Freecam extends Module {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPacketSend(PacketEvent.Send event) {
|
||||
public void onSendPacket(PacketEvent.Send event) {
|
||||
if (!isEnabled() || !cancelActionPackets.isEnabled()) return;
|
||||
if (event.getStage() != Stage.PRE) return;
|
||||
|
||||
@@ -270,7 +270,7 @@ public class Freecam extends Module {
|
||||
|
||||
@SubscribeEvent
|
||||
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);
|
||||
if (speed < 0.1) speed = 0.1;
|
||||
event.cancel();
|
||||
@@ -310,6 +310,28 @@ public class Freecam extends Module {
|
||||
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) {
|
||||
prevYaw = yaw;
|
||||
prevPitch = pitch;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Freelook extends Module {
|
||||
4, 0, 10, 0.1));
|
||||
|
||||
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 pitch;
|
||||
@@ -31,7 +31,11 @@ public class Freelook extends Module {
|
||||
public Freelook() {
|
||||
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);
|
||||
|
||||
keyMode.setDefaultValue(KeyModes.HOLD);
|
||||
keyMode.setValue(KeyModes.HOLD);
|
||||
|
||||
notify.setDefaultValue(false);
|
||||
notify.setEnabled(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ public class GUI extends Module {
|
||||
// ^^^ 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 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 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());
|
||||
blue.onUpdate(b -> applyRGBAColorUpdates());
|
||||
alpha.onUpdate(a -> applyRGBAColorUpdates());
|
||||
|
||||
// muy mierdas la solución pero funciona
|
||||
red.reset();
|
||||
green.reset();
|
||||
blue.reset();
|
||||
alpha.reset();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(TickEvent.Post event) {
|
||||
if (rainbow.isEnabled()) {
|
||||
float speed = (float) (rainbowSpeed.getMax() - rainbowSpeed.getValue());
|
||||
float hue = (System.currentTimeMillis() % (long) speed) / speed;
|
||||
Color color = Color.getHSBColor(hue, saturation.getFloatValue(), brightness.getFloatValue());
|
||||
Color color = Colors.rainbowColor(rainbowSpeed.getIntValue(), alpha.getIntValue(), saturation.getFloatValue(), brightness.getFloatValue());
|
||||
|
||||
Colors.red = color.getRed();
|
||||
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(); }
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,13 @@ package me.retucio.camtweaks.module.modules;
|
||||
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.settings.*;
|
||||
import me.retucio.camtweaks.ui.screen.HudEditorScreen;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
/** lógica del HUD manejada en:
|
||||
* @see me.retucio.camtweaks.ui.HudRenderer
|
||||
* @see me.retucio.camtweaks.ui.widgets.HudElement
|
||||
* @see me.retucio.camtweaks.ui.HudEditorScreen
|
||||
* @see HudEditorScreen
|
||||
*/
|
||||
|
||||
public class HUD extends Module {
|
||||
@@ -27,6 +28,8 @@ public class HUD extends Module {
|
||||
|
||||
// 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 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));
|
||||
@@ -36,10 +39,10 @@ public class HUD extends Module {
|
||||
super("HUD", "superposición de la pantalla con info. adicional");
|
||||
|
||||
rainbow.onUpdate(v -> {
|
||||
rainbowSpeed.setVisible(v);
|
||||
red.setVisible(!v);
|
||||
green.setVisible(!v);
|
||||
blue.setVisible(!v);
|
||||
rainbowSpeed.setVisible(v);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
) {}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ public class Nametags extends Module {
|
||||
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 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 petOwner = addSetting(new BooleanSetting("mostrar dueño", "muestra el dueño de una mascota (no funciona en servers no premium)", false));
|
||||
|
||||
|
||||
@@ -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:
|
||||
* @see me.retucio.camtweaks.mixin.ClientPlayNetworkHandlerMixin
|
||||
* @see me.retucio.camtweaks.mixin.EntityEffectParticleEffectMixin
|
||||
* @see me.retucio.camtweaks.mixin.FogRendererMixin
|
||||
* @see me.retucio.camtweaks.mixin.GameRendererMixin
|
||||
* @see me.retucio.camtweaks.mixin.InGameHudMixin
|
||||
* @see me.retucio.camtweaks.mixin.InGameOverlayRendererMixin
|
||||
* @see me.retucio.camtweaks.mixin.ParticleManagerMixin
|
||||
* @see me.retucio.camtweaks.mixin.StatusEffectFogModifierMixin
|
||||
* @see me.retucio.camtweaks.mixin.StuckArrowsFeatureRendererMixin
|
||||
* @see me.retucio.camtweaks.mixin.TextRendererDrawerMixin
|
||||
* @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 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; // para cuando actualice
|
||||
public BooleanSetting endFlashes = addSetting(new BooleanSetting("flashes del end", "renderizar los recientemente añadidos flashes en el end", true));
|
||||
|
||||
public ListSetting<ParticleType<?>> particles = addSetting(new ListSetting<>("partículas", "lista de partículas que se renderizan",
|
||||
Lists.particleList, Lists.allTrue(Lists.particleList), Lists.particleNames));
|
||||
@@ -41,7 +40,6 @@ public class NoRender extends Module {
|
||||
public BooleanSetting nauseaEffect = addSetting(new BooleanSetting("náusea", "renderizar borrachera", 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 nightVisionEffect;
|
||||
|
||||
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));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
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.module.settings.KeySetting;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class TooltipsPlus extends Module {
|
||||
|
||||
public EnumSetting<DisplayModes> displayMode = addSetting(new EnumSetting<>(
|
||||
"mostrar", "cúando mostrar la cajita de los huevos", DisplayModes.class, DisplayModes.ALWAYS));
|
||||
|
||||
public KeySetting displayKey = addSetting(new KeySetting(
|
||||
"tecla de visualización", "tecla a presionar para mostrar la cajita", GLFW.GLFW_KEY_LEFT_CONTROL));
|
||||
|
||||
public BooleanSetting middleClickPreview = addSetting(new BooleanSetting("preview de middle click",
|
||||
"abre una interfaz con los contenidos de un bloque de almacenamiento al presionar el middle click (la ruedita)", false));
|
||||
|
||||
public EnumSetting<SizeFormat> itemSize = addSetting(new EnumSetting<>(
|
||||
"tamaño del ítem", "cómo mostrar el tamaño del ítem en memoria", SizeFormat.class, SizeFormat.NONE));
|
||||
|
||||
|
||||
|
||||
public TooltipsPlus() {
|
||||
super("tooltips plus", "mejoras varias a las cajitas de descripción de items");
|
||||
}
|
||||
|
||||
public enum DisplayModes {
|
||||
ALWAYS("siempre"),
|
||||
KEY("al presionar una tecla"),
|
||||
NEVER("nunca");
|
||||
|
||||
final String name;
|
||||
DisplayModes(String name) { this.name = name; }
|
||||
@Override public String toString() { return name; }
|
||||
}
|
||||
|
||||
public enum SizeFormat {
|
||||
NONE("no mostrar"),
|
||||
BYTES("bytes"),
|
||||
KB("kilobytes"),
|
||||
MB("megabytes");
|
||||
|
||||
final String name;
|
||||
SizeFormat(String name) { this.name = name; }
|
||||
@Override public String toString() { return name; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
|
||||
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));
|
||||
|
||||
@@ -38,19 +38,19 @@ public class Zoom extends Module {
|
||||
|
||||
public Zoom() {
|
||||
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);
|
||||
|
||||
keyMode.setDefaultValue(KeyModes.HOLD);
|
||||
keyMode.setValue(KeyModes.HOLD);
|
||||
|
||||
notify.setDefaultValue(false);
|
||||
notify.setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
if (mc.options == null) return;
|
||||
|
||||
CameraTweaks.EVENT_BUS.register(this);
|
||||
|
||||
prevSmoothCam = mc.options.smoothCameraEnabled;
|
||||
prevMouseSens = mc.options.getMouseSensitivity().getValue();
|
||||
prevFov = mc.options.getFov().getValue();
|
||||
@@ -58,18 +58,21 @@ public class Zoom extends Module {
|
||||
mc.options.hudHidden = !showHUD.isEnabled();
|
||||
|
||||
value = defaultZoom.getValue();
|
||||
|
||||
super.onEnable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
if (mc.options == null) return;
|
||||
CameraTweaks.EVENT_BUS.unregister(this);
|
||||
|
||||
mc.options.smoothCameraEnabled = prevSmoothCam;
|
||||
mc.options.getMouseSensitivity().setValue(prevMouseSens);
|
||||
mc.options.hudHidden = prevHUD;
|
||||
|
||||
mc.worldRenderer.scheduleTerrainUpdate();
|
||||
|
||||
super.onDisable();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package me.retucio.camtweaks.ui;
|
||||
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.config.ConfigManager;
|
||||
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||
import me.retucio.camtweaks.event.events.PacketEvent;
|
||||
@@ -8,10 +7,13 @@ 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;
|
||||
@@ -94,12 +96,9 @@ public class HudRenderer {
|
||||
}
|
||||
|
||||
public static Color getColor(HUD hud) {
|
||||
if (hud.rainbow.isEnabled()) {
|
||||
float speed = 10001 - hud.rainbowSpeed.getFloatValue();
|
||||
float hue = (System.currentTimeMillis() % (int) speed) / speed;
|
||||
Color rgb = Color.getHSBColor(hue, 1, 1);
|
||||
return new Color(rgb.getRed(), rgb.getGreen(), rgb.getBlue(), hud.alpha.getIntValue());
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -130,7 +129,8 @@ public class HudRenderer {
|
||||
|
||||
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
|
||||
if (!hud.isEnabled()) return;
|
||||
if (mc.getDebugHud().shouldShowDebugHud() && !hud.showOnF3.isEnabled()) return;
|
||||
if (mc.debugHudEntryList.isF3Enabled() && !hud.showOnF3.isEnabled()) return;
|
||||
if (mc.currentScreen instanceof ChatScreen && !hud.showOnChat.isEnabled()) return;
|
||||
|
||||
initElements();
|
||||
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
package me.retucio.camtweaks.ui.buttons;
|
||||
|
||||
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.util.ChatUtil;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
import me.retucio.camtweaks.util.KeyUtil;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.input.KeyInput;
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package me.retucio.camtweaks.ui.buttons;
|
||||
|
||||
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.util.Colors;
|
||||
import me.retucio.camtweaks.util.KeyUtil;
|
||||
|
||||
@@ -3,13 +3,11 @@ package me.retucio.camtweaks.ui.buttons;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||
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.util.Colors;
|
||||
import me.retucio.camtweaks.util.KeyUtil;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.text.Text;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -60,7 +58,7 @@ public class ListButton<T> extends SettingButton {
|
||||
@Override
|
||||
public void drawTooltip(DrawContext ctx, double mouseX, double 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
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package me.retucio.camtweaks.ui.buttons;
|
||||
|
||||
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.util.Colors;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
// clase para el botón para cada módulo
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package me.retucio.camtweaks.ui.buttons;
|
||||
|
||||
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 net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
// clase base para los botones de los ajustes
|
||||
|
||||
@@ -3,14 +3,11 @@ package me.retucio.camtweaks.ui.buttons;
|
||||
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||
import me.retucio.camtweaks.event.events.KeyEvent;
|
||||
import me.retucio.camtweaks.module.settings.NumberSetting;
|
||||
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.util.Colors;
|
||||
import me.retucio.camtweaks.util.KeyUtil;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.text.Text;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package me.retucio.camtweaks.ui.buttons;
|
||||
|
||||
import me.retucio.camtweaks.module.settings.StringSetting;
|
||||
import me.retucio.camtweaks.ui.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
import me.retucio.camtweaks.util.KeyUtil;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.text.Text;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
package me.retucio.camtweaks.ui.buttons;
|
||||
|
||||
import me.retucio.camtweaks.module.settings.BooleanSetting;
|
||||
import me.retucio.camtweaks.ui.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.frames.SettingsFrame;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
import me.retucio.camtweaks.util.KeyUtil;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.text.Text;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package me.retucio.camtweaks.ui.frames;
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.event.events.camtweaks.GUISettingsFrameEvent;
|
||||
import me.retucio.camtweaks.module.modules.GUI;
|
||||
import me.retucio.camtweaks.ui.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.buttons.SettingButton;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
|
||||
@@ -4,7 +4,7 @@ import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.event.events.camtweaks.ModuleFrameEvent;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.ui.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.buttons.ModuleButton;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
@@ -4,7 +4,7 @@ import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.event.events.camtweaks.SettingsFrameEvent;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.settings.*;
|
||||
import me.retucio.camtweaks.ui.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.buttons.*;
|
||||
import me.retucio.camtweaks.ui.buttons.SliderButton;
|
||||
import me.retucio.camtweaks.ui.buttons.TextButton;
|
||||
|
||||
+21
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.camtweaks.ui;
|
||||
package me.retucio.camtweaks.ui.screen;
|
||||
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||
@@ -84,9 +84,29 @@ public class ClickGUI extends Screen {
|
||||
|
||||
filterSearchResults();
|
||||
|
||||
renderBottomGradient(ctx, scrollOffset);
|
||||
|
||||
super.render(ctx, mouseX, mouseY, delta);
|
||||
}
|
||||
|
||||
// renderizar un gradiente negro leve en la parte inferior de la pantalla si el contenido excede el límite inferior de la pantalla, para indicarlo visualmente
|
||||
private void renderBottomGradient(DrawContext ctx, int scrollOffset) {
|
||||
int screenHeight = mc.getWindow().getScaledHeight();
|
||||
int totalContentHeight = calculateContentHeight();
|
||||
|
||||
if (scrollOffset + screenHeight < totalContentHeight) {
|
||||
int gradientHeight = 30;
|
||||
int startY = screenHeight - gradientHeight;
|
||||
|
||||
for (int y = 0; y < gradientHeight; y++) {
|
||||
float alpha = (float) y / gradientHeight;
|
||||
int color = (int) (alpha * 0.7 * 255) << 24;
|
||||
|
||||
ctx.fill(0, startY + y, mc.getWindow().getScaledWidth(), startY + y + 1, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int calculateContentHeight() {
|
||||
int bottom = modulesFrame.y + modulesFrame.h + modulesFrame.totalHeight;
|
||||
for (SettingsFrame frame : settingsFrames)
|
||||
+1
-3
@@ -1,10 +1,9 @@
|
||||
package me.retucio.camtweaks.ui;
|
||||
package me.retucio.camtweaks.ui.screen;
|
||||
|
||||
import me.retucio.camtweaks.config.ConfigManager;
|
||||
import me.retucio.camtweaks.ui.frames.ClientSettingsFrame;
|
||||
import me.retucio.camtweaks.ui.widgets.HudElement;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
import me.retucio.camtweaks.util.KeyUtil;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.Click;
|
||||
@@ -16,7 +15,6 @@ import net.minecraft.text.Text;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
package me.retucio.camtweaks.ui.screen;
|
||||
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.module.modules.ShulkerPeek;
|
||||
import me.retucio.camtweaks.ui.frames.ClientSettingsFrame;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
import net.minecraft.client.gl.RenderPipelines;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PreviewScreen extends Screen {
|
||||
|
||||
private static final Identifier TEXTURE = Identifier.of(CameraTweaks.MOD_ID, "textures/gui/preview.png");
|
||||
|
||||
private int x, y;
|
||||
private final int bgWidth = 176;
|
||||
private final int bgHeight = 78;
|
||||
|
||||
private final Color color;
|
||||
private final Text title;
|
||||
private final List<ItemStack> inventory;
|
||||
private final Screen parent;
|
||||
private final PreviewType type;
|
||||
|
||||
private int focusedSlot;
|
||||
|
||||
public PreviewScreen(ItemStack shulker, Screen parent) {
|
||||
super(Text.literal("previsualización del shulker"));
|
||||
this.color = ShulkerPeek.SHULKER_COLORS.get(shulker.getItem());
|
||||
this.title = shulker.getName();
|
||||
this.inventory = shulker.get(DataComponentTypes.CONTAINER).stream().toList();
|
||||
this.parent = parent;
|
||||
this.type = PreviewType.SHULKER;
|
||||
}
|
||||
|
||||
public PreviewScreen(Inventory inventory, Screen parent) {
|
||||
super(Text.literal("echest"));
|
||||
this.color = Colors.PURPLE;
|
||||
this.title = Text.of("echest");
|
||||
this.inventory = new ArrayList<>();
|
||||
this.parent = parent;
|
||||
this.type = PreviewType.ECHEST;
|
||||
|
||||
for (int i = 0; i < inventory.size(); i++)
|
||||
this.inventory.add(inventory.getStack(i));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
this.x = (width - bgWidth) / 2;
|
||||
this.y = (height - bgHeight) / 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(DrawContext ctx, int mouseX, int mouseY, float delta) {
|
||||
super.render(ctx, mouseX, mouseY, delta);
|
||||
|
||||
this.renderBackground(ctx, mouseX, mouseY, delta);
|
||||
this.renderItems(ctx, inventory, x + 8, y + 18);
|
||||
|
||||
int selectedSlot = getSlot(mouseX, mouseY);
|
||||
if (selectedSlot > -1 && selectedSlot < inventory.size() && !inventory.get(selectedSlot).isOf(Items.AIR))
|
||||
renderTooltip(ctx, inventory.get(selectedSlot), mouseX, mouseY);
|
||||
focusedSlot = selectedSlot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBackground(DrawContext ctx, int mouseX, int mouseY, float delta) {
|
||||
ctx.fill(0, 0, width, height, Colors.hudEditorScreenBackgroundColor.getRGB());
|
||||
ctx.drawTexture(RenderPipelines.GUI_TEXTURED, TEXTURE, x, y, 0, 0, bgWidth, bgHeight, 256, 256, color.getRGB());
|
||||
ctx.drawText(textRenderer, title, x + 8, y + 6, Colors.instructionsTextColor.getRGB(), false);
|
||||
}
|
||||
|
||||
private void renderItems(DrawContext context, List<ItemStack> inventory, int x, int y) {
|
||||
int baseX = x;
|
||||
int count = 0;
|
||||
for (ItemStack item : inventory) {
|
||||
count++;
|
||||
context.drawItem(item, x, y);
|
||||
context.drawStackOverlay(textRenderer, item, x, y);
|
||||
x += 18;
|
||||
if (count % 9 == 0) {
|
||||
x = baseX;
|
||||
y += 18;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getSlot(int i, int j) {
|
||||
int x = this.x + 7;
|
||||
int y = this.y + 17;
|
||||
|
||||
int slotX = (i - x) / 18;
|
||||
int slotY = (j - y) / 18;
|
||||
|
||||
if (i < x || j < y || i > x + 9 * 18 - 1 || j > y + 3 * 18 - 1)
|
||||
return -1;
|
||||
|
||||
return slotX + slotY * 9;
|
||||
}
|
||||
|
||||
private void renderTooltip(DrawContext ctx, ItemStack stack, int x, int y) {
|
||||
ctx.drawItemTooltip(textRenderer, stack, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
client.setScreen(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBlur(DrawContext ctx) {
|
||||
if (ClientSettingsFrame.guiSettings.blur.isEnabled()) super.applyBlur(ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldPause() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public PreviewType getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public Screen getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public int getFocusedSlot() {
|
||||
return focusedSlot;
|
||||
}
|
||||
|
||||
public List<ItemStack> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
public enum PreviewType {
|
||||
SHULKER,
|
||||
ECHEST;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package me.retucio.camtweaks.ui.widgets;
|
||||
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.HUD;
|
||||
import me.retucio.camtweaks.ui.HudEditorScreen;
|
||||
import me.retucio.camtweaks.ui.screen.HudEditorScreen;
|
||||
import me.retucio.camtweaks.ui.HudRenderer;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
|
||||
@@ -10,11 +10,6 @@ import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.awt.*;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
|
||||
public class HudElement {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package me.retucio.camtweaks.ui.widgets;
|
||||
|
||||
import me.retucio.camtweaks.ui.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.frames.ClientSettingsFrame;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package me.retucio.camtweaks.ui.widgets;
|
||||
|
||||
import me.retucio.camtweaks.ui.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.frames.ClientSettingsFrame;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
import me.retucio.camtweaks.util.KeyUtil;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
@@ -56,7 +55,7 @@ public class SearchBarWidget {
|
||||
ctx.drawHorizontalLine(x + 4, x + 16, renderY + 3 * i + 5, Color.LIGHT_GRAY.getRGB());
|
||||
|
||||
// texto
|
||||
Text label = Text.literal(focused ? buffer + "_" : (buffer.isEmpty() ? Formatting.ITALIC + "buscar..." : buffer.toString()));
|
||||
Text label = Text.literal(focused ? buffer + "_" : (buffer.isEmpty() ? Formatting.ITALIC + "\uD83D\uDD0D buscar..." : buffer.toString()));
|
||||
ctx.drawText(mc.textRenderer, label,
|
||||
x + 24, renderY + h / 2 - mc.textRenderer.fontHeight / 2,
|
||||
(buffer.isEmpty() && !focused) ? Color.LIGHT_GRAY.getRGB() : -1, true);
|
||||
|
||||
@@ -2,7 +2,10 @@ package me.retucio.camtweaks.util;
|
||||
|
||||
import net.minecraft.util.Formatting;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static me.retucio.camtweaks.ui.frames.ClientSettingsFrame.guiSettings;
|
||||
|
||||
@@ -28,10 +31,67 @@ public class Colors {
|
||||
public static Color selectedHudElementOutlineColor;
|
||||
public static Color unselectedHudElementOutlineColor;
|
||||
|
||||
public static Color RED = new Color(152, 36, 34);
|
||||
public static Color ORANGE = new Color(241, 114, 15);
|
||||
public static Color YELLOW = new Color(249, 196, 35);
|
||||
public static Color LIME = new Color(110, 185, 24);
|
||||
public static Color GREEN = new Color(83, 107, 29);
|
||||
public static Color CYAN = new Color(22, 133, 144);
|
||||
public static Color CELESTE = new Color(57, 177, 215);
|
||||
public static Color BLUE = new Color(49, 52, 152);
|
||||
public static Color PURPLE = new Color(113, 37, 166);
|
||||
public static Color MAGENTA = new Color(183, 61, 172);
|
||||
public static Color PINK = new Color(239, 135, 166);
|
||||
public static Color LAVENDER = new Color(142, 108, 142);
|
||||
public static Color WHITE = new Color(225, 230, 230);
|
||||
public static Color SILVER = new Color(137, 137, 128);
|
||||
public static Color GRAY = new Color(60, 65, 68);
|
||||
public static Color BLACK = new Color(31, 31, 35);
|
||||
public static Color BROWN = new Color(113, 70, 39);
|
||||
|
||||
static {
|
||||
updateAllColors(new Color(red, green, blue, alpha));
|
||||
}
|
||||
|
||||
public static int rainbowInt(int rainbowSpeed, int alpha) {
|
||||
float speed = 10001 - rainbowSpeed; // 10001 para evitar divisiones por cero
|
||||
float hue = (System.currentTimeMillis() % (int) speed) / speed;
|
||||
Color gamingProMax = Color.getHSBColor(hue, 1, 1);
|
||||
|
||||
return new Color(
|
||||
gamingProMax.getRed(),
|
||||
gamingProMax.getGreen(),
|
||||
gamingProMax.getBlue(),
|
||||
alpha
|
||||
).getRGB();
|
||||
}
|
||||
|
||||
public static Color rainbowColor(int rainbowSpeed, int alpha) {
|
||||
float speed = 10001 - rainbowSpeed; // 10001 para evitar divisiones por cero
|
||||
float hue = (System.currentTimeMillis() % (int) speed) / speed;
|
||||
Color gamingProMax = Color.getHSBColor(hue, 1, 1);
|
||||
|
||||
return new Color(
|
||||
gamingProMax.getRed(),
|
||||
gamingProMax.getGreen(),
|
||||
gamingProMax.getBlue(),
|
||||
alpha
|
||||
);
|
||||
}
|
||||
|
||||
public static Color rainbowColor(int rainbowSpeed, int alpha, float saturation, float brightness) {
|
||||
float speed = 10001 - rainbowSpeed; // 10001 para evitar divisiones por cero
|
||||
float hue = (System.currentTimeMillis() % (int) speed) / speed;
|
||||
Color gamingProMax = Color.getHSBColor(hue, saturation, brightness);
|
||||
|
||||
return new Color(
|
||||
gamingProMax.getRed(),
|
||||
gamingProMax.getGreen(),
|
||||
gamingProMax.getBlue(),
|
||||
alpha
|
||||
);
|
||||
}
|
||||
|
||||
public static void updateAllColors(Color color) {
|
||||
mainColor = color;
|
||||
enabledToggleButtonColor = mixWithMainColor(new Color(10, 150, 10), 0.8f);
|
||||
|
||||
@@ -10,7 +10,11 @@ import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import static me.retucio.camtweaks.util.Colors.*;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
|
||||
@@ -27,6 +31,8 @@ public class Lists {
|
||||
|
||||
public static final List<Block> blockList = Registries.BLOCK.stream().toList();
|
||||
|
||||
public static final List<Color> colorList = new ArrayList<>();
|
||||
|
||||
public static void init() {
|
||||
// no consigo traducir el texto. a tomar por culo, se queda en inglés, si no entiendes pues a estudiar
|
||||
entityNames = getMapOfLists(entityList,
|
||||
@@ -38,6 +44,8 @@ public class Lists {
|
||||
|
||||
itemNames = getMapOfLists(itemList,
|
||||
itemList.stream().map(item -> I18n.translate(item.getTranslationKey())).toList());
|
||||
|
||||
colorList.addAll(Arrays.asList(RED, ORANGE, YELLOW, LIME, GREEN, CYAN, CELESTE, BLUE, PURPLE, MAGENTA, PINK, LAVENDER, WHITE, SILVER, GRAY, BLACK, BROWN));
|
||||
}
|
||||
|
||||
public static <T> Map<T, Boolean> allTrue(List<T> options) {
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
package me.retucio.camtweaks.util;
|
||||
|
||||
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.TickEvent;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.screen.GenericContainerScreenHandler;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.annotation.UsesSystemOut;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import org.joml.Vector3d;
|
||||
@@ -13,8 +20,7 @@ import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
public class MiscUtil {
|
||||
|
||||
public static Screen screen;
|
||||
|
||||
private MiscUtil() {}
|
||||
private static Inventory echestInv;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onTick(TickEvent.Post event) {
|
||||
@@ -24,6 +30,23 @@ public class MiscUtil {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onOpenScreen(OpenScreenEvent event) {
|
||||
if (mc.player == null
|
||||
|| event.getScreen() == null
|
||||
|| !(mc.player.currentScreenHandler instanceof GenericContainerScreenHandler handler))
|
||||
return;
|
||||
|
||||
if (event.getScreen() instanceof GenericContainerScreen screen
|
||||
&& screen.getTitle().equals(Text.translatable("container.enderchest")))
|
||||
echestInv = handler.getInventory();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDisconnect(DisconnectEvent event) {
|
||||
echestInv = null;
|
||||
}
|
||||
|
||||
public static void copyVector(Vector3d destination, Vec3d source) {
|
||||
destination.x = source.x;
|
||||
destination.y = source.y;
|
||||
@@ -36,4 +59,8 @@ public class MiscUtil {
|
||||
vector.z = MathHelper.lerp(tickDelta, entity.lastRenderZ, entity.getZ());
|
||||
return vector;
|
||||
}
|
||||
|
||||
public static Inventory getEchestInv() {
|
||||
return echestInv;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package me.retucio.camtweaks.util.interfaces;
|
||||
|
||||
public interface IConfirmScreen {
|
||||
|
||||
void smegma$setBypassAction(Runnable action);
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package me.retucio.camtweaks.util.render;
|
||||
|
||||
import com.mojang.blaze3d.pipeline.RenderPipeline;
|
||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap;
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gl.RenderPipelines;
|
||||
import net.minecraft.client.render.BuiltBuffer;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.RenderPhase;
|
||||
import net.minecraft.client.util.BufferAllocator;
|
||||
import net.minecraft.util.DyeColor;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/** clase modificada de RenderLayer para modificar el color del destello de encantamientos
|
||||
* @see me.retucio.camtweaks.module.modules.GlintPlus
|
||||
* yoinkeado de: https://github.com/Pepperoni-Jabroni/NoMorePurple/blob/main/src/main/java/pepjebs/no_more_purple/client/GlintRenderLayer.java
|
||||
* (y actualizado)
|
||||
*/
|
||||
|
||||
public class GlintRenderLayer extends RenderLayer {
|
||||
|
||||
public static List<RenderLayer> glintColor = newRenderList(GlintRenderLayer::buildGlintRenderLayer);
|
||||
public static List<RenderLayer> entityGlintColor = newRenderList(GlintRenderLayer::buildEntityGlintRenderLayer);
|
||||
public static List<RenderLayer> armorGlintColor = newRenderList(GlintRenderLayer::buildArmorGlintRenderLayer);
|
||||
public static List<RenderLayer> armorEntityGlintColor = newRenderList(GlintRenderLayer::buildArmorEntityGlintRenderLayer);
|
||||
|
||||
public static void addGlintTypes(Object2ObjectLinkedOpenHashMap<RenderLayer, BufferAllocator> map) {
|
||||
addGlintTypes(map, glintColor);
|
||||
addGlintTypes(map, entityGlintColor);
|
||||
addGlintTypes(map, armorGlintColor);
|
||||
addGlintTypes(map, armorEntityGlintColor);
|
||||
}
|
||||
|
||||
public GlintRenderLayer(String name, VertexFormat vertexFormat, VertexFormat.DrawMode drawMode, int expectedBufferSize, boolean hasCrumbling, boolean translucent, Runnable startAction, Runnable endAction) {
|
||||
super(name, expectedBufferSize, hasCrumbling, translucent, startAction, endAction);
|
||||
}
|
||||
|
||||
private static List<RenderLayer> newRenderList(Function<String, RenderLayer> func) {
|
||||
ArrayList<RenderLayer> list = new ArrayList<>(DyeColor.values().length);
|
||||
|
||||
for (DyeColor color : DyeColor.values())
|
||||
list.add(func.apply(color.name()));
|
||||
|
||||
list.add(func.apply("rainbow"));
|
||||
list.add(func.apply("none"));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void addGlintTypes(Object2ObjectLinkedOpenHashMap<RenderLayer, BufferAllocator> map, List<RenderLayer> typeList) {
|
||||
for(RenderLayer renderType : typeList)
|
||||
if (!map.containsKey(renderType))
|
||||
map.put(renderType, new BufferAllocator(renderType.getExpectedBufferSize()));
|
||||
}
|
||||
|
||||
private static RenderLayer buildGlintRenderLayer(String name) {
|
||||
final Identifier res = Identifier.of(CameraTweaks.MOD_ID, "textures/misc/glint_" + name.toLowerCase() + ".png");
|
||||
|
||||
return RenderLayer.of("glint_" + name, 256, RenderPipelines.GLINT, MultiPhaseParameters.builder()
|
||||
.texturing(RenderPhase.GLINT_TEXTURING)
|
||||
.texture(new Texture(res, false))
|
||||
.texturing(GLINT_TEXTURING)
|
||||
.build(false));
|
||||
}
|
||||
|
||||
private static RenderLayer buildEntityGlintRenderLayer(String name) {
|
||||
final Identifier res = Identifier.of(CameraTweaks.MOD_ID, "textures/misc/glint_" + name.toLowerCase() + ".png");
|
||||
|
||||
return RenderLayer.of("entity_glint_" + name, 256, RenderPipelines.GLINT, MultiPhaseParameters.builder()
|
||||
.texturing(RenderPhase.ENTITY_GLINT_TEXTURING)
|
||||
.texture(new Texture(res, false))
|
||||
.target(ITEM_ENTITY_TARGET)
|
||||
.texturing(ENTITY_GLINT_TEXTURING)
|
||||
.build(false));
|
||||
}
|
||||
|
||||
|
||||
private static RenderLayer buildArmorGlintRenderLayer(String name) {
|
||||
final Identifier res = Identifier.of(CameraTweaks.MOD_ID, "textures/misc/glint_" + name.toLowerCase() + ".png");
|
||||
|
||||
return RenderLayer.of("armor_glint_" + name, 256, RenderPipelines.GLINT, MultiPhaseParameters.builder()
|
||||
.texturing(RenderPhase.ARMOR_ENTITY_GLINT_TEXTURING)
|
||||
.texture(new Texture(res, false))
|
||||
.texturing(GLINT_TEXTURING)
|
||||
.layering(VIEW_OFFSET_Z_LAYERING)
|
||||
.build(false));
|
||||
}
|
||||
|
||||
private static RenderLayer buildArmorEntityGlintRenderLayer(String name) {
|
||||
final Identifier res = Identifier.of(CameraTweaks.MOD_ID, "textures/misc/glint_" + name.toLowerCase() + ".png");
|
||||
|
||||
return RenderLayer.of("armor_entity_glint_" + name, 256, RenderPipelines.GLINT, MultiPhaseParameters.builder()
|
||||
.texturing(RenderPhase.ARMOR_ENTITY_GLINT_TEXTURING)
|
||||
.texture(new Texture(res, false))
|
||||
.texturing(ENTITY_GLINT_TEXTURING)
|
||||
.layering(VIEW_OFFSET_Z_LAYERING)
|
||||
.build(false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(BuiltBuffer buffer) {}
|
||||
|
||||
@Override
|
||||
public VertexFormat getVertexFormat() { return VertexFormat.builder().build(); }
|
||||
|
||||
@Override
|
||||
public VertexFormat.DrawMode getDrawMode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RenderPipeline getRenderPipeline() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package me.retucio.camtweaks.util.render;
|
||||
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.RenderPhase;
|
||||
import net.minecraft.util.Util;
|
||||
|
||||
import java.util.OptionalDouble;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static me.retucio.camtweaks.util.render.Pipelines.GLOBAL_LINES_PIPELINE;
|
||||
import static me.retucio.camtweaks.util.render.Pipelines.GLOBAL_QUADS_PIPELINE;
|
||||
|
||||
public class Layers {
|
||||
|
||||
private static final RenderLayer GLOBAL_QUADS;
|
||||
private static final Function<Double, RenderLayer> GLOBAL_LINES;
|
||||
|
||||
public static RenderLayer getGlobalLines(double width) {
|
||||
return GLOBAL_LINES.apply(width);
|
||||
}
|
||||
|
||||
public static RenderLayer getGlobalQuads() {
|
||||
return GLOBAL_QUADS;
|
||||
}
|
||||
|
||||
private static RenderLayer.MultiPhaseParameters.Builder builder() {
|
||||
return RenderLayer.MultiPhaseParameters.builder();
|
||||
}
|
||||
|
||||
private static RenderLayer.MultiPhaseParameters empty() {
|
||||
return builder().build(false);
|
||||
}
|
||||
|
||||
static {
|
||||
GLOBAL_QUADS = RenderLayer.of("global_fill", 156, GLOBAL_QUADS_PIPELINE, empty());
|
||||
|
||||
GLOBAL_LINES = Util.memoize(l -> {
|
||||
RenderPhase.LineWidth width = new RenderPhase.LineWidth(OptionalDouble.of(l));
|
||||
return RenderLayer.of("global_lines", 156, GLOBAL_LINES_PIPELINE, builder().lineWidth(width).build(false));
|
||||
});
|
||||
}
|
||||
}
|
||||
Loaded 100 of 145 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user