Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec3e633cec | ||
|
|
8f17bd8e67 | ||
|
|
dc2429918e |
No files matched your search
@@ -5,19 +5,19 @@ mod para Minecraft Fabric 1.21.10 que añade algunas cosas QOL, mayormente relac
|
||||
## instalación
|
||||
|
||||
### para gente normal:
|
||||
1. ir a [lanzamientos](https://github.com/retuci0/camera-tweaks/releases)
|
||||
1. ir a [lanzamientos](https://github.com/retuci0/sputnik/releases)
|
||||
2. selecionar la versión más reciente
|
||||
3. descargar el .jar
|
||||
4. moverlo a tu directorio de mods (probablemente `%appdata%/.minecraft/mods`)
|
||||
|
||||
asegúrate de tener una version de Minecraft y Fabric compatibles con el mod (MC `1.21.10`; Fabric `0.138.3`)
|
||||
asegúrate de tener una version de Minecraft y Fabric compatibles con el mod (MC `1.21.11`; Fabric `0.17.3`)
|
||||
es posible que haya problemas al usarlo junto a otros mods, especialmente junto a otros clientes, pues pueden conflictar entre ellos.
|
||||
|
||||
### para frikis de 200 de iq
|
||||
1. clona el respositorio (`git clone https://github.com/retuci0/camera-tweaks`)
|
||||
2. entra al directorio del repositorio (`cd camera-tweaks`)
|
||||
1. clona el respositorio (`git clone https://github.com/retuci0/sputnik`)
|
||||
2. entra al directorio del repositorio (`cd sputnik`)
|
||||
3. `gradlew build` para Windows o `chmod +x gradlew` + `./gradlew build` para Linux (Mac es Linux)
|
||||
4. el resultado estará en `/build/libs/camtweaks-X.X.jar` (el que no lleva "sources" en el nombre)
|
||||
4. el resultado estará en `/build/libs/sputnik-X.X.jar` (el que no lleva "sources" en el nombre)
|
||||
|
||||
## uso
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ dependencies {
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/camtweaks.accesswidener")
|
||||
accessWidenerPath = file("src/main/resources/sputnik.accesswidener")
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
||||
+4
-14
@@ -1,29 +1,19 @@
|
||||
# v2.1 (roto)
|
||||
# v2.4
|
||||
|
||||
## novedades
|
||||
|
||||
- actualizado a la 1.21.11 (maomeno)
|
||||
ahora se usa el formato binario (.dat) en vez de .json para guardar ajustes, lo que los hace más rápidos, y el archivo más liviano
|
||||
|
||||
### adiciones
|
||||
|
||||
- categorías de módulos: ahora puedes buscar "cámara", "jugador", "mundo", "renderizado", "red", "cliente" o "misc" para que se filtren los módulos de esas categorías, respectivamente
|
||||
|
||||
#### módulos nuevos:
|
||||
|
||||
- muletas: hace te no te caigas (de bloques), como cuando estás agachado, pero sin agacharte
|
||||
- capas: cambia (solo visualmente, para ti) la capa que usas a una custom de las disponibles
|
||||
|
||||
### arreglos / mejoras
|
||||
|
||||
- ahora ya puedes escribir espacios en la barra de búsqueda
|
||||
- ahora se ignoran las tildes al buscar en la barra de búsqueda
|
||||
- aviso de baja dur. ya no te avisa al reparar objetos dañados por debajo del límite
|
||||
- creo que cielo custom ya funciona por completo (las fases lunares)
|
||||
- renombrado bien todo que lo hice con prisa
|
||||
|
||||
## problemas reconocidos
|
||||
|
||||
- muchos, pero repórtalos en la página de problemas si quieres para que queden bien registrados
|
||||
- de esta actualización:
|
||||
- superposición de daño no funciona porque no lo he podido actualizar porque han cambiado cosas relacionadas a la renderización
|
||||
- la renderización de líneas (no rellenos) está rota, por el mismo motivo
|
||||
- por el mismo motivo, destello de enchants no funciona
|
||||
- minar sin interrupción no funciona
|
||||
@@ -6,6 +6,7 @@ No Telemetry: https://modrinth.com/mod/no-telemetry
|
||||
Trouser Streak: https://github.com/etianl/Trouser-Streak
|
||||
No More Purple: https://github.com/Pepperoni-Jabroni/NoMorePurple/
|
||||
bypass-resource-pack: https://github.com/emilyy-dev/bypass-resource-pack
|
||||
elytra-recast: https://github.com/InLieuOfLuna/elytra-recast/
|
||||
|
||||
probablemente más pero como tengo demencia se me olvida
|
||||
si quieres que te acredite o quite tu código de mi mod, mándame un mensaje en discord (username: retucio) y sin problemas :)
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
org.gradle.parallel=true
|
||||
|
||||
minecraft_version=1.21.11
|
||||
@@ -8,6 +8,6 @@ loom_version=1.13-SNAPSHOT
|
||||
|
||||
fabric_api_version=0.140.2+1.21.11
|
||||
|
||||
mod_version=2.1
|
||||
mod_version=2.4
|
||||
maven_group=me.retucio
|
||||
archives_base_name=camtweaks
|
||||
archives_base_name=sputnik
|
||||
@@ -1,9 +0,0 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ChunkOcclusionDataBuilderMixin#onChunkOcclusion
|
||||
*/
|
||||
public class ChunkOcclusionEvent extends Event {}
|
||||
@@ -1,12 +0,0 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.MinecraftClientMixin#onStop
|
||||
*/
|
||||
public class ShutdownEvent extends Event {
|
||||
|
||||
public ShutdownEvent() {}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.MinecraftClientMixin#onTickPre
|
||||
* @see me.retucio.camtweaks.mixin.MinecraftClientMixin#onTickPost
|
||||
*/
|
||||
public class TickEvent {
|
||||
|
||||
public static class Pre extends Event {}
|
||||
public static class Post extends Event {}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package me.retucio.camtweaks.module.modules.player;
|
||||
|
||||
import me.retucio.camtweaks.module.Category;
|
||||
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",
|
||||
Category.PLAYER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick() {
|
||||
if (mc.player == null) return;
|
||||
mc.player.jumpingCooldown = 0;
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package me.retucio.camtweaks.ui.hud;
|
||||
|
||||
import me.retucio.camtweaks.module.modules.client.HUD;
|
||||
import me.retucio.camtweaks.util.Colors;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class HudElement {
|
||||
|
||||
protected static final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
private final String id;
|
||||
protected boolean visible;
|
||||
protected int x, y;
|
||||
protected final int defaultX, defaultY;
|
||||
protected int width = 85, height = 14;
|
||||
|
||||
public HudElement(String id, int defaultX, int defaultY) {
|
||||
this.id = id;
|
||||
this.defaultX = defaultX;
|
||||
this.defaultY = defaultY;
|
||||
this.visible = true;
|
||||
}
|
||||
|
||||
public abstract String getText(float delta, HUD hud);
|
||||
public abstract String getPreviewText();
|
||||
|
||||
public void renderInGame(DrawContext ctx, float delta, HUD hud) {
|
||||
String text = getText(delta, hud);
|
||||
int color = hud != null ? HudRenderer.getColor(hud).getRGB() : -1;
|
||||
boolean shadow = hud != null && hud.shadow.isEnabled();
|
||||
HudRenderer.drawSnappedText(ctx, text, x, y, color, shadow);
|
||||
}
|
||||
|
||||
public void renderInEditor(DrawContext ctx, HUD hud) {
|
||||
String previewText = getPreviewText();
|
||||
width = mc.textRenderer.getWidth(previewText);
|
||||
height = mc.textRenderer.fontHeight;
|
||||
|
||||
drawEditorBackground(ctx);
|
||||
|
||||
int color = hud != null ? HudRenderer.getColor(hud).getRGB() : -1;
|
||||
boolean shadow = hud != null && hud.shadow.isEnabled();
|
||||
HudRenderer.drawSnappedText(ctx, previewText, x, y, color, shadow);
|
||||
}
|
||||
|
||||
public abstract List<Text> getTooltip();
|
||||
|
||||
private void drawEditorBackground(DrawContext ctx) {
|
||||
int bg = visible ? Colors.visibleHudElementColor.getRGB() : Colors.disabledHudElementColor.getRGB();
|
||||
int outline = HudEditorScreen.INSTANCE != null && HudEditorScreen.INSTANCE.isSelected(this)
|
||||
? Colors.selectedHudElementOutlineColor.getRGB()
|
||||
: Colors.unselectedHudElementOutlineColor.getRGB();
|
||||
|
||||
// fondo
|
||||
ctx.fill(x - 1, y - 1, x + width + 1, y + height + 1, bg);
|
||||
|
||||
// contorno
|
||||
ctx.fill(x - 1, y - 1, x + width + 1, y, outline);
|
||||
ctx.fill(x - 1, y + height, x + width + 1, y + height + 1, outline);
|
||||
ctx.fill(x - 1, y, x, y + height, outline);
|
||||
ctx.fill(x + width, y, x + width + 1, y + height, outline);
|
||||
}
|
||||
|
||||
public boolean isHovered(int mouseX, int mouseY) {
|
||||
return mouseX >= x && mouseX <= x + width
|
||||
&& mouseY >= y && mouseY <= y + height;
|
||||
}
|
||||
|
||||
// Getters and setters
|
||||
public String getId() { return id; }
|
||||
public int getX() { return x; }
|
||||
public int getY() { return y; }
|
||||
public int getWidth() { return width; }
|
||||
public int getHeight() { return height; }
|
||||
public boolean isVisible() { return visible; }
|
||||
public void setVisible(boolean visible) { this.visible = visible; }
|
||||
|
||||
public void resetPosition() {
|
||||
this.x = defaultX;
|
||||
this.y = defaultY;
|
||||
}
|
||||
|
||||
public void setPosition(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package me.retucio.camtweaks.util.interfaces;
|
||||
|
||||
import net.minecraft.client.gui.hud.ChatHudLine;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IChatHud {
|
||||
|
||||
void smegma$add(Text message, int id);
|
||||
|
||||
List<ChatHudLine.Visible> smegma$getVisibleMessages();
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package me.retucio.camtweaks.util.interfaces;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
public interface IChatHudLine {
|
||||
|
||||
String smegma$getText();
|
||||
|
||||
int smegma$getId();
|
||||
void smegma$setId(int id);
|
||||
|
||||
GameProfile smegma$getSender();
|
||||
void smegma$setSender(GameProfile profile);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package me.retucio.camtweaks.util.interfaces;
|
||||
|
||||
public interface IChatHudLineVisible extends IChatHudLine {
|
||||
|
||||
boolean smegma$isStartOfEntry();
|
||||
void smegma$setStartOfEntry(boolean start);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package me.retucio.camtweaks.util.interfaces;
|
||||
|
||||
public interface IConfirmScreen {
|
||||
|
||||
void smegma$setBypassAction(Runnable action);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package me.retucio.camtweaks.util.interfaces;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
public interface IMessageHandler {
|
||||
|
||||
GameProfile smegma$getSender();
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package me.retucio.camtweaks.util.interfaces;
|
||||
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import org.joml.Vector3d;
|
||||
|
||||
public interface IVec3d {
|
||||
|
||||
void smegma$set(double x, double y, double z);
|
||||
default void smegma$set(Vec3i vec) { smegma$set(vec.getX(), vec.getY(), vec.getZ()); }
|
||||
default void semgma$set(Vector3d vec) { smegma$set(vec.x, vec.y, vec.z); }
|
||||
|
||||
void smegma$setXZ(double x, double z);
|
||||
void smegma$setY(double y);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package me.retucio.camtweaks.util.render;
|
||||
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.RenderSetup;
|
||||
|
||||
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 RenderLayer GLOBAL_LINES;
|
||||
|
||||
public static RenderLayer getGlobalLines() {
|
||||
return GLOBAL_LINES;
|
||||
}
|
||||
public static RenderLayer getGlobalQuads() {
|
||||
return GLOBAL_QUADS;
|
||||
}
|
||||
|
||||
static {
|
||||
GLOBAL_QUADS = RenderLayer.of("global_fill", RenderSetup.builder(GLOBAL_QUADS_PIPELINE).build());
|
||||
GLOBAL_LINES = RenderLayer.of("global_lines", RenderSetup.builder(GLOBAL_LINES_PIPELINE).build());
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
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.VertexFormats;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
@@ -1,282 +0,0 @@
|
||||
package me.retucio.camtweaks.util.render;
|
||||
|
||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.render.*;
|
||||
import net.minecraft.client.render.state.OutlineRenderState;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.*;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
|
||||
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();
|
||||
|
||||
|
||||
// líneas
|
||||
|
||||
public static void drawHorizontalLine(MatrixStack matrices, float x1, float x2, float y, Color color) {
|
||||
if (x2 < x1) {
|
||||
float i = x1;
|
||||
x1 = x2;
|
||||
x2 = i;
|
||||
}
|
||||
|
||||
drawFilledRect(matrices, x1, y, x2 + 1, y + 1, color);
|
||||
}
|
||||
|
||||
public static void drawVerticalLine(MatrixStack matrices, float x, float y1, float y2, Color color) {
|
||||
if (y2 < y1) {
|
||||
float i = y1;
|
||||
y1 = y2;
|
||||
y2 = i;
|
||||
}
|
||||
|
||||
drawFilledRect(matrices, x, y1 + 1, x + 1, y2, color);
|
||||
}
|
||||
|
||||
public static void drawHorizontalLine(MatrixStack matrices, float x1, float x2, float y, Color color, float width) {
|
||||
if (x2 < x1) {
|
||||
float i = x1;
|
||||
x1 = x2;
|
||||
x2 = i;
|
||||
}
|
||||
|
||||
drawFilledRect(matrices, x1, y, x2 + width, y + width, color);
|
||||
}
|
||||
|
||||
public static void drawVerticalLine(MatrixStack matrices, float x, float y1, float y2, Color color, float width) {
|
||||
if (y2 < y1) {
|
||||
float i = y1;
|
||||
y1 = y2;
|
||||
y2 = i;
|
||||
}
|
||||
|
||||
drawFilledRect(matrices, x, y1 + width, x + width, y2, color);
|
||||
}
|
||||
|
||||
|
||||
// caras
|
||||
|
||||
public static void drawFilledRect(MatrixStack matrices, float x, float y, float width, float height, Color color) {
|
||||
float r = color.getRed() / 255f;
|
||||
float g = color.getGreen() / 255f;
|
||||
float b = color.getBlue() / 255f;
|
||||
float a = color.getAlpha() / 255f;
|
||||
|
||||
matrices.push();
|
||||
matrices.translate(0, 0, 0);
|
||||
|
||||
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
|
||||
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), x, y + height, 0).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), x + width, y + height, 0).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), x + width, y, 0).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), x, y, 0).color(r, g, b, a);
|
||||
|
||||
Layers.getGlobalQuads().draw(buffer.end());
|
||||
matrices.pop();
|
||||
}
|
||||
|
||||
public static void drawRectOutlines(MatrixStack stack, float x1, float y1, float x2, float y2, Color color, float width) {
|
||||
drawHorizontalLine(stack, x1, x2, y1, color, width);
|
||||
drawVerticalLine(stack, x2, y1, y2, color, width);
|
||||
drawHorizontalLine(stack, x1, x2, y2, color, width);
|
||||
drawVerticalLine(stack, x1, y1, y2, color, width);
|
||||
}
|
||||
|
||||
// expand es para evitar z-fighting
|
||||
public static void drawBlockFaceFilled(MatrixStack matrices, BlockPos pos, Direction face, Color color, float expand) {
|
||||
Vec3d cameraPos = mc.gameRenderer.getCamera().getCameraPos();
|
||||
|
||||
float minX = (float) (pos.getX() - cameraPos.x);
|
||||
float minY = (float) (pos.getY() - cameraPos.y);
|
||||
float minZ = (float) (pos.getZ() - cameraPos.z);
|
||||
float maxX = minX + 1;
|
||||
float maxY = minY + 1;
|
||||
float maxZ = minZ + 1;
|
||||
|
||||
float r = color.getRed() / 255f;
|
||||
float g = color.getGreen() / 255f;
|
||||
float b = color.getBlue() / 255f;
|
||||
float a = color.getAlpha() / 255f;
|
||||
|
||||
if (expand != 0) {
|
||||
switch (face) {
|
||||
case DOWN: minY -= expand; maxY = minY + 0.001f; break;
|
||||
case UP: minY = maxY; maxY += expand; break;
|
||||
case NORTH: minZ -= expand; maxZ = minZ + 0.001f; break;
|
||||
case SOUTH: minZ = maxZ; maxZ += expand; break;
|
||||
case WEST: minX -= expand; maxX = minX + 0.001f; break;
|
||||
case EAST: minX = maxX; maxX += expand; break;
|
||||
}
|
||||
}
|
||||
|
||||
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
|
||||
|
||||
switch (face) {
|
||||
case DOWN:
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, minZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, minZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, maxZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, maxZ).color(r, g, b, a);
|
||||
break;
|
||||
|
||||
case UP:
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, minZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, maxZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, maxZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, minZ).color(r, g, b, a);
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, minZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, minZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, minZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, minZ).color(r, g, b, a);
|
||||
break;
|
||||
|
||||
case SOUTH:
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, maxZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, maxZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, maxZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, maxZ).color(r, g, b, a);
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, minZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, maxZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, maxZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), minX, maxY, minZ).color(r, g, b, a);
|
||||
break;
|
||||
|
||||
case EAST:
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, minZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, minZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, maxY, maxZ).color(r, g, b, a);
|
||||
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, maxZ).color(r, g, b, a);
|
||||
break;
|
||||
}
|
||||
|
||||
Layers.getGlobalQuads().draw(buffer.end());
|
||||
}
|
||||
|
||||
|
||||
// cajas
|
||||
|
||||
public static void drawOutlineBox(MatrixStack matrices, Box box, Color color, float lineWidth) {
|
||||
Camera camera = mc.gameRenderer.getCamera();
|
||||
Vec3d cameraPos = camera.getCameraPos();
|
||||
|
||||
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(1 / camera.getPitch()));
|
||||
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(1 / (camera.getYaw() + 180f)));
|
||||
|
||||
VertexRendering.drawOutline(
|
||||
matrices,
|
||||
mc.getBufferBuilders()
|
||||
.getEntityVertexConsumers()
|
||||
.getBuffer(RenderLayers.lines()),
|
||||
VoxelShapes.cuboid(box),
|
||||
-cameraPos.x,
|
||||
-cameraPos.y,
|
||||
-cameraPos.z,
|
||||
color.getRGB(),
|
||||
lineWidth);
|
||||
}
|
||||
|
||||
public static void drawFilledBox(MatrixStack matrices, Box box, Color color) {
|
||||
Vec3d cameraPos = mc.gameRenderer.getCamera().getCameraPos();
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
// formas custom
|
||||
|
||||
public static void drawVoxelShapeOutline(MatrixStack matrices, VoxelShape voxelShape, BlockPos pos, Color color, float lineWidth) {
|
||||
if (voxelShape.isEmpty()) return;
|
||||
|
||||
voxelShape.forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> {
|
||||
Box box = new Box(
|
||||
pos.getX() + minX, pos.getY() + minY, pos.getZ() + minZ,
|
||||
pos.getX() + maxX, pos.getY() + maxY, pos.getZ() + maxZ
|
||||
);
|
||||
|
||||
drawOutlineBox(matrices, box, color, lineWidth);
|
||||
});
|
||||
}
|
||||
|
||||
public static void drawVoxelShapeFilled(MatrixStack matrices, VoxelShape voxelShape, BlockPos pos, Color color) {
|
||||
if (voxelShape.isEmpty()) return;
|
||||
|
||||
voxelShape.forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> {
|
||||
Box box = new Box(
|
||||
pos.getX() + minX, pos.getY() + minY, pos.getZ() + minZ,
|
||||
pos.getX() + maxX, pos.getY() + maxY, pos.getZ() + maxZ
|
||||
);
|
||||
|
||||
drawFilledBox(matrices, box, color);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// bloques
|
||||
|
||||
public static void drawBlockOutline(MatrixStack matrices, BlockPos pos, Color color, float lineWidth) {
|
||||
Box box = new Box(pos.getX(), pos.getY(), pos.getZ(),
|
||||
pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1);
|
||||
drawOutlineBox(matrices, box, color, lineWidth);
|
||||
}
|
||||
|
||||
public static void drawBlockFilled(MatrixStack matrices, BlockPos pos, Color color) {
|
||||
Box box = new Box(pos.getX(), pos.getY(), pos.getZ(),
|
||||
pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1);
|
||||
drawFilledBox(matrices, box, color);
|
||||
}
|
||||
}
|
||||
+38
-47
@@ -1,45 +1,44 @@
|
||||
package me.retucio.camtweaks;
|
||||
package me.retucio.sputnik;
|
||||
|
||||
|
||||
import me.retucio.camtweaks.command.CommandManager;
|
||||
import me.retucio.camtweaks.command.commands.BindCommand;
|
||||
import me.retucio.sputnik.cape.CapeManager;
|
||||
import me.retucio.sputnik.command.CommandManager;
|
||||
import me.retucio.sputnik.command.commands.BindCommand;
|
||||
|
||||
import me.retucio.camtweaks.config.ConfigManager;
|
||||
import me.retucio.sputnik.config.ConfigManager;
|
||||
|
||||
import me.retucio.camtweaks.event.EventBus;
|
||||
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||
import me.retucio.camtweaks.event.events.ShutdownEvent;
|
||||
import me.retucio.sputnik.event.EventBus;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import me.retucio.sputnik.event.events.ShutdownEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadCapeManagerEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadClickGUIEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadCommandManagerEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadModuleManagerEvent;
|
||||
|
||||
import me.retucio.camtweaks.event.events.camtweaks.LoadClickGUIEvent;
|
||||
import me.retucio.camtweaks.event.events.camtweaks.LoadCommandManagerEvent;
|
||||
import me.retucio.camtweaks.event.events.camtweaks.LoadModuleManagerEvent;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.Module;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.client.HUD;
|
||||
|
||||
import me.retucio.camtweaks.module.modules.client.HUD;
|
||||
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.hud.HudEditorScreen;
|
||||
import me.retucio.camtweaks.ui.hud.HudRenderer;
|
||||
import me.retucio.camtweaks.ui.widgets.buttons.settings.BindButton;
|
||||
import me.retucio.camtweaks.ui.widgets.buttons.SettingButton;
|
||||
import me.retucio.camtweaks.ui.widgets.buttons.settings.TextButton;
|
||||
import me.retucio.camtweaks.ui.widgets.frames.settings.ClientSettingsFrame;
|
||||
import me.retucio.camtweaks.ui.widgets.frames.SettingsFrame;
|
||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||
import me.retucio.sputnik.ui.hud.HudEditorScreen;
|
||||
import me.retucio.sputnik.ui.widgets.buttons.settings.BindButton;
|
||||
import me.retucio.sputnik.ui.widgets.buttons.SettingButton;
|
||||
import me.retucio.sputnik.ui.widgets.buttons.settings.TextButton;
|
||||
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
|
||||
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
|
||||
import me.retucio.sputnik.ui.widgets.Button;
|
||||
|
||||
import me.retucio.camtweaks.ui.widgets.Button;
|
||||
import me.retucio.camtweaks.util.*;
|
||||
import me.retucio.sputnik.util.*;
|
||||
import me.retucio.sputnik.util.render.DrawUtil;
|
||||
import me.retucio.sputnik.util.render.RenderUtil;
|
||||
|
||||
|
||||
import me.retucio.camtweaks.util.render.DrawUtil;
|
||||
import me.retucio.camtweaks.util.render.RenderUtil;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
|
||||
import net.minecraft.client.gui.screen.ingame.AbstractCommandBlockScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.AnvilScreen;
|
||||
@@ -50,43 +49,33 @@ import org.lwjgl.glfw.GLFW;
|
||||
|
||||
|
||||
|
||||
public class CameraTweaks implements ClientModInitializer {
|
||||
public class Sputnik implements ClientModInitializer {
|
||||
|
||||
// cosas necesarias
|
||||
public static final CameraTweaks INSTANCE = new CameraTweaks();
|
||||
public static final Sputnik INSTANCE = new Sputnik();
|
||||
public static final EventBus EVENT_BUS = new EventBus();
|
||||
public static final Logger LOGGER = LogManager.getLogger(CameraTweaks.class);
|
||||
public static final Logger LOGGER = LogManager.getLogger(Sputnik.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)
|
||||
public static final String MOD_ID = "sputnik";
|
||||
public static final String MOD_VERSION = FabricLoader.getInstance()
|
||||
.getModContainer(MOD_ID)
|
||||
.orElseThrow()
|
||||
.getMetadata()
|
||||
.getVersion()
|
||||
.getFriendlyString();
|
||||
}
|
||||
|
||||
|
||||
private Screen prevScreen;
|
||||
public static boolean settingsApplied = false;
|
||||
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
// por algún motivo aunque lo añada a los args de la JVM sigue siendo true a menos que haga esto??? puta vida
|
||||
System.setProperty("java.awt.headless", "false");
|
||||
|
||||
mc = MinecraftClient.getInstance();
|
||||
ConfigManager.load();
|
||||
|
||||
EVENT_BUS.register(this);
|
||||
|
||||
EVENT_BUS.register(HudRenderer.class);
|
||||
|
||||
EVENT_BUS.register(ChatUtil.class);
|
||||
EVENT_BUS.register(DrawUtil.class);
|
||||
EVENT_BUS.register(EntityUtil.class);
|
||||
@@ -97,6 +86,9 @@ public class CameraTweaks implements ClientModInitializer {
|
||||
|
||||
Lists.init();
|
||||
|
||||
CapeManager.INSTANCE = new CapeManager();
|
||||
EVENT_BUS.post(new LoadCapeManagerEvent());
|
||||
|
||||
ModuleManager.INSTANCE = new ModuleManager();
|
||||
EVENT_BUS.post(new LoadModuleManagerEvent());
|
||||
|
||||
@@ -108,7 +100,6 @@ public class CameraTweaks implements ClientModInitializer {
|
||||
EVENT_BUS.post(new LoadClickGUIEvent());
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
ConfigManager.save();
|
||||
EVENT_BUS.post(new ShutdownEvent());
|
||||
}));
|
||||
}
|
||||
@@ -127,7 +118,7 @@ public class CameraTweaks implements ClientModInitializer {
|
||||
|
||||
|
||||
// se ejecuta cada vez que se presiona una tecla
|
||||
public void onKeyPress(int key, int action) {
|
||||
public void onKey(int key, int action) {
|
||||
if (key == GLFW.GLFW_KEY_F3) return; // prevenir activación de módulos al usar combinaciones de F3
|
||||
ModuleManager.INSTANCE.getEnabledModules().forEach(module -> module.onKey(key, action));
|
||||
|
||||
@@ -173,7 +164,7 @@ public class CameraTweaks implements ClientModInitializer {
|
||||
// se ocupa de hacer los botones de ajustes que lo necesiten escuchar teclas
|
||||
private void handleSettingButtonsKey(int key, int action) {
|
||||
for (SettingsFrame sf : ClickGUI.INSTANCE.getSettingsFrames()) {
|
||||
for (SettingButton sb : sf.getButtons()) {
|
||||
for (SettingButton<?> sb : sf.getButtons()) {
|
||||
if (sb instanceof BindButton bb) bb.onKey(key, action);
|
||||
if (sb instanceof TextButton tb) tb.onKey(key, action);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package me.retucio.sputnik.cape;
|
||||
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.texture.NativeImage;
|
||||
import net.minecraft.client.texture.NativeImageBackedTexture;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class Cape {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
private final String name;
|
||||
private final Identifier id;
|
||||
private NativeImage img;
|
||||
private NativeImageBackedTexture texture;
|
||||
|
||||
public Cape(String name) {
|
||||
this.name = name;
|
||||
this.id = Identifier.of(Sputnik.MOD_ID, "textures/capes/" + name + ".png");
|
||||
}
|
||||
|
||||
public void load() {
|
||||
this.img = loadTexture(this.id);
|
||||
}
|
||||
|
||||
public NativeImage loadTexture(Identifier id) {
|
||||
try (InputStream inputStream = mc.getResourceManager().getResource(id).get().getInputStream()) {
|
||||
return NativeImage.read(inputStream);
|
||||
} catch (IOException e) {
|
||||
Sputnik.LOGGER.error("ups: {}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void register() {
|
||||
texture = new NativeImageBackedTexture(null, img);
|
||||
mc.getTextureManager().registerTexture(id, texture);
|
||||
img = null;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Identifier getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public NativeImageBackedTexture getTexture() {
|
||||
return texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name.replace('-', ' ');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package me.retucio.sputnik.cape;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static me.retucio.sputnik.Sputnik.mc;
|
||||
|
||||
public class CapeManager {
|
||||
|
||||
public static CapeManager INSTANCE;
|
||||
|
||||
private final List<Cape> capes = new ArrayList<>();
|
||||
|
||||
public CapeManager() {
|
||||
addCapes();
|
||||
}
|
||||
|
||||
public void addCapes() {
|
||||
addCape("sputnik");
|
||||
addCape("half-life");
|
||||
addCape("hollow-knight");
|
||||
|
||||
addCape("cherry-blossom");
|
||||
addCape("migrator");
|
||||
addCape("minecraft");
|
||||
addCape("pancakes");
|
||||
addCape("vanilla");
|
||||
|
||||
addCape("tiktok");
|
||||
addCape("twitch");
|
||||
|
||||
addCape("mojang");
|
||||
addCape("mojang-old");
|
||||
addCape("mojang-old-old");
|
||||
|
||||
addCape("minecon-2011");
|
||||
addCape("minecon-2012");
|
||||
addCape("minecon-2013");
|
||||
addCape("minecon-2015");
|
||||
addCape("minecon-2016");
|
||||
addCape("experience-2025");
|
||||
|
||||
addCape("15th-anniversary");
|
||||
addCape("bedrock");
|
||||
addCape("birthday");
|
||||
addCape("copper");
|
||||
addCape("eye-blossom");
|
||||
addCape("mcc-15");
|
||||
addCape("prismarine");
|
||||
addCape("turtle");
|
||||
addCape("valentine");
|
||||
|
||||
addCape("chinese-translator");
|
||||
addCape("cobalt");
|
||||
addCape("mojira-mod");
|
||||
addCape("millionth-customer");
|
||||
addCape("realms-mapmaker");
|
||||
addCape("scrolls-champion");
|
||||
addCape("translator");
|
||||
|
||||
addCape("cheapsh0t");
|
||||
addCape("dannybstyle");
|
||||
addCape("julianclark");
|
||||
addCape("mrmessiah");
|
||||
|
||||
for (Cape cape : capes) {
|
||||
mc.execute(cape::load);
|
||||
mc.execute(cape::register);
|
||||
}
|
||||
}
|
||||
|
||||
private void addCape(String name) {
|
||||
capes.add(new Cape(name));
|
||||
}
|
||||
|
||||
public Cape getCape(String name) {
|
||||
for (Cape cape : capes)
|
||||
if (cape.getName().equalsIgnoreCase(name))
|
||||
return cape;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Cape> getCapes() {
|
||||
return capes;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package me.retucio.camtweaks.command;
|
||||
package me.retucio.sputnik.command;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
@@ -65,7 +65,7 @@ public abstract class Command {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return me.retucio.camtweaks.command.CommandManager.INSTANCE.getPrefix() + name;
|
||||
return me.retucio.sputnik.command.CommandManager.INSTANCE.getPrefix() + name;
|
||||
}
|
||||
|
||||
public String toString(String... args) {
|
||||
+5
-6
@@ -1,11 +1,10 @@
|
||||
package me.retucio.camtweaks.command;
|
||||
package me.retucio.sputnik.command;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.command.commands.*;
|
||||
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.command.commands.*;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
@@ -49,7 +48,7 @@ public class CommandManager {
|
||||
for (Command command : commands) {
|
||||
for (Method method : command.getClass().getDeclaredMethods()) {
|
||||
if (method.isAnnotationPresent(SubscribeEvent.class)) {
|
||||
CameraTweaks.EVENT_BUS.register(command);
|
||||
Sputnik.EVENT_BUS.register(command);
|
||||
break;
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
package me.retucio.camtweaks.command.args;
|
||||
package me.retucio.sputnik.command.args;
|
||||
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
@@ -8,19 +8,19 @@ import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
|
||||
import com.mojang.brigadier.suggestion.Suggestions;
|
||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||
|
||||
import me.retucio.camtweaks.util.EntityUtil;
|
||||
import me.retucio.sputnik.util.EntityUtil;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
// para autocompletar entidades
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
import static me.retucio.sputnik.Sputnik.mc;
|
||||
|
||||
|
||||
// para autocompletar entidades
|
||||
public class EntityArgumentType implements ArgumentType<Entity> {
|
||||
|
||||
public static final EntityArgumentType INSTANCE = new EntityArgumentType();
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package me.retucio.camtweaks.command.args;
|
||||
package me.retucio.sputnik.command.args;
|
||||
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
@@ -7,8 +7,8 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
|
||||
import com.mojang.brigadier.suggestion.Suggestions;
|
||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.Module;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package me.retucio.camtweaks.command.args;
|
||||
package me.retucio.sputnik.command.args;
|
||||
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
@@ -15,7 +15,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
import static me.retucio.sputnik.Sputnik.mc;
|
||||
|
||||
// para autocompletar nombres de jugadores
|
||||
public class PlayerArgumentType implements ArgumentType<PlayerEntity> {
|
||||
+7
-7
@@ -1,12 +1,12 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.command.args.ModuleArgumentType;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.settings.KeySetting;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import me.retucio.camtweaks.util.KeyUtil;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.command.args.ModuleArgumentType;
|
||||
import me.retucio.sputnik.module.Module;
|
||||
import me.retucio.sputnik.module.settings.KeySetting;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import me.retucio.sputnik.util.KeyUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.misc.ScreenshotPlus;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ScreenshotPlus;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
// se usa principalmente para el módulo ScreenshotPlus, pero también se puede usar sin él supongo
|
||||
+7
-8
@@ -1,13 +1,12 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.CameraTweaks;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||
import me.retucio.camtweaks.event.events.TickEvent;
|
||||
import me.retucio.camtweaks.ui.screen.PreviewScreen;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import me.retucio.camtweaks.util.InventoryUtil;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import me.retucio.sputnik.event.events.TickEvent;
|
||||
import me.retucio.sputnik.ui.screen.PreviewScreen;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import me.retucio.sputnik.util.InventoryUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
// accede a los contenidos de tu enderchest
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.command.args.PlayerArgumentType;
|
||||
import me.retucio.camtweaks.util.MiscUtil;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.command.args.PlayerArgumentType;
|
||||
import me.retucio.sputnik.util.MiscUtil;
|
||||
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.ui.widgets.frames.settings.ClientSettingsFrame;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.util.interfaces.IChatHud;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.util.interfaces.IChatHud;
|
||||
import net.minecraft.client.gui.hud.ChatHud;
|
||||
import net.minecraft.client.gui.hud.ChatHudLine;
|
||||
import net.minecraft.command.CommandSource;
|
||||
@@ -31,7 +31,7 @@ public class PurgeCommand extends Command {
|
||||
ChatHud chatHud = mc.inGameHud.getChatHud();
|
||||
|
||||
synchronized (chatHud) {
|
||||
List<ChatHudLine.Visible> visibleMessages = ((IChatHud) chatHud).smegma$getVisibleMessages();
|
||||
List<ChatHudLine.Visible> visibleMessages = ((IChatHud) chatHud).sputnik$getVisibleMessages();
|
||||
int toRemove = Math.min(amount, visibleMessages.size());
|
||||
for (int i = 0; i < toRemove; i++)
|
||||
visibleMessages.removeFirst();
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.misc.ScreenshotPlus;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ScreenshotPlus;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
import java.io.IOException;
|
||||
+3
-4
@@ -1,9 +1,9 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.mixin.accessor.ClientPlayNetworkHandlerAccessor;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.mixin.accessor.ClientPlayNetworkHandlerAccessor;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.network.encryption.NetworkEncryptionUtils;
|
||||
@@ -11,7 +11,6 @@ import net.minecraft.network.message.LastSeenMessagesCollector;
|
||||
import net.minecraft.network.message.MessageBody;
|
||||
import net.minecraft.network.message.MessageSignatureData;
|
||||
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
+6
-7
@@ -1,12 +1,11 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.command.args.EntityArgumentType;
|
||||
import me.retucio.camtweaks.event.SubscribeEvent;
|
||||
import me.retucio.camtweaks.event.events.KeyEvent;
|
||||
import me.retucio.camtweaks.util.EntityUtil;
|
||||
import me.retucio.camtweaks.util.MiscUtil;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.command.args.EntityArgumentType;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import me.retucio.sputnik.event.events.KeyEvent;
|
||||
import me.retucio.sputnik.util.EntityUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.command.commands;
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.camtweaks.command.Command;
|
||||
import me.retucio.camtweaks.command.args.ModuleArgumentType;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.command.args.ModuleArgumentType;
|
||||
import me.retucio.sputnik.module.Module;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
// porque usar el ratón es más lento que escribir, a menos que tengas toque con el teclado como yo
|
||||
@@ -0,0 +1,357 @@
|
||||
package me.retucio.sputnik.config;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BinarySerializer {
|
||||
|
||||
private static final int MAGIC_NUMBER = 0x53505554; // "SPUT"
|
||||
private static final int VERSION = 1;
|
||||
|
||||
private static final byte TYPE_NULL = 0;
|
||||
private static final byte TYPE_BOOLEAN = 1;
|
||||
private static final byte TYPE_INT = 2;
|
||||
private static final byte TYPE_DOUBLE = 3;
|
||||
private static final byte TYPE_STRING = 4;
|
||||
private static final byte TYPE_MAP = 5;
|
||||
private static final byte TYPE_INT_ARRAY = 6;
|
||||
private static final byte TYPE_FRAME_DATA = 7;
|
||||
|
||||
public static void writeConfig(ClientConfig config, File file)
|
||||
throws IOException {
|
||||
try (DataOutputStream out = new DataOutputStream(
|
||||
new BufferedOutputStream(new FileOutputStream(file)))) {
|
||||
|
||||
// cabezal
|
||||
out.writeInt(MAGIC_NUMBER);
|
||||
out.writeInt(VERSION);
|
||||
|
||||
// mapas
|
||||
writeStringBooleanMap(out, config.moduleStates);
|
||||
writeSettingsMap(out, config.settings);
|
||||
writeStringIntArrayMap(out, config.settingsFrames);
|
||||
writeExtendableFrames(out, config.extendableFrames);
|
||||
writeStringIntArrayMap(out, config.hudPositions);
|
||||
writeStringBooleanMap(out, config.hudVisibilities);
|
||||
writeStringStringMap(out, config.hudImagePaths);
|
||||
|
||||
// posición de la barra de búsqueda
|
||||
if (config.searchBarPosition != null) {
|
||||
out.writeBoolean(true);
|
||||
out.writeInt(config.searchBarPosition[0]);
|
||||
out.writeInt(config.searchBarPosition[1]);
|
||||
} else {
|
||||
out.writeBoolean(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ClientConfig readConfig(File file)
|
||||
throws IOException {
|
||||
if (!file.exists() || file.length() == 0) {
|
||||
throw new IOException("archivo de config. vacío o inexistente");
|
||||
}
|
||||
|
||||
try (DataInputStream in = new DataInputStream(
|
||||
new BufferedInputStream(new FileInputStream(file)))) {
|
||||
|
||||
if (file.length() < 8) {
|
||||
throw new IOException("archivo demasiado pequeño para ser válido");
|
||||
}
|
||||
|
||||
// verificar cabezal
|
||||
int magic = in.readInt();
|
||||
if (magic != MAGIC_NUMBER) {
|
||||
throw new IOException("formato de archivo inválido: " + magic);
|
||||
}
|
||||
|
||||
int version = in.readInt();
|
||||
if (version != VERSION) {
|
||||
throw new IOException("versión inválida: " + version);
|
||||
}
|
||||
|
||||
ClientConfig config = new ClientConfig();
|
||||
|
||||
// leer mapas
|
||||
config.moduleStates = readStringBooleanMap(in);
|
||||
config.settings = readSettingsMap(in);
|
||||
config.settingsFrames = readStringIntArrayMap(in);
|
||||
config.extendableFrames = readExtendableFrames(in);
|
||||
config.hudPositions = readStringIntArrayMap(in);
|
||||
config.hudVisibilities = readStringBooleanMap(in);
|
||||
config.hudImagePaths = readStringStringMap(in);
|
||||
|
||||
// leer pos. de la barra de búsqueda
|
||||
if (in.readBoolean()) {
|
||||
config.searchBarPosition = new int[]{in.readInt(), in.readInt()};
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeStringBooleanMap(DataOutputStream out, Map<String, Boolean> map)
|
||||
throws IOException {
|
||||
if (map == null) {
|
||||
out.writeInt(0);
|
||||
return;
|
||||
}
|
||||
out.writeInt(map.size());
|
||||
for (Map.Entry<String, Boolean> entry : map.entrySet()) {
|
||||
writeString(out, entry.getKey());
|
||||
out.writeBoolean(entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<String, Boolean> readStringBooleanMap(DataInputStream in)
|
||||
throws IOException {
|
||||
int size = in.readInt();
|
||||
Map<String, Boolean> map = new HashMap<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
String key = readString(in);
|
||||
boolean value = in.readBoolean();
|
||||
map.put(key, value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private static void writeSettingsMap(DataOutputStream out, Map<String, Object> map)
|
||||
throws IOException {
|
||||
if (map == null) {
|
||||
out.writeInt(0);
|
||||
return;
|
||||
}
|
||||
out.writeInt(map.size());
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
writeString(out, entry.getKey());
|
||||
writeSettingValue(out, entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<String, Object> readSettingsMap(DataInputStream in)
|
||||
throws IOException {
|
||||
int size = in.readInt();
|
||||
Map<String, Object> map = new HashMap<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
String key = readString(in);
|
||||
Object value = readSettingValue(in);
|
||||
map.put(key, value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private static void writeSettingValue(DataOutputStream out, Object value)
|
||||
throws IOException {
|
||||
switch (value) {
|
||||
case Boolean b -> {
|
||||
out.writeByte(TYPE_BOOLEAN);
|
||||
out.writeBoolean(b);
|
||||
}
|
||||
case Integer i -> {
|
||||
out.writeByte(TYPE_INT);
|
||||
out.writeInt(i);
|
||||
}
|
||||
case Double v -> {
|
||||
out.writeByte(TYPE_DOUBLE);
|
||||
out.writeDouble(v);
|
||||
}
|
||||
case String s -> {
|
||||
out.writeByte(TYPE_STRING);
|
||||
writeString(out, s);
|
||||
}
|
||||
case Map<?, ?> map -> {
|
||||
out.writeByte(TYPE_MAP);
|
||||
writeGenericMap(out, map);
|
||||
} // fallback
|
||||
case null, default -> out.writeByte(TYPE_NULL);
|
||||
}
|
||||
}
|
||||
|
||||
private static Object readSettingValue(DataInputStream in) throws IOException {
|
||||
byte type = in.readByte();
|
||||
return switch (type) {
|
||||
case TYPE_BOOLEAN -> in.readBoolean();
|
||||
case TYPE_INT -> in.readInt();
|
||||
case TYPE_DOUBLE -> in.readDouble();
|
||||
case TYPE_STRING -> readString(in);
|
||||
case TYPE_MAP -> readGenericMap(in);
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private static void writeGenericMap(DataOutputStream out, Map<?, ?> map)
|
||||
throws IOException {
|
||||
if (map == null) {
|
||||
out.writeInt(0);
|
||||
return;
|
||||
}
|
||||
out.writeInt(map.size());
|
||||
for (Map.Entry<?, ?> entry : map.entrySet()) {
|
||||
writeObject(out, entry.getKey());
|
||||
writeObject(out, entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<Object, Object> readGenericMap(DataInputStream in)
|
||||
throws IOException {
|
||||
int size = in.readInt();
|
||||
Map<Object, Object> map = new HashMap<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
Object key = readObject(in);
|
||||
Object value = readObject(in);
|
||||
map.put(key, value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private static void writeObject(DataOutputStream out, Object obj)
|
||||
throws IOException {
|
||||
switch (obj) {
|
||||
case String s -> {
|
||||
out.writeByte(TYPE_STRING);
|
||||
writeString(out, s);
|
||||
}
|
||||
case Boolean b -> {
|
||||
out.writeByte(TYPE_BOOLEAN);
|
||||
out.writeBoolean(b);
|
||||
}
|
||||
case Number number -> {
|
||||
if (obj instanceof Integer) {
|
||||
out.writeByte(TYPE_INT);
|
||||
out.writeInt((Integer) obj);
|
||||
} else if (obj instanceof Double) {
|
||||
out.writeByte(TYPE_DOUBLE);
|
||||
out.writeDouble((Double) obj);
|
||||
}
|
||||
}
|
||||
default -> {
|
||||
out.writeByte(TYPE_STRING);
|
||||
writeString(out, obj.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Object readObject(DataInputStream in) throws IOException {
|
||||
byte type = in.readByte();
|
||||
return switch (type) {
|
||||
case TYPE_STRING -> readString(in);
|
||||
case TYPE_BOOLEAN -> in.readBoolean();
|
||||
case TYPE_INT -> in.readInt();
|
||||
case TYPE_DOUBLE -> in.readDouble();
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private static void writeStringIntArrayMap(DataOutputStream out, Map<String, int[]> map)
|
||||
throws IOException {
|
||||
if (map == null) {
|
||||
out.writeInt(0);
|
||||
return;
|
||||
}
|
||||
out.writeInt(map.size());
|
||||
for (Map.Entry<String, int[]> entry : map.entrySet()) {
|
||||
writeString(out, entry.getKey());
|
||||
int[] array = entry.getValue();
|
||||
if (array == null) {
|
||||
out.writeInt(0);
|
||||
} else {
|
||||
out.writeInt(array.length);
|
||||
for (int value : array) {
|
||||
out.writeInt(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<String, int[]> readStringIntArrayMap(DataInputStream in)
|
||||
throws IOException {
|
||||
int size = in.readInt();
|
||||
Map<String, int[]> map = new HashMap<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
String key = readString(in);
|
||||
int arraySize = in.readInt();
|
||||
int[] array = new int[arraySize];
|
||||
for (int j = 0; j < arraySize; j++) {
|
||||
array[j] = in.readInt();
|
||||
}
|
||||
map.put(key, array);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private static void writeExtendableFrames(DataOutputStream out, Map<String, ClientConfig.FrameData> map)
|
||||
throws IOException {
|
||||
if (map == null) {
|
||||
out.writeInt(0);
|
||||
return;
|
||||
}
|
||||
out.writeInt(map.size());
|
||||
for (Map.Entry<String, ClientConfig.FrameData> entry : map.entrySet()) {
|
||||
writeString(out, entry.getKey());
|
||||
ClientConfig.FrameData data = entry.getValue();
|
||||
out.writeInt(data.x());
|
||||
out.writeInt(data.y());
|
||||
out.writeBoolean(data.extended());
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<String, ClientConfig.FrameData> readExtendableFrames(DataInputStream in)
|
||||
throws IOException {
|
||||
int size = in.readInt();
|
||||
Map<String, ClientConfig.FrameData> map = new HashMap<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
String key = readString(in);
|
||||
int x = in.readInt();
|
||||
int y = in.readInt();
|
||||
boolean extended = in.readBoolean();
|
||||
map.put(key, new ClientConfig.FrameData(x, y, extended));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private static void writeStringStringMap(DataOutputStream out, Map<String, String> map)
|
||||
throws IOException {
|
||||
if (map == null) {
|
||||
out.writeInt(0);
|
||||
return;
|
||||
}
|
||||
out.writeInt(map.size());
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
writeString(out, entry.getKey());
|
||||
writeString(out, entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<String, String> readStringStringMap(DataInputStream in)
|
||||
throws IOException {
|
||||
int size = in.readInt();
|
||||
Map<String, String> map = new HashMap<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
String key = readString(in);
|
||||
String value = readString(in);
|
||||
map.put(key, value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// Optimized string writing (UTF-8 with length prefix)
|
||||
private static void writeString(DataOutputStream out, String str) throws IOException {
|
||||
if (str == null) {
|
||||
out.writeInt(-1);
|
||||
return;
|
||||
}
|
||||
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
|
||||
out.writeInt(bytes.length);
|
||||
out.write(bytes);
|
||||
}
|
||||
|
||||
private static String readString(DataInputStream in) throws IOException {
|
||||
int length = in.readInt();
|
||||
if (length == -1) return null;
|
||||
byte[] bytes = new byte[length];
|
||||
in.readFully(bytes);
|
||||
return new String(bytes, "UTF-8");
|
||||
}
|
||||
}
|
||||
+16
-10
@@ -1,15 +1,17 @@
|
||||
package me.retucio.camtweaks.config;
|
||||
package me.retucio.sputnik.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.screen.ClickGUI;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.*;
|
||||
import me.retucio.sputnik.module.settings.*;
|
||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
|
||||
import static me.retucio.sputnik.Sputnik.mc;
|
||||
|
||||
// clase donde se guardan las configuraciones temporalmente hasta escribirlas en camera_tweaks.json
|
||||
public class ClientConfig {
|
||||
@@ -32,6 +34,9 @@ public class ClientConfig {
|
||||
// id del elemento del hud -> true: visible / false: no visible
|
||||
public Map<String, Boolean> hudVisibilities = new HashMap<>();
|
||||
|
||||
// id del elemento del hud -> ruta de la imagen (NEW)
|
||||
public Map<String, String> hudImagePaths = new HashMap<>();
|
||||
|
||||
// posición de la barra de búsqueda (x, y)
|
||||
public int[] searchBarPosition = new int[]{340, 16};
|
||||
|
||||
@@ -59,7 +64,7 @@ public class ClientConfig {
|
||||
case StringSetting s: value = s.getValue(); break;
|
||||
case ListSetting l: value = l.getConfigValues(); break;
|
||||
case ColorSetting c: value = c.getConfigValue(); break;
|
||||
case OptionSetting o: value = o.getIndex(); break;
|
||||
case OptionSetting o: value = o.getDisplayName(); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -68,7 +73,6 @@ public class ClientConfig {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onOpenSettingsFrame(SettingsFrameEvent.Open event) {
|
||||
if (settingsFrames.containsKey(event.getFrame().module.getName())) return;
|
||||
ConfigManager.setFramePosition(event.getFrame());
|
||||
}
|
||||
|
||||
@@ -116,5 +120,7 @@ public class ClientConfig {
|
||||
ClickGUI.INSTANCE.getGuiSettingsFrame().extended));
|
||||
}
|
||||
|
||||
public record FrameData(int x, int y, boolean extended) {}
|
||||
public record FrameData(int x, int y, boolean extended) implements Serializable {
|
||||
@Serial private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
+82
-54
@@ -1,29 +1,30 @@
|
||||
package me.retucio.camtweaks.config;
|
||||
package me.retucio.sputnik.config;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
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.widgets.frames.ModuleFrame;
|
||||
import me.retucio.camtweaks.ui.screen.ClickGUI;
|
||||
import me.retucio.camtweaks.ui.widgets.frames.settings.ClientSettingsFrame;
|
||||
import me.retucio.camtweaks.ui.widgets.frames.SettingsFrame;
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.module.Module;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.settings.*;
|
||||
import me.retucio.sputnik.ui.widgets.Frame;
|
||||
import me.retucio.sputnik.ui.widgets.frames.ModuleFrame;
|
||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
|
||||
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
// se ocupa de guardar, cargar y aplicar ajustes
|
||||
// pues no me ha dado dolores de cabeza el coso este con los NPE de los cojones...
|
||||
public class ConfigManager {
|
||||
|
||||
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
||||
private static final File CONFIG_FILE = new File("camera_tweaks.json");
|
||||
private static final File CONFIG_FILE = new File("sputnik.dat");
|
||||
private static final File LEGACY_JSON_FILE = new File("sputnik.json");
|
||||
|
||||
private static boolean loaded = false;
|
||||
private static ClientConfig config = null;
|
||||
@@ -33,33 +34,47 @@ public class ConfigManager {
|
||||
|
||||
// guardar configuraciones
|
||||
public static void save() {
|
||||
if (!loaded) return;
|
||||
ensureConfig();
|
||||
|
||||
try (FileWriter writer = new FileWriter(CONFIG_FILE)) {
|
||||
GSON.toJson(config, writer);
|
||||
CameraTweaks.LOGGER.info("ajustes guardados");
|
||||
try {
|
||||
BinarySerializer.writeConfig(config, CONFIG_FILE);
|
||||
Sputnik.LOGGER.info("ajustes guardados");
|
||||
} catch (IOException e) {
|
||||
CameraTweaks.LOGGER.error("error al guardar ajustes", e);
|
||||
Sputnik.LOGGER.error("error al guardar ajustes", e);
|
||||
}
|
||||
}
|
||||
|
||||
// cargar configuraciones
|
||||
public static void load() {
|
||||
CameraTweaks.LOGGER.info("cargando ajustes...");
|
||||
Sputnik.LOGGER.info("cargando ajustes...");
|
||||
|
||||
if (!CONFIG_FILE.exists()) {
|
||||
ensureConfig();
|
||||
save();
|
||||
return;
|
||||
if (CONFIG_FILE.exists()) {
|
||||
try {
|
||||
config = BinarySerializer.readConfig(CONFIG_FILE);
|
||||
Sputnik.LOGGER.info("ajustes cargados");
|
||||
return;
|
||||
} catch (IOException e) {
|
||||
Sputnik.LOGGER.error("error cargando ajustes, intentando json", e);
|
||||
}
|
||||
}
|
||||
|
||||
try (FileReader reader = new FileReader(CONFIG_FILE)) {
|
||||
config = GSON.fromJson(reader, ClientConfig.class);
|
||||
CameraTweaks.LOGGER.info("ajustes cargados");
|
||||
} catch (IOException e) {
|
||||
CameraTweaks.LOGGER.error("no se pudieron cargar los ajustes, usando ajustes por defecto", e);
|
||||
ensureConfig();
|
||||
// Fallback to legacy JSON
|
||||
if (LEGACY_JSON_FILE.exists()) {
|
||||
try (FileReader reader = new FileReader(LEGACY_JSON_FILE)) {
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
config = gson.fromJson(reader, ClientConfig.class);
|
||||
Sputnik.LOGGER.info("ajustes json cargados (migración)");
|
||||
|
||||
save();
|
||||
return;
|
||||
} catch (IOException e) {
|
||||
Sputnik.LOGGER.error("error cargando json, usando defaults", e);
|
||||
}
|
||||
}
|
||||
|
||||
// crear nuevo config
|
||||
ensureConfig();
|
||||
save();
|
||||
}
|
||||
|
||||
// aplicar configuraciones cargadas
|
||||
@@ -74,7 +89,7 @@ public class ConfigManager {
|
||||
applyExtendableFrames();
|
||||
|
||||
loaded = true;
|
||||
CameraTweaks.LOGGER.info("ajustes aplicados");
|
||||
Sputnik.LOGGER.info("ajustes aplicados");
|
||||
}
|
||||
|
||||
// obtener configuración actual
|
||||
@@ -100,7 +115,10 @@ public class ConfigManager {
|
||||
|
||||
public static void setFramePosition(SettingsFrame frame) {
|
||||
ensureConfig();
|
||||
config.settingsFrames.put(frame.module.getName(), new int[] {frame.getX(), frame.getY()});
|
||||
if (!config.settingsFrames.containsKey(frame.module.getName()))
|
||||
config.settingsFrames.put(frame.module.getName(), new int[] {frame.getX(), frame.getY()});
|
||||
else
|
||||
config.settingsFrames.replace(frame.module.getName(), new int[] {frame.getX(), frame.getY()});
|
||||
save();
|
||||
}
|
||||
|
||||
@@ -122,6 +140,17 @@ public class ConfigManager {
|
||||
save();
|
||||
}
|
||||
|
||||
public static void setHudImagePath(String id, String imagePath) {
|
||||
ensureConfig();
|
||||
config.hudImagePaths.put(id, imagePath);
|
||||
save();
|
||||
}
|
||||
|
||||
public static String getHudImagePath(String id) {
|
||||
ensureConfig();
|
||||
return config.hudImagePaths.getOrDefault(id, "");
|
||||
}
|
||||
|
||||
public static void setSearchBarPosition(int x, int y) {
|
||||
ensureConfig();
|
||||
config.searchBarPosition = new int[] {x, y};
|
||||
@@ -148,7 +177,7 @@ public class ConfigManager {
|
||||
case ListSetting listSetting -> applyListSetting(listSetting, value);
|
||||
case ColorSetting colorSetting -> applyColorSetting(colorSetting, value);
|
||||
case OptionSetting optionSetting -> applyOptionSetting(optionSetting, value);
|
||||
default -> CameraTweaks.LOGGER.warn("watafac queseso: {}", setting.getClass().getSimpleName());
|
||||
default -> Sputnik.LOGGER.warn("watafac queseso: {}", setting.getClass().getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,14 +187,14 @@ public class ConfigManager {
|
||||
module.setEnabled(config.moduleStates.get(module.getName()));
|
||||
}
|
||||
});
|
||||
CameraTweaks.LOGGER.info("estados de módulos aplicados");
|
||||
Sputnik.LOGGER.info("estados de módulos aplicados");
|
||||
}
|
||||
|
||||
private static void applyModuleSettings() {
|
||||
ModuleManager.INSTANCE.getModules().forEach(module -> {
|
||||
module.getSettings().forEach(setting -> applySetting(module, setting));
|
||||
});
|
||||
CameraTweaks.LOGGER.info("ajustes de módulos aplicados");
|
||||
Sputnik.LOGGER.info("ajustes de módulos aplicados");
|
||||
}
|
||||
|
||||
private static void applySettingsFrames() {
|
||||
@@ -173,7 +202,7 @@ public class ConfigManager {
|
||||
Module module = ModuleManager.INSTANCE.getModuleByName(moduleName);
|
||||
ClickGUI.INSTANCE.openSettingsFrame(module, position[0], position[1]);
|
||||
});
|
||||
CameraTweaks.LOGGER.info("estados de marcos de ajustes aplicados");
|
||||
Sputnik.LOGGER.info("estados de marcos de ajustes aplicados");
|
||||
}
|
||||
|
||||
private static void applySearchBarPosition() {
|
||||
@@ -181,7 +210,7 @@ public class ConfigManager {
|
||||
ClickGUI.INSTANCE.getSearchBar().setX(config.searchBarPosition[0]);
|
||||
ClickGUI.INSTANCE.getSearchBar().setY(config.searchBarPosition[1]);
|
||||
}
|
||||
CameraTweaks.LOGGER.info("posición de la barra de búsqueda aplicada");
|
||||
Sputnik.LOGGER.info("posición de la barra de búsqueda aplicada");
|
||||
}
|
||||
|
||||
private static void applyGuiSettings() {
|
||||
@@ -189,32 +218,33 @@ public class ConfigManager {
|
||||
ClientSettingsFrame.guiSettings.getSettings().forEach(setting -> {
|
||||
applySetting(ClientSettingsFrame.guiSettings, setting);
|
||||
});
|
||||
CameraTweaks.LOGGER.info("ajustes del cliente aplicados");
|
||||
Sputnik.LOGGER.info("ajustes del cliente aplicados");
|
||||
}
|
||||
|
||||
private static void applyExtendableFrames() {
|
||||
applyExtendableFrame(ClickGUI.INSTANCE.getModulesFrame());
|
||||
applyExtendableFrame(ClickGUI.INSTANCE.getGuiSettingsFrame());
|
||||
|
||||
CameraTweaks.LOGGER.info("posiciones de marcos extendibles aplicadasa");
|
||||
Sputnik.LOGGER.info("posiciones de marcos extendibles aplicadas");
|
||||
ClickGUI.INSTANCE.refreshListButtons();
|
||||
}
|
||||
|
||||
private static void applyExtendableFrame(ModuleFrame frame) {
|
||||
ClientConfig.FrameData frameData = config.extendableFrames.get("M");
|
||||
if (frameData != null) {
|
||||
frame.setX(frameData.x());
|
||||
frame.setY(frameData.y());
|
||||
frame.extended = frameData.extended();
|
||||
}
|
||||
}
|
||||
private static void applyExtendableFrame(Frame<?> frame) {
|
||||
ClientConfig.FrameData frameData = null;
|
||||
if (frame instanceof ModuleFrame)
|
||||
frameData = config.extendableFrames.get("M");
|
||||
|
||||
if (frame instanceof ClientSettingsFrame)
|
||||
frameData = config.extendableFrames.get("S");
|
||||
|
||||
private static void applyExtendableFrame(ClientSettingsFrame frame) {
|
||||
ClientConfig.FrameData frameData = config.extendableFrames.get("S");
|
||||
if (frameData != null) {
|
||||
frame.setX(frameData.x());
|
||||
frame.setY(frameData.y());
|
||||
frame.extended = frameData.extended();
|
||||
|
||||
if (frame instanceof ModuleFrame mFrame)
|
||||
mFrame.extended = frameData.extended();
|
||||
if (frame instanceof ClientSettingsFrame sFrame)
|
||||
sFrame.extended = frameData.extended();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,9 +316,8 @@ public class ConfigManager {
|
||||
}
|
||||
|
||||
private static <T> void applyOptionSetting(OptionSetting<T> setting, Object value) {
|
||||
if (value instanceof Double) {
|
||||
int index = ((Double) value).intValue();
|
||||
setting.setValue(setting.getOption(index));
|
||||
if (value instanceof String name) {
|
||||
setting.setValueByName(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,10 +332,9 @@ public class ConfigManager {
|
||||
// ------------------ MÉTODOS DE AYUDA ------------------
|
||||
|
||||
private static boolean shouldApply() {
|
||||
return CameraTweaks.mc != null && ModuleManager.INSTANCE != null && config != null;
|
||||
return Sputnik.mc != null && ModuleManager.INSTANCE != null && config != null;
|
||||
}
|
||||
|
||||
|
||||
private static void ensureConfig() {
|
||||
if (config == null) config = new ClientConfig();
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.camtweaks.event;
|
||||
package me.retucio.sputnik.event;
|
||||
|
||||
// evento base, cancelable (usado en mixins)
|
||||
public class Event {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.camtweaks.event;
|
||||
package me.retucio.sputnik.event;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.camtweaks.event;
|
||||
package me.retucio.sputnik.event;
|
||||
|
||||
public enum Stage {
|
||||
PRE, // antes de que haya sucedido
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.camtweaks.event;
|
||||
package me.retucio.sputnik.event;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ClientWorldMixin#onAddEntity
|
||||
* @see me.retucio.sputnik.mixin.ClientWorldMixin#onAddEntity
|
||||
*/
|
||||
public class AddEntityEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ClientPlayerInteractionManagerMixin#onAttackEntity
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onAttackEntity
|
||||
*/
|
||||
public class AttackEntityEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ClientPlayerInteractionManagerMixin#onBlockBreak
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onBlockBreak
|
||||
*/
|
||||
public class BreakBlockEvent extends Event {
|
||||
|
||||
+5
-5
@@ -1,12 +1,12 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.EntityMixin#onRotation
|
||||
* @see me.retucio.camtweaks.mixin.EntityMixin#onChangeYaw
|
||||
* @see me.retucio.camtweaks.mixin.EntityMixin#onChangePitch
|
||||
* @see me.retucio.sputnik.mixin.EntityMixin#onRotation
|
||||
* @see me.retucio.sputnik.mixin.EntityMixin#onChangeYaw
|
||||
* @see me.retucio.sputnik.mixin.EntityMixin#onChangePitch
|
||||
*/
|
||||
public class ChangeRotationEvent extends Event {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ChunkOcclusionDataBuilderMixin#onChunkOcclusion
|
||||
*/
|
||||
public class ChunkOcclusionEvent extends Event {}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.module.modules.misc.ChatPlus;
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import net.minecraft.text.ClickEvent;
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
public class ClipAtLedgeEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ItemStackMixin#onDamage
|
||||
* @see me.retucio.sputnik.mixin.ItemStackMixin#onDamage
|
||||
*/
|
||||
public class DamageItemEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.client.network.ServerInfo;
|
||||
import net.minecraft.network.DisconnectionInfo;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ClientConnectionMixin#onDisconnect
|
||||
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onDisconnect
|
||||
*/
|
||||
public class DisconnectEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.GameRendererMixin#modifyFov
|
||||
* @see me.retucio.sputnik.mixin.GameRendererMixin#modifyFov
|
||||
*/
|
||||
public class GetFOVEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ClientPlayerInteractionManagerMixin#onEntityInteract
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onEntityInteract
|
||||
*/
|
||||
public class InteractEntityEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package me.retucio.camtweaks.event;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.MinecraftClientMixin#onJoinWorld
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onJoinWorld
|
||||
*/
|
||||
public class JoinWorldEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.KeyboardMixin#onKeyPress
|
||||
* @see me.retucio.sputnik.mixin.KeyboardMixin#onKeyPress
|
||||
*/
|
||||
public class KeyEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.MouseMixin#onMouseButton
|
||||
* @see me.retucio.sputnik.mixin.MouseMixin#onMouseButton
|
||||
*/
|
||||
public class MouseClickEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.MouseMixin#onMouseScroll
|
||||
* @see me.retucio.sputnik.mixin.MouseMixin#onMouseScroll
|
||||
*/
|
||||
public class MouseScrollEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.MinecraftClientMixin#onOpenScreen
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onOpenScreen
|
||||
*/
|
||||
public class OpenScreenEvent extends Event {
|
||||
|
||||
+6
-8
@@ -1,16 +1,14 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.camtweaks.event.Stage;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import me.retucio.sputnik.event.Stage;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ClientConnectionMixin#onSendPacketPre
|
||||
* @see me.retucio.camtweaks.mixin.ClientConnectionMixin#onSendPacketPost
|
||||
* @see me.retucio.camtweaks.mixin.ClientConnectionMixin#onReceivePacket
|
||||
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onSendPacketPre
|
||||
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onSendPacketPost
|
||||
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onReceivePacket
|
||||
*/
|
||||
public class PacketEvent {
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.client.option.Perspective;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.GameOptionsMixin#changePerspective
|
||||
* @see me.retucio.sputnik.mixin.GameOptionsMixin#changePerspective
|
||||
*/
|
||||
public class PerspectiveChangeEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ClientPlayerInteractionManagerMixin#onBlockPlace
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onBlockPlace
|
||||
*/
|
||||
public class PlaceBlockEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.client.gui.hud.MessageIndicator;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ChatHudMixin#onAddMessage
|
||||
* @see me.retucio.sputnik.mixin.ChatHudMixin#onAddMessage
|
||||
*/
|
||||
public class ReceiveMessageEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ClientWorldMixin#onRemoveEntity
|
||||
* @see me.retucio.sputnik.mixin.ClientWorldMixin#onRemoveEntity
|
||||
*/
|
||||
public class RemoveEntityEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.HeldItemRendererMixin#onRenderArm
|
||||
* @see me.retucio.sputnik.mixin.HeldItemRendererMixin#onRenderArm
|
||||
*/
|
||||
public class RenderArmEvent extends Event {
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.client.gui.hud.ClientBossBar;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
@@ -8,9 +8,9 @@ import java.util.Iterator;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.BossBarHudMixin#modifyBossBarIterator
|
||||
* @see me.retucio.camtweaks.mixin.BossBarHudMixin#modifyBossBarName
|
||||
* @see me.retucio.camtweaks.mixin.BossBarHudMixin#modifySpacingConstant
|
||||
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifyBossBarIterator
|
||||
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifyBossBarName
|
||||
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifySpacingConstant
|
||||
*/
|
||||
public class RenderBossbarEvent {
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.HeldItemRendererMixin#onRenderItem
|
||||
* @see me.retucio.sputnik.mixin.HeldItemRendererMixin#onRenderItem
|
||||
*/
|
||||
public class RenderHeldItemEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.client.render.Camera;
|
||||
import net.minecraft.client.render.RenderTickCounter;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.WorldRendererMixin#render
|
||||
* @see me.retucio.sputnik.mixin.WorldRendererMixin#render
|
||||
*/
|
||||
public class RenderWorldEvent extends Event {
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.ClientPlayNetworkHandlerMixin#onSendMessage
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayNetworkHandlerMixin#onSendMessage
|
||||
*/
|
||||
public class SendMessageEvent extends Event {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onStop
|
||||
*/
|
||||
public class ShutdownEvent extends Event {
|
||||
|
||||
public ShutdownEvent() {}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onTickPre
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onTickPost
|
||||
*/
|
||||
public class TickEvent {
|
||||
|
||||
public static class Pre extends Event {}
|
||||
public static class Post extends Event {}
|
||||
}
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
package me.retucio.camtweaks.event.events;
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.camtweaks.mixin.MinecraftClientMixin#onUseItem
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onUseItem
|
||||
*/
|
||||
public class UseItemEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.camtweaks.event.events.camtweaks;
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
// se genera cada que se interactúa con el marco de ajustes de la interfaz
|
||||
public class GUISettingsFrameEvent {
|
||||
@@ -0,0 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
// se genera cuando carga el gestor de capas
|
||||
public class LoadCapeManagerEvent extends Event {}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.camtweaks.event.events.camtweaks;
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
// se genera cuando carga la interfaz del mod
|
||||
public class LoadClickGUIEvent extends Event {}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.camtweaks.event.events.camtweaks;
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
// se genera cuando carga el gestor de comandos
|
||||
public class LoadCommandManagerEvent extends Event {}
|
||||
@@ -0,0 +1,23 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
public class LoadConfigEvent extends Event {
|
||||
|
||||
private final boolean failed;
|
||||
private final boolean fileExisted;
|
||||
|
||||
|
||||
public LoadConfigEvent(boolean failed, boolean fileExisted) {
|
||||
this.failed = failed;
|
||||
this.fileExisted = fileExisted;
|
||||
}
|
||||
|
||||
public boolean hasFailed() {
|
||||
return failed;
|
||||
}
|
||||
|
||||
public boolean didFileExist() {
|
||||
return fileExisted;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.camtweaks.event.events.camtweaks;
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
// se genera cuando carga el gestor de módulos
|
||||
public class LoadModuleManagerEvent extends Event {}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.camtweaks.event.events.camtweaks;
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
// se genera cada que se interactúa con el marco de módulos
|
||||
public class ModuleFrameEvent {
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package me.retucio.camtweaks.event.events.camtweaks;
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.camtweaks.ui.widgets.frames.SettingsFrame;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
|
||||
|
||||
// se genera cada que se interactúa con un marco de ajustes de un módulo
|
||||
public class SettingsFrameEvent {
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package me.retucio.camtweaks.event.events.camtweaks;
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.camtweaks.module.Module;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import me.retucio.sputnik.module.Module;
|
||||
|
||||
// se genera cada que se enciende o apaga un módulo
|
||||
public class ToggleModuleEvent extends Event {
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package me.retucio.camtweaks.event.events.camtweaks;
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
|
||||
import me.retucio.camtweaks.event.Event;
|
||||
import me.retucio.camtweaks.module.settings.Setting;
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import me.retucio.sputnik.module.settings.Setting;
|
||||
|
||||
// se genera cada que se cambia el valor de un ajuste
|
||||
public class UpdateSettingEvent extends Event {
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import me.retucio.camtweaks.event.events.RenderBossbarEvent;
|
||||
import me.retucio.sputnik.event.events.RenderBossbarEvent;
|
||||
import net.minecraft.client.gui.hud.BossBarHud;
|
||||
import net.minecraft.client.gui.hud.ClientBossBar;
|
||||
import net.minecraft.text.Text;
|
||||
@@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.EVENT_BUS;
|
||||
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
|
||||
|
||||
@Mixin(BossBarHud.class)
|
||||
public abstract class BossBarHudMixin {
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap;
|
||||
import me.retucio.camtweaks.util.render.GlintRenderLayer;
|
||||
import me.retucio.sputnik.util.render.GlintRenderLayer;
|
||||
import net.minecraft.client.render.BufferBuilderStorage;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.util.BufferAllocator;
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.camera.Freelook;
|
||||
import me.retucio.camtweaks.module.modules.camera.Freecam;
|
||||
import me.retucio.camtweaks.module.modules.camera.PerspectivePlus;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.camera.Freelook;
|
||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||
import me.retucio.sputnik.module.modules.camera.PerspectivePlus;
|
||||
import net.minecraft.client.render.Camera;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
@@ -0,0 +1,26 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.player.Capes;
|
||||
import net.minecraft.client.render.command.OrderedRenderCommandQueue;
|
||||
import net.minecraft.client.render.entity.feature.CapeFeatureRenderer;
|
||||
import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.AssetInfo;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
||||
@Mixin(CapeFeatureRenderer.class)
|
||||
public abstract class CapeFeatureRendererMixin {
|
||||
|
||||
@ModifyExpressionValue(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/command/OrderedRenderCommandQueue;ILnet/minecraft/client/render/entity/state/PlayerEntityRenderState;FF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/SkinTextures;cape()Lnet/minecraft/util/AssetInfo$TextureAsset;"))
|
||||
private AssetInfo.TextureAsset modifyCapeTexture(AssetInfo.TextureAsset original, MatrixStack matrices, OrderedRenderCommandQueue entityRenderCommandQueue, int i, PlayerEntityRenderState state, float f, float g) {
|
||||
Capes capes = ModuleManager.INSTANCE.getModuleByClass(Capes.class);
|
||||
if (!capes.isEnabled()) return original;
|
||||
|
||||
Identifier id = capes.cape.getValue().getId();
|
||||
return id == null ? original : new AssetInfo.TextureAssetInfo(id, id);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -1,7 +1,7 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import me.retucio.camtweaks.util.interfaces.IChatHudLine;
|
||||
import me.retucio.sputnik.util.interfaces.IChatHudLine;
|
||||
import net.minecraft.client.gui.hud.ChatHudLine;
|
||||
import net.minecraft.text.Text;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
@@ -22,17 +22,17 @@ public class ChatHudLineMixin implements IChatHudLine {
|
||||
private GameProfile sender;
|
||||
|
||||
@Override
|
||||
public String smegma$getText() { return content.toString(); }
|
||||
public String sputnik$getText() { return content.toString(); }
|
||||
|
||||
@Override
|
||||
public int smegma$getId() { return id; }
|
||||
public int sputnik$getId() { return id; }
|
||||
|
||||
@Override
|
||||
public void smegma$setId(int id) { this.id = id; }
|
||||
public void sputnik$setId(int id) { this.id = id; }
|
||||
|
||||
@Override
|
||||
public GameProfile smegma$getSender() { return sender; }
|
||||
public GameProfile sputnik$getSender() { return sender; }
|
||||
|
||||
@Override
|
||||
public void smegma$setSender(GameProfile profile) { this.sender = profile; }
|
||||
public void sputnik$setSender(GameProfile profile) { this.sender = profile; }
|
||||
}
|
||||
+9
-9
@@ -1,7 +1,7 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import me.retucio.camtweaks.util.interfaces.IChatHudLineVisible;
|
||||
import me.retucio.sputnik.util.interfaces.IChatHudLineVisible;
|
||||
import net.minecraft.client.gui.hud.ChatHudLine;
|
||||
import net.minecraft.text.OrderedText;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
@@ -25,7 +25,7 @@ public class ChatHudLineVisibleMixin implements IChatHudLineVisible {
|
||||
private boolean startOfEntry;
|
||||
|
||||
@Override
|
||||
public String smegma$getText() {
|
||||
public String sputnik$getText() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
content.accept((index, style, codePoint) -> {
|
||||
@@ -36,20 +36,20 @@ public class ChatHudLineVisibleMixin implements IChatHudLineVisible {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int smegma$getId() { return id; }
|
||||
public int sputnik$getId() { return id; }
|
||||
|
||||
@Override
|
||||
public void smegma$setId(int id) { this.id = id; }
|
||||
public void sputnik$setId(int id) { this.id = id; }
|
||||
|
||||
@Override
|
||||
public GameProfile smegma$getSender() { return sender; }
|
||||
public GameProfile sputnik$getSender() { return sender; }
|
||||
|
||||
@Override
|
||||
public void smegma$setSender(GameProfile profile) { this.sender = profile; }
|
||||
public void sputnik$setSender(GameProfile profile) { this.sender = profile; }
|
||||
|
||||
@Override
|
||||
public boolean smegma$isStartOfEntry() { return startOfEntry; }
|
||||
public boolean sputnik$isStartOfEntry() { return startOfEntry; }
|
||||
|
||||
@Override
|
||||
public void smegma$setStartOfEntry(boolean start) { this.startOfEntry = start; }
|
||||
public void sputnik$setStartOfEntry(boolean start) { this.startOfEntry = start; }
|
||||
}
|
||||
+18
-18
@@ -1,14 +1,14 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import me.retucio.camtweaks.event.events.ReceiveMessageEvent;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.misc.ChatPlus;
|
||||
import me.retucio.camtweaks.util.interfaces.IChatHud;
|
||||
import me.retucio.camtweaks.util.interfaces.IChatHudLine;
|
||||
import me.retucio.camtweaks.util.interfaces.IChatHudLineVisible;
|
||||
import me.retucio.camtweaks.util.interfaces.IMessageHandler;
|
||||
import me.retucio.sputnik.event.events.ReceiveMessageEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import me.retucio.sputnik.util.interfaces.IChatHud;
|
||||
import me.retucio.sputnik.util.interfaces.IChatHudLine;
|
||||
import me.retucio.sputnik.util.interfaces.IChatHudLineVisible;
|
||||
import me.retucio.sputnik.util.interfaces.IMessageHandler;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.hud.ChatHud;
|
||||
import net.minecraft.client.gui.hud.ChatHudLine;
|
||||
@@ -27,7 +27,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.*;
|
||||
import static me.retucio.sputnik.Sputnik.*;
|
||||
|
||||
@Mixin(ChatHud.class)
|
||||
public abstract class ChatHudMixin implements IChatHud {
|
||||
@@ -62,7 +62,7 @@ public abstract class ChatHudMixin implements IChatHud {
|
||||
// métodos relacionados a las interfaces IChatHud, IChatHudLine, IChadHudLineVisible y IMessageHandler
|
||||
|
||||
@Override
|
||||
public void smegma$add(Text message, int id) {
|
||||
public void sputnik$add(Text message, int id) {
|
||||
nextId = id;
|
||||
addMessage(message);
|
||||
nextId = 0;
|
||||
@@ -70,12 +70,12 @@ public abstract class ChatHudMixin implements IChatHud {
|
||||
|
||||
@Inject(method = "addVisibleMessage", at = @At(value = "INVOKE", target = "Ljava/util/List;addFirst(Ljava/lang/Object;)V", shift = At.Shift.AFTER))
|
||||
private void onAddMessageAfterNewChatHudLineVisible(ChatHudLine message, CallbackInfo ci) {
|
||||
((IChatHudLine) (Object) visibleMessages.getFirst()).smegma$setId(nextId);
|
||||
((IChatHudLine) (Object) visibleMessages.getFirst()).sputnik$setId(nextId);
|
||||
}
|
||||
|
||||
@Inject(method = "addMessage(Lnet/minecraft/client/gui/hud/ChatHudLine;)V", at = @At(value = "INVOKE", target = "Ljava/util/List;addFirst(Ljava/lang/Object;)V", shift = At.Shift.AFTER))
|
||||
private void onAddMessageAfterNewChatHudLine(ChatHudLine message, CallbackInfo ci) {
|
||||
((IChatHudLine) (Object) messages.getFirst()).smegma$setId(nextId);
|
||||
((IChatHudLine) (Object) messages.getFirst()).sputnik$setId(nextId);
|
||||
}
|
||||
|
||||
@SuppressWarnings("DataFlowIssue")
|
||||
@@ -86,8 +86,8 @@ public abstract class ChatHudMixin implements IChatHud {
|
||||
|
||||
IChatHudLineVisible iLine = (IChatHudLineVisible) (Object) line;
|
||||
|
||||
iLine.smegma$setSender(handler.smegma$getSender());
|
||||
iLine.smegma$setStartOfEntry(j == 0);
|
||||
iLine.sputnik$setSender(handler.sputnik$getSender());
|
||||
iLine.sputnik$setStartOfEntry(j == 0);
|
||||
|
||||
return line;
|
||||
}
|
||||
@@ -97,12 +97,12 @@ public abstract class ChatHudMixin implements IChatHud {
|
||||
IMessageHandler handler = (IMessageHandler) mc.getMessageHandler();
|
||||
if (handler == null) return line;
|
||||
|
||||
((IChatHudLine) (Object) line).smegma$setSender(handler.smegma$getSender());
|
||||
((IChatHudLine) (Object) line).sputnik$setSender(handler.sputnik$getSender());
|
||||
return line;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ChatHudLine.Visible> smegma$getVisibleMessages() {
|
||||
public List<ChatHudLine.Visible> sputnik$getVisibleMessages() {
|
||||
return visibleMessages;
|
||||
}
|
||||
|
||||
@@ -118,10 +118,10 @@ public abstract class ChatHudMixin implements IChatHud {
|
||||
if (event.isCancelled()) {
|
||||
ci.cancel();
|
||||
} else {
|
||||
visibleMessages.removeIf(msg -> ((IChatHudLine) (Object) msg).smegma$getId() == nextId && nextId != 0);
|
||||
visibleMessages.removeIf(msg -> ((IChatHudLine) (Object) msg).sputnik$getId() == nextId && nextId != 0);
|
||||
|
||||
for (int i = messages.size() - 1; i > -1; i--) {
|
||||
if (((IChatHudLine) (Object) messages.get(i)).smegma$getId() == nextId && nextId != 0) {
|
||||
if (((IChatHudLine) (Object) messages.get(i)).sputnik$getId() == nextId && nextId != 0) {
|
||||
messages.remove(i);
|
||||
chatPlus.removeLine(i);
|
||||
}
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import com.mojang.brigadier.ParseResults;
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.suggestion.Suggestions;
|
||||
import me.retucio.camtweaks.command.CommandManager;
|
||||
import me.retucio.sputnik.command.CommandManager;
|
||||
import net.minecraft.client.gui.screen.ChatInputSuggestor;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.command.CommandSource;
|
||||
@@ -17,7 +17,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
import static me.retucio.sputnik.Sputnik.mc;
|
||||
|
||||
@Mixin(ChatInputSuggestor.class)
|
||||
public abstract class ChatInputSuggestorMixin {
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.misc.ChatPlus;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.camera.Freecam;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.debug.ChunkBorderDebugRenderer;
|
||||
import net.minecraft.util.math.ChunkSectionPos;
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import me.retucio.camtweaks.event.events.ChunkOcclusionEvent;
|
||||
import me.retucio.sputnik.event.events.ChunkOcclusionEvent;
|
||||
import net.minecraft.client.render.chunk.ChunkOcclusionDataBuilder;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -8,7 +8,7 @@ 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;
|
||||
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
|
||||
|
||||
@Mixin(ChunkOcclusionDataBuilder.class)
|
||||
public abstract class ChunkOcclusionDataBuilderMixin {
|
||||
+7
-7
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import me.retucio.camtweaks.mixin.accessor.ConfirmServerResourcePackScreenAccessor;
|
||||
import me.retucio.camtweaks.mixin.accessor.PackAccessor;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.network.RPackBypass;
|
||||
import me.retucio.camtweaks.util.interfaces.IConfirmScreen;
|
||||
import me.retucio.sputnik.mixin.accessor.ConfirmServerResourcePackScreenAccessor;
|
||||
import me.retucio.sputnik.mixin.accessor.PackAccessor;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.network.RPackBypass;
|
||||
import me.retucio.sputnik.util.interfaces.IConfirmScreen;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||
@@ -45,7 +45,7 @@ public abstract class ClientCommonNetworkHandlerMixin {
|
||||
if (!bypassPack.isEnabled()) return;
|
||||
|
||||
final Screen screen = cir.getReturnValue();
|
||||
((IConfirmScreen) screen).smegma$setBypassAction(() -> {
|
||||
((IConfirmScreen) screen).sputnik$setBypassAction(() -> {
|
||||
client.setScreen(((ConfirmServerResourcePackScreenAccessor) screen).getParentScreen());
|
||||
if (this.serverInfo != null) {
|
||||
this.serverInfo.setResourcePackPolicy(bypassPack.getPolicy());
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import me.retucio.camtweaks.event.Stage;
|
||||
import me.retucio.camtweaks.event.events.DisconnectEvent;
|
||||
import me.retucio.camtweaks.event.events.PacketEvent;
|
||||
import me.retucio.sputnik.event.Stage;
|
||||
import me.retucio.sputnik.event.events.DisconnectEvent;
|
||||
import me.retucio.sputnik.event.events.PacketEvent;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.DisconnectionInfo;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
@@ -13,8 +13,8 @@ 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;
|
||||
import static me.retucio.camtweaks.CameraTweaks.mc;
|
||||
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
|
||||
import static me.retucio.sputnik.Sputnik.mc;
|
||||
|
||||
@Mixin(ClientConnection.class)
|
||||
public abstract class ClientConnectionMixin {
|
||||
+7
-7
@@ -1,11 +1,11 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import me.retucio.camtweaks.command.CommandManager;
|
||||
import me.retucio.camtweaks.event.events.SendMessageEvent;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.render.NoRender;
|
||||
import me.retucio.camtweaks.util.ChatUtil;
|
||||
import me.retucio.sputnik.command.CommandManager;
|
||||
import me.retucio.sputnik.event.events.SendMessageEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.render.NoRender;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -17,7 +17,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import static me.retucio.camtweaks.CameraTweaks.*;
|
||||
import static me.retucio.sputnik.Sputnik.*;
|
||||
|
||||
@Mixin(ClientPlayNetworkHandler.class)
|
||||
public abstract class ClientPlayNetworkHandlerMixin {
|
||||
+20
-13
@@ -1,38 +1,45 @@
|
||||
package me.retucio.camtweaks.mixin;
|
||||
package me.retucio.sputnik.mixin;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import me.retucio.camtweaks.module.ModuleManager;
|
||||
import me.retucio.camtweaks.module.modules.world.NoMiningInterruptions;
|
||||
import me.retucio.camtweaks.module.modules.player.PortalGUI;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.world.NoMiningInterruptions;
|
||||
import me.retucio.sputnik.module.modules.player.PortalGUI;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.util.hit.EntityHitResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
||||
import static me.retucio.sputnik.Sputnik.mc;
|
||||
|
||||
@Mixin(ClientPlayerEntity.class)
|
||||
public abstract class ClientPlayerEntityMixin {
|
||||
|
||||
@Shadow
|
||||
private static HitResult checkCrosshairTargetRange(HitResult hitResult, Vec3d cameraPos, double range) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(method = "tickNausea", at = @At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;", opcode = Opcodes.GETFIELD))
|
||||
private Screen allowScreensInPortals(Screen original) {
|
||||
if (ModuleManager.INSTANCE.getModuleByClass(PortalGUI.class).isEnabled()) return null;
|
||||
return original;
|
||||
}
|
||||
|
||||
@ModifyReturnValue(method = "getCrosshairTarget(FLnet/minecraft/entity/Entity;)Lnet/minecraft/util/hit/HitResult;", at = @At("RETURN"))
|
||||
private static HitResult onGetCrosshairTarget(HitResult original, @Local HitResult hitResult) {
|
||||
// no va??
|
||||
@ModifyReturnValue(method = "getCrosshairTarget(Lnet/minecraft/entity/Entity;DDF)Lnet/minecraft/util/hit/HitResult;", at = @At("RETURN"))
|
||||
private static HitResult onUpdateTargetedEntity(HitResult original, @Local HitResult hitResult, @Local(ordinal = 0) Vec3d vec3d) {
|
||||
NoMiningInterruptions nmi = ModuleManager.INSTANCE.getModuleByClass(NoMiningInterruptions.class);
|
||||
if (original instanceof EntityHitResult ehr) {
|
||||
if (nmi.shouldIgnoreEntity(ehr.getEntity())
|
||||
&& hitResult.getType() == HitResult.Type.BLOCK) {
|
||||
return hitResult;
|
||||
}
|
||||
}
|
||||
|
||||
return original;
|
||||
if (!(original instanceof EntityHitResult ehr)) return original;
|
||||
if (!nmi.shouldIgnoreEntity((ehr.getEntity()))) return original;
|
||||
|
||||
return checkCrosshairTargetRange(hitResult, vec3d, mc.player.getEntityInteractionRange());
|
||||
}
|
||||
}
|
||||
Loaded 100 of 363 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user