Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b2ec0e69a | ||
|
|
6fa409d60a |
No files matched your search
+2
-1
@@ -46,5 +46,6 @@ test.java
|
||||
cambios.md
|
||||
# no está terminado
|
||||
src/main/java/me/retucio/camtweaks/module/modules/TooltipsPlus.java
|
||||
|
||||
src/main/java/me/retucio/camtweaks/util/RenderUtil.java
|
||||
src/main/java/me/retucio/camtweaks/util/Layers.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}"
|
||||
|
||||
}
|
||||
|
||||
+23
-7
@@ -1,19 +1,35 @@
|
||||
# v1.5
|
||||
# v1.7
|
||||
|
||||
> al parecer me he saltado la versión 1.6, y la llamé 1.7, o sea que esta será 1.7.1 en el commit y a tomar por culo la 1.6
|
||||
|
||||
## novedades
|
||||
|
||||
sigo vivo (creo)
|
||||
- se ha cambiado el icono a uno más "family friendly"
|
||||
|
||||
### 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.
|
||||
- opción para agregar un pequeño tooltip a los shulkers (prev. de shulkers)
|
||||
- marca de agua para interfaces opcional y customizable
|
||||
- opción para desactivar flashes del end de norender. aún se cambia el nivel de luz porque eso se maneja server-side
|
||||
|
||||
#### módulos nuevos:
|
||||
|
||||
- attribute-swapper: automatiza el attribute swapping (aplicar propiedades de una herramienta a otra al intercambiar y usar una al mismo tiempo)
|
||||
- autocartel: te permite colocar carteles con un texto preconfigurado sin tener que abrir la interfaz de cada uno
|
||||
- bungeecord spoofer: (no funciona bien (todavía)) te permite conectarte a un servidor backend de un server con bungeecord mal configurado y manipular tu UUID mediante un proxy
|
||||
- carteles gays: te permite agregar formato a los carteles mediante un símbolo a elegir que será reemplazado por el símbolo de formato de Minecraft (§)
|
||||
- headhitters: establece jumpingCooldown como 0 siempre para que puedas mantener espacio en vez de espamearlo, para hacer headhitters (espamear espacio al estar bajo bloques para avanzar más rápido)
|
||||
- minar sin interrupción: te permite ignorar entidades al minar y romper bloques a través de ellas
|
||||
- precoz: reduce el cooldown de algunas cosas como colocar bloques o usar items al valor deseado
|
||||
- rotaciones: te permite forzar una rotación específica del lado del cliente y del servidor
|
||||
|
||||
### 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
|
||||
- ya no se activan / desactivan los módulos sin tecla asignada al subir y bajar el volumen (era porque tenía el número de tecla -1 que se usa también para cuando no hay una tecla)
|
||||
- arreglado el freecam y su opción de cancelar paquetes
|
||||
- arreglada la sensibilidad de perspectiva libre
|
||||
- otros cambios irrelevantes al público general (hablo como si más de una persona usase el mod)
|
||||
- ya no se marcan como jugadores desconectados aquellos que abandonan la distancia de renderizado
|
||||
|
||||
## problemas reconocidos
|
||||
|
||||
|
||||
+9
-5
@@ -1,5 +1,9 @@
|
||||
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
|
||||
|
||||
probablemente más pero como tengo demencia se me olvida
|
||||
si quieres que te acredite 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.7
|
||||
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,15 +49,28 @@ 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
|
||||
@@ -199,4 +213,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();
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ public class CommandManager {
|
||||
addCommand(new BindCommand());
|
||||
addCommand(new CopyScreenshotCommand());
|
||||
// addCommand(new EnderChestCommand()); no funciona D:
|
||||
addCommand(new GarbageCleanerCommand());
|
||||
addCommand(new PeekCommand());
|
||||
addCommand(new PrefixCommand());
|
||||
addCommand(new PurgeCommand());
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,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,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;
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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,13 +1,19 @@
|
||||
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.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 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;
|
||||
@@ -18,6 +24,9 @@ import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||
@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 +53,11 @@ public abstract class MinecraftClientMixin {
|
||||
private void disableMicropenisTelemetryShi(CallbackInfoReturnable<Boolean> cir) {
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
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.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 +15,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 +28,18 @@ 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) {
|
||||
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
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,25 @@
|
||||
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 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 +30,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 +41,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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -26,22 +26,32 @@ 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 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 ScreenshotPlus());
|
||||
modules.add(new ShulkerPeek());
|
||||
modules.add(new TimeChanger());
|
||||
// modules.add(new TooltipsPlus());
|
||||
modules.add(new Zoom());
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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,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,111 @@
|
||||
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.ShulkerPreviewScreen;
|
||||
|
||||
import net.minecraft.block.ShulkerBoxBlock;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import net.minecraft.component.ComponentType;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.component.type.ContainerComponent;
|
||||
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.Items;
|
||||
import net.minecraft.item.tooltip.TooltipType;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
|
||||
import net.minecraft.text.Text;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
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, new Color(142, 108, 142));
|
||||
SHULKER_COLORS.put(Items.WHITE_SHULKER_BOX, new Color(225, 230, 230));
|
||||
SHULKER_COLORS.put(Items.LIGHT_GRAY_SHULKER_BOX, new Color(137, 137, 128));
|
||||
SHULKER_COLORS.put(Items.GRAY_SHULKER_BOX, new Color(60, 65, 68));
|
||||
SHULKER_COLORS.put(Items.BLACK_SHULKER_BOX, new Color(31, 31, 35));
|
||||
SHULKER_COLORS.put(Items.BROWN_SHULKER_BOX, new Color(113, 70, 39));
|
||||
SHULKER_COLORS.put(Items.RED_SHULKER_BOX, new Color(152, 36, 34));
|
||||
SHULKER_COLORS.put(Items.ORANGE_SHULKER_BOX, new Color(241, 114, 15));
|
||||
SHULKER_COLORS.put(Items.YELLOW_SHULKER_BOX, new Color(249, 196, 35));
|
||||
SHULKER_COLORS.put(Items.LIME_SHULKER_BOX, new Color(110, 185, 24));
|
||||
SHULKER_COLORS.put(Items.GREEN_SHULKER_BOX, new Color(83, 107, 29));
|
||||
SHULKER_COLORS.put(Items.CYAN_SHULKER_BOX, new Color(22, 133, 144));
|
||||
SHULKER_COLORS.put(Items.LIGHT_BLUE_SHULKER_BOX, new Color(57, 177, 215));
|
||||
SHULKER_COLORS.put(Items.BLUE_SHULKER_BOX, new Color(49, 52, 152));
|
||||
SHULKER_COLORS.put(Items.PURPLE_SHULKER_BOX, new Color(113, 37, 166));
|
||||
SHULKER_COLORS.put(Items.MAGENTA_SHULKER_BOX, new Color(183, 61, 172));
|
||||
SHULKER_COLORS.put(Items.PINK_SHULKER_BOX, new Color(239, 135, 166));
|
||||
}
|
||||
|
||||
@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 ShulkerPreviewScreen)) {
|
||||
openPreviewScreen();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getAction() == GLFW.GLFW_RELEASE) {
|
||||
if (mc.currentScreen instanceof ShulkerPreviewScreen preview)
|
||||
preview.close();
|
||||
}
|
||||
}
|
||||
|
||||
private void openPreviewScreen() {
|
||||
if (!(mc.currentScreen instanceof HandledScreen<?> prevScreen)) return;
|
||||
|
||||
Slot focusedSlot = ((HandledScreenAccessor) prevScreen).getFocusedSlot();
|
||||
if (focusedSlot == null) return;
|
||||
|
||||
ItemStack stack = focusedSlot.getStack();
|
||||
if (isShulkerEmpty(stack)) return;
|
||||
|
||||
mc.setScreen(new ShulkerPreviewScreen(stack, prevScreen));
|
||||
}
|
||||
|
||||
public static boolean isShulkerEmpty(ItemStack stack) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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,12 @@ 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 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;
|
||||
@@ -131,6 +132,7 @@ public class HudRenderer {
|
||||
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
|
||||
if (!hud.isEnabled()) return;
|
||||
if (mc.getDebugHud().shouldShowDebugHud() && !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;
|
||||
|
||||
+1
-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;
|
||||
+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,112 @@
|
||||
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.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
// https://github.com/kgriff0n/shulker-preview/blob/master/src/main/java/io/github/kgriff0n/screen/FakeShulkerScreen.java
|
||||
public class ShulkerPreviewScreen extends Screen {
|
||||
|
||||
private static final Identifier TEXTURE = Identifier.of(CameraTweaks.MOD_ID, "textures/gui/shulker.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;
|
||||
|
||||
public ShulkerPreviewScreen(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;
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package me.retucio.camtweaks.util.render;
|
||||
|
||||
import com.mojang.blaze3d.pipeline.BlendFunction;
|
||||
import com.mojang.blaze3d.pipeline.RenderPipeline;
|
||||
import com.mojang.blaze3d.platform.DepthTestFunction;
|
||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
import net.minecraft.client.gl.RenderPipelines;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.RenderPhase;
|
||||
import net.minecraft.client.render.VertexFormats;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Util;
|
||||
|
||||
import java.util.OptionalDouble;
|
||||
import java.util.function.Function;
|
||||
|
||||
|
||||
public class Pipelines {
|
||||
|
||||
static final RenderPipeline GLOBAL_LINES_PIPELINE = RenderPipeline.builder(RenderPipelines.RENDERTYPE_LINES_SNIPPET)
|
||||
.withLocation(Identifier.of(CameraTweaks.MOD_ID, "pipeline/global_lines"))
|
||||
.withVertexFormat(VertexFormats.POSITION_COLOR_NORMAL, VertexFormat.DrawMode.LINES)
|
||||
.withDepthTestFunction(DepthTestFunction.NO_DEPTH_TEST)
|
||||
.withDepthWrite(false)
|
||||
.withCull(false)
|
||||
.build();
|
||||
|
||||
static final RenderPipeline GLOBAL_QUADS_PIPELINE = RenderPipeline.builder(RenderPipelines.POSITION_COLOR_SNIPPET)
|
||||
.withLocation("pipeline/global_fill_pipeline")
|
||||
.withVertexFormat(VertexFormats.POSITION_COLOR, VertexFormat.DrawMode.QUADS)
|
||||
.withDepthTestFunction(DepthTestFunction.NO_DEPTH_TEST)
|
||||
.withBlend(BlendFunction.TRANSLUCENT)
|
||||
.withDepthWrite(false)
|
||||
.withCull(false)
|
||||
.build();
|
||||
|
||||
static final Function<Double, RenderLayer> GLOBAL_LINES_LAYER = Util.memoize(lineWidth -> {
|
||||
RenderPhase.LineWidth lineState = new RenderPhase.LineWidth(OptionalDouble.of(lineWidth));
|
||||
RenderLayer.MultiPhaseParameters compositeState = RenderLayer.MultiPhaseParameters.builder()
|
||||
.lineWidth(lineState)
|
||||
.build(false);
|
||||
return RenderLayer.of("global_lines", RenderLayer.DEFAULT_BUFFER_SIZE, GLOBAL_LINES_PIPELINE, compositeState);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
public static RenderLayer getGlobalLinesLayer(double lineWidth) {
|
||||
return GLOBAL_LINES_LAYER.apply(lineWidth);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package me.retucio.camtweaks.util.render;
|
||||
|
||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.*;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
// literalmente robado de https://github.com/mioclient/oyvey-ported/ (perdón)
|
||||
public class RenderUtil {
|
||||
|
||||
private static final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
private static final Tessellator tesselator = Tessellator.getInstance();
|
||||
|
||||
public static void drawOutlineBox(MatrixStack stack, Box box, Color color, double lineWidth) {
|
||||
float r = color.getRed() / 255f;
|
||||
float g = color.getGreen() / 255f;
|
||||
float b = color.getBlue() / 255f;
|
||||
float a = color.getAlpha() / 255f;
|
||||
|
||||
Vec3d cameraPos = mc.gameRenderer.getCamera().getPos();
|
||||
float minX = (float) (box.minX - cameraPos.x);
|
||||
float minY = (float) (box.minY - cameraPos.y);
|
||||
float minZ = (float) (box.minZ - cameraPos.z);
|
||||
float maxX = (float) (box.maxX - cameraPos.x);
|
||||
float maxY = (float) (box.maxY - cameraPos.y);
|
||||
float maxZ = (float) (box.maxZ - cameraPos.z);
|
||||
|
||||
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR_NORMAL);
|
||||
|
||||
VertexRendering.drawBox(stack.peek(), buffer, minX, minY, minZ, maxX, maxY, maxZ, r, g, b, a);
|
||||
|
||||
Layers.getGlobalLines(lineWidth).draw(buffer.end());
|
||||
}
|
||||
|
||||
public static void drawFilledBox(MatrixStack matrices, Box box, Color color) {
|
||||
Vec3d cameraPos = mc.gameRenderer.getCamera().getPos();
|
||||
float minX = (float) (box.minX - cameraPos.x);
|
||||
float minY = (float) (box.minY - cameraPos.y);
|
||||
float minZ = (float) (box.minZ - cameraPos.z);
|
||||
float maxX = (float) (box.maxX - cameraPos.x);
|
||||
float maxY = (float) (box.maxY - cameraPos.y);
|
||||
float maxZ = (float) (box.maxZ - cameraPos.z);
|
||||
|
||||
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
|
||||
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, minZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, minZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, maxZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, maxZ).color(color.getRGB());
|
||||
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, minZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, maxZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, maxZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, minZ).color(color.getRGB());
|
||||
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, minZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, minZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, minZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, minZ).color(color.getRGB());
|
||||
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, minZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, minZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, maxZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, maxZ).color(color.getRGB());
|
||||
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, maxZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, maxZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, maxZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, maxZ).color(color.getRGB());
|
||||
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, minZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, maxZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, maxZ).color(color.getRGB());
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, minZ).color(color.getRGB());
|
||||
|
||||
Layers.getGlobalQuads().draw(buffer.end());
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
@@ -7,5 +7,8 @@ accessible field net/minecraft/client/particle/BillboardParticle scale F
|
||||
accessible field net/minecraft/client/particle/Particle velocityMultiplier F
|
||||
accessible field net/minecraft/client/particle/Particle gravityStrength F
|
||||
accessible field net/minecraft/client/particle/Particle collidesWithWorld Z
|
||||
accessible field net/minecraft/entity/LivingEntity jumpingCooldown I
|
||||
|
||||
accessible method net/minecraft/client/render/WorldRenderer method_74752 (Lnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/Frustum;Z)V
|
||||
accessible method net/minecraft/client/render/WorldRenderer method_74752 (Lnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/Frustum;Z)V
|
||||
accessible method net/minecraft/client/render/GameRenderer getProjectionMatrix (F)Lorg/joml/Matrix4f;
|
||||
accessible method net/minecraft/client/render/command/DebugHitboxCommandRenderer renderDebugHitbox (Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/entity/state/EntityHitboxAndView;Lnet/minecraft/client/render/VertexConsumer;F)V
|
||||
@@ -6,7 +6,9 @@
|
||||
"ClientConnectionMixin",
|
||||
"DimensionTypeMixin",
|
||||
"EntityMixin",
|
||||
"HandshakeC2SPacketMixin",
|
||||
"ItemEntityMixin",
|
||||
"ItemMixin",
|
||||
"KeyInputMixin",
|
||||
"PlayerEntityMixin",
|
||||
"StringHelperMixin",
|
||||
@@ -33,6 +35,7 @@
|
||||
"ClientPlayerEntityMixin",
|
||||
"ClientPlayerInteractionManagerMixin",
|
||||
"ClientPlayNetworkHandlerMixin",
|
||||
"ClientWorldMixin",
|
||||
"ClientWorldPropertiesMixin",
|
||||
"DamageParticleFactoryMixin",
|
||||
"DamageParticleMixin",
|
||||
@@ -59,7 +62,9 @@
|
||||
"TextRendererMixin",
|
||||
"WeatherRenderingMixin",
|
||||
"WorldRendererMixin",
|
||||
"accessor.AbstractSignEditScreenAccessor",
|
||||
"accessor.ClientPlayNetworkHandlerAccessor",
|
||||
"accessor.HandledScreenAccessor",
|
||||
"accessor.KeyBindingAccessor"
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user