Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6cb4656365 |
No files matched your search
+4
-15
@@ -1,31 +1,20 @@
|
||||
# v5.7
|
||||
# v5.8
|
||||
|
||||
## novedades
|
||||
|
||||
actualización a gradle 9.7.0
|
||||
|
||||
interfaz reorganizada en pestañas: módulos, hud, perfiles y macros
|
||||
|
||||
perfiles de configuración: guarda varias configs con nombre y cambia entre ellas sin reiniciar
|
||||
|
||||
macros: asigna una tecla a una lista de comandos o mensajes
|
||||
nuevo tipo de ajuste: archivo seleccionable
|
||||
|
||||
### adiciones
|
||||
|
||||
#### módulos nuevos:
|
||||
|
||||
- cancelador de paquetes: evita que se envíen o reciban ciertos paquetes
|
||||
- puto gordo: come al tener hambre automáticamente
|
||||
- logger de paquetes: loguea los paquetes seleccionados
|
||||
|
||||
#### comandos nuevos:
|
||||
|
||||
- `$?`: muestra los comandos disponibles y los describe
|
||||
- `$perfil`: gestiona los perfiles de configuración
|
||||
- `$macro`: gestiona las macros
|
||||
|
||||
### arreglos / mejoras
|
||||
|
||||
- las rotaciones de los módulos se reparten por prioridad en vez de pisarse entre ellas
|
||||
- el editor del hud ya es una pestaña más de la interfaz, además de su propia pantalla
|
||||
|
||||
## problemas reconocidos
|
||||
|
||||
|
||||
+1
-1
@@ -10,6 +10,6 @@ discord_rpc_version=1.0.3
|
||||
neutrino_version=1.1.0
|
||||
jdk_version=25
|
||||
|
||||
mod_version=5.7
|
||||
mod_version=5.8
|
||||
maven_group=me.retucio
|
||||
archives_base_name=sputnik
|
||||
@@ -26,6 +26,7 @@ import me.retucio.sputnik.ui.hud.HudEditorScreen;
|
||||
import me.retucio.sputnik.ui.screen.UpdateScreen;
|
||||
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.FileButton;
|
||||
import me.retucio.sputnik.ui.widgets.buttons.settings.TextButton;
|
||||
import me.retucio.sputnik.ui.widgets.panels.settings.ClientSettingsPanel;
|
||||
import me.retucio.sputnik.ui.widgets.panels.SettingsPanel;
|
||||
@@ -183,8 +184,12 @@ public class Sputnik implements ClientModInitializer {
|
||||
private boolean isAnySettingButtonFocused() {
|
||||
for (SettingsPanel sf : ClickGui.INSTANCE.getSettingsPanels())
|
||||
for (Button sb : sf.getButtons())
|
||||
if ((sb instanceof BindButton b && b.isFocused()) || (sb instanceof TextButton t && t.isFocused()))
|
||||
if ((sb instanceof BindButton b && b.isFocused())
|
||||
|| (sb instanceof TextButton t && t.isFocused())
|
||||
|| (sb instanceof FileButton f && f.isFocused())
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -208,6 +213,7 @@ public class Sputnik implements ClientModInitializer {
|
||||
for (SettingsPanel sf : ClickGui.INSTANCE.getSettingsPanels()) {
|
||||
for (SettingButton<?> sb : sf.getButtons()) {
|
||||
if (sb instanceof BindButton bb) bb.onKey(key, action);
|
||||
if (sb instanceof FileButton fb) fb.onKey(key, action);
|
||||
if (sb instanceof TextButton tb) tb.onKey(key, action);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
package me.retucio.sputnik.module.modules.network;
|
||||
|
||||
import com.github.retucio.neutrino.EventListener;
|
||||
import me.retucio.sputnik.event.network.PacketEvent;
|
||||
import me.retucio.sputnik.module.Category;
|
||||
import me.retucio.sputnik.module.Module;
|
||||
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||
import me.retucio.sputnik.module.setting.settings.FileSetting;
|
||||
import me.retucio.sputnik.module.setting.settings.ListSetting;
|
||||
import me.retucio.sputnik.ui.hud.HudRenderer;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import me.retucio.sputnik.util.Lists;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.PacketType;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
|
||||
public class PacketLogger extends Module {
|
||||
|
||||
private static final DateTimeFormatter TIME = DateTimeFormatter
|
||||
.ofPattern("HH:mm:ss.SSS")
|
||||
.withZone(ZoneId.systemDefault());
|
||||
|
||||
private static final int QUEUE_CAPACITY = 8192;
|
||||
private static final int BATCH_SIZE = 256;
|
||||
|
||||
private final ListSetting<PacketType<? extends Packet<?>>> packets = sgGeneral.add(new ListSetting<>(
|
||||
"paquetes", "paquetes a loguear",
|
||||
Lists.packetList, Lists.allFalse(Lists.packetList), Lists.packetNames
|
||||
));
|
||||
|
||||
private final EnumSetting<LogMode> mode = sgGeneral.add(new EnumSetting<>(
|
||||
"modo de logueo", "de qué manera loguear los paquetes",
|
||||
LogMode.class, LogMode.FILE
|
||||
));
|
||||
|
||||
private final FileSetting file = sgGeneral.add(new FileSetting(
|
||||
"archivo", "archivo donde loguear los paquetes",
|
||||
"sputnik/packets.log"
|
||||
));
|
||||
|
||||
private final BlockingQueue<String> queue = new ArrayBlockingQueue<>(QUEUE_CAPACITY);
|
||||
private final AtomicInteger dropped = new AtomicInteger();
|
||||
|
||||
private volatile boolean running;
|
||||
private volatile Thread writer;
|
||||
|
||||
public PacketLogger() {
|
||||
super("logger de paquetes", "loguea paquetes", Category.NETWORK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
startWriter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
stopWriter();
|
||||
}
|
||||
|
||||
@EventListener
|
||||
private void onPacketSend(PacketEvent.Send event) {
|
||||
handle("OUT", event.getPacket());
|
||||
}
|
||||
|
||||
@EventListener
|
||||
private void onPacketReceive(PacketEvent.Receive event) {
|
||||
handle("IN", event.getPacket());
|
||||
}
|
||||
|
||||
private void handle(String direction, Packet<?> packet) {
|
||||
if (packet == null || !packets.isEnabled(packet.type())) return;
|
||||
|
||||
String name = nameOf(packet);
|
||||
String body = describe(packet);
|
||||
|
||||
switch (mode.getValue()) {
|
||||
case CHAT -> onGameThread(() -> ChatUtil.info("[" + direction + "] " + body));
|
||||
case NOTIFICATION -> onGameThread(() -> HudRenderer.INSTANCE.pushNotification(name, body));
|
||||
case FILE -> enqueue("[" + TIME.format(Instant.now()) + "] [" + direction + "] " + name + " " + body);
|
||||
}
|
||||
}
|
||||
|
||||
private static void onGameThread(Runnable action) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc.isSameThread()) action.run();
|
||||
else mc.execute(action);
|
||||
}
|
||||
|
||||
private static String nameOf(Packet<?> packet) {
|
||||
PacketType<?> type = packet.type();
|
||||
return type.id().toString();
|
||||
}
|
||||
|
||||
private static String describe(Packet<?> packet) {
|
||||
try {
|
||||
return String.valueOf(packet);
|
||||
} catch (Throwable t) {
|
||||
return packet.getClass().getSimpleName() + " <toString failed: " + t + ">";
|
||||
}
|
||||
}
|
||||
|
||||
private void enqueue(String line) {
|
||||
if (!running) return;
|
||||
if (!queue.offer(line)) dropped.incrementAndGet();
|
||||
}
|
||||
|
||||
private void startWriter() {
|
||||
if (running) return;
|
||||
|
||||
Path path = file.getPath().toAbsolutePath();
|
||||
|
||||
queue.clear();
|
||||
dropped.set(0);
|
||||
running = true;
|
||||
|
||||
Thread thread = new Thread(() -> writerLoop(path), "sputnik-packet-logger");
|
||||
thread.setDaemon(true);
|
||||
thread.setPriority(Thread.MIN_PRIORITY);
|
||||
writer = thread;
|
||||
thread.start();
|
||||
}
|
||||
|
||||
private void stopWriter() {
|
||||
if (!running) return;
|
||||
running = false;
|
||||
|
||||
Thread thread = writer;
|
||||
writer = null;
|
||||
if (thread == null) return;
|
||||
|
||||
try {
|
||||
thread.join(2000);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
|
||||
int lost = dropped.getAndSet(0);
|
||||
if (lost > 0) {
|
||||
onGameThread(() -> ChatUtil.warn("se descartaron " + lost + " paquetes (cola llena)"));
|
||||
}
|
||||
}
|
||||
|
||||
private void writerLoop(Path path) {
|
||||
try {
|
||||
Path parent = path.getParent();
|
||||
if (parent != null) Files.createDirectories(parent);
|
||||
|
||||
try (BufferedWriter out = Files.newBufferedWriter(
|
||||
path, StandardCharsets.UTF_8,
|
||||
StandardOpenOption.CREATE, StandardOpenOption.APPEND)) {
|
||||
|
||||
out.write("--- sesión iniciada " + Instant.now() + " ---");
|
||||
out.newLine();
|
||||
out.flush();
|
||||
|
||||
List<String> batch = new ArrayList<>(BATCH_SIZE);
|
||||
|
||||
while (running || !queue.isEmpty()) {
|
||||
String first = queue.poll(250, TimeUnit.MILLISECONDS);
|
||||
if (first == null) continue;
|
||||
|
||||
batch.add(first);
|
||||
queue.drainTo(batch, BATCH_SIZE - 1);
|
||||
|
||||
for (String line : batch) {
|
||||
out.write(line);
|
||||
out.newLine();
|
||||
}
|
||||
batch.clear();
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
} catch (IOException e) {
|
||||
running = false;
|
||||
queue.clear();
|
||||
onGameThread(() -> {
|
||||
ChatUtil.error("no se pudo escribir el log: " + e.getMessage());
|
||||
toggle();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private enum LogMode {
|
||||
CHAT("chat"),
|
||||
NOTIFICATION("notis"),
|
||||
FILE("archivo");
|
||||
|
||||
private final String name;
|
||||
LogMode(String name) { this.name = name; }
|
||||
@Override public String toString() { return name; }
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import me.retucio.sputnik.module.modules.inventory.*;
|
||||
import me.retucio.sputnik.module.modules.misc.*;
|
||||
import me.retucio.sputnik.module.modules.movement.*;
|
||||
import me.retucio.sputnik.module.modules.network.*;
|
||||
import me.retucio.sputnik.module.modules.network.PacketLogger;
|
||||
import me.retucio.sputnik.module.modules.player.*;
|
||||
import me.retucio.sputnik.module.modules.render.*;
|
||||
import me.retucio.sputnik.module.modules.render.CritsPlus;
|
||||
@@ -144,6 +145,7 @@ public class ModuleManager {
|
||||
add(new LogoutSpots());
|
||||
add(new PacketCanceller());
|
||||
add(new PacketDelay());
|
||||
add(new PacketLogger());
|
||||
add(new PacketMine());
|
||||
add(new Reconnect());
|
||||
add(new RPackBypass());
|
||||
@@ -152,6 +154,7 @@ public class ModuleManager {
|
||||
private void addPlayer() {
|
||||
add(new AirPlace());
|
||||
add(new AntiHunger());
|
||||
add(new AutoEat());
|
||||
add(new AutoFish());
|
||||
add(new Capes());
|
||||
add(new FastUse());
|
||||
|
||||
@@ -14,12 +14,12 @@ import org.jspecify.annotations.NonNull;
|
||||
public class PacketCanceller extends Module {
|
||||
|
||||
private final ListSetting<PacketType<? extends @NonNull Packet<?>>> c2s = sgGeneral.add(new ListSetting(
|
||||
"cliente > servidor", "paquetes a cancelar, dirección servidor",
|
||||
"C2S", "paquetes a cancelar, dirección servidor",
|
||||
Lists.c2sPacketList, Lists.allFalse(Lists.c2sPacketList), Lists.c2sPacketNames
|
||||
));
|
||||
|
||||
private final ListSetting<PacketType<? extends @NonNull Packet<?>>> s2c = sgGeneral.add(new ListSetting(
|
||||
"servidor > cliente", "paquetes a cancelar, dirección cliente",
|
||||
"S2C", "paquetes a cancelar, dirección cliente",
|
||||
Lists.s2cPacketList, Lists.allFalse(Lists.s2cPacketList), Lists.s2cPacketNames
|
||||
));
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package me.retucio.sputnik.module.modules.player;
|
||||
|
||||
import me.retucio.sputnik.module.Category;
|
||||
import me.retucio.sputnik.module.Module;
|
||||
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||
import me.retucio.sputnik.util.InventoryUtil;
|
||||
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AutoEat extends Module {
|
||||
|
||||
private final NumberSetting hunger = sgGeneral.add(new NumberSetting(
|
||||
"hambre", "cuánta hambre es necesaria para comer (puntos de comida)",
|
||||
6, 0, 19, 1
|
||||
));
|
||||
|
||||
private boolean eating;
|
||||
|
||||
public AutoEat() {
|
||||
super("puto gordo", "come automáticamente al tener hambre", Category.PLAYER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick() {
|
||||
if (mc.player == null) return;
|
||||
|
||||
if (eating) {
|
||||
if (mc.player.getUseItemRemainingTicks() > 0) {
|
||||
return;
|
||||
} else {
|
||||
stopEating();
|
||||
}
|
||||
}
|
||||
|
||||
if (mc.player.getFoodData().getFoodLevel() <= hunger.getIntValue()) {
|
||||
List<ItemStack> sorted = InventoryUtil.findAllStacks(
|
||||
stack -> stack.getItem().components().get(DataComponents.FOOD) != null
|
||||
);
|
||||
sorted.sort(Comparator.comparingInt(stack -> stack.getItem().components().get(DataComponents.FOOD).nutrition()));
|
||||
if (sorted.isEmpty()) return;
|
||||
|
||||
boolean inHotbar = false;
|
||||
for (ItemStack stack : sorted) {
|
||||
int slot = InventoryUtil.findSlot(s -> stack == s);
|
||||
if (Inventory.isHotbarSlot(slot)) {
|
||||
mc.player.getInventory().setSelectedSlot(slot);
|
||||
inHotbar = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!inHotbar) {
|
||||
int free = mc.player.getInventory().getFreeSlot();
|
||||
|
||||
InventoryUtil.move(InventoryUtil.findSlot(stack -> stack == sorted.getFirst()), free != -1
|
||||
? free
|
||||
: mc.player.getInventory().getSelectedSlot());
|
||||
|
||||
if (free != -1) {
|
||||
mc.player.getInventory().setSelectedSlot(free);
|
||||
}
|
||||
}
|
||||
|
||||
startEating();
|
||||
}
|
||||
}
|
||||
|
||||
private void startEating() {
|
||||
eating = true;
|
||||
mc.options.keyUse.setDown(true);
|
||||
}
|
||||
|
||||
private void stopEating() {
|
||||
eating = false;
|
||||
mc.options.keyUse.setDown(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package me.retucio.sputnik.module.setting.settings;
|
||||
|
||||
import me.retucio.sputnik.module.setting.Setting;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import me.retucio.sputnik.util.I18nUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
|
||||
public class FileSetting extends Setting<String> {
|
||||
|
||||
private File file;
|
||||
|
||||
public FileSetting(String name, String description, String defaultValue) {
|
||||
super(name, description, defaultValue);
|
||||
file = new File(defaultValue);
|
||||
}
|
||||
|
||||
public boolean isDirectory() {
|
||||
return file.isDirectory();
|
||||
}
|
||||
|
||||
public boolean exists() {
|
||||
return file.exists();
|
||||
}
|
||||
|
||||
public boolean canWrite() {
|
||||
return file.canWrite();
|
||||
}
|
||||
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return file.getName();
|
||||
}
|
||||
|
||||
public Path getPath() {
|
||||
return Path.of(file.getPath());
|
||||
}
|
||||
|
||||
public String getAbsPathStr() {
|
||||
return file.getAbsolutePath();
|
||||
}
|
||||
|
||||
public String getRelPathStr() {
|
||||
return file.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(String value) {
|
||||
super.setValue(value);
|
||||
file = new File(value);
|
||||
if (!exists()) {
|
||||
ChatUtil.error(I18nUtil.fmt(
|
||||
"sputnik.filesetting.doesnotexist",
|
||||
"el archivo \"%s\" no existe!".formatted(value),
|
||||
value
|
||||
));
|
||||
}
|
||||
|
||||
if (!canWrite()) {
|
||||
if (!exists()) {
|
||||
ChatUtil.warn(I18nUtil.fmt(
|
||||
"sputnik.filesetting.cannotwrite",
|
||||
"no se puede escribir a \"%s\"!".formatted(value),
|
||||
value
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package me.retucio.sputnik.ui.widgets.buttons.settings;
|
||||
|
||||
import me.retucio.sputnik.module.setting.settings.FileSetting;
|
||||
import me.retucio.sputnik.ui.screen.ClickGui;
|
||||
import me.retucio.sputnik.ui.widgets.buttons.SettingButton;
|
||||
import me.retucio.sputnik.ui.widgets.panels.SettingsPanel;
|
||||
import me.retucio.sputnik.util.Colors;
|
||||
import me.retucio.sputnik.util.KeyUtil;
|
||||
import me.retucio.sputnik.util.MiscUtil;
|
||||
|
||||
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||
import net.minecraft.client.resources.language.I18n;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.util.tinyfd.TinyFileDialogs;
|
||||
|
||||
import java.awt.*;
|
||||
import java.nio.file.Path;
|
||||
|
||||
|
||||
public class FileButton extends SettingButton<FileSetting> {
|
||||
|
||||
private boolean typing;
|
||||
private final FileSetting setting;
|
||||
private final StringBuilder buffer = new StringBuilder();
|
||||
|
||||
public FileButton(FileSetting setting, SettingsPanel parent, int offset) {
|
||||
super(setting, parent, offset);
|
||||
this.setting = setting;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(GuiGraphicsExtractor gui, int mouseX, int mouseY, float delta) {
|
||||
// fondo
|
||||
int bgColor = isHovered(mouseX, mouseY)
|
||||
? Colors.buttonColor.brighter().getRGB()
|
||||
: Colors.buttonColor.getRGB();
|
||||
gui.fill(x, y, x + w - 20, y + h, bgColor);
|
||||
|
||||
// botón de navegar
|
||||
int browseButtonColor = isBrowseButtonHovered(mouseX, mouseY)
|
||||
? Colors.buttonColor.brighter().getRGB()
|
||||
: Colors.buttonColor.getRGB();
|
||||
gui.fill(x + w - 20, y, x + w, y + h, browseButtonColor);
|
||||
gui.text(mc.font, "...", x + w - 20 + (20 - mc.font.width("...")) / 2, y + 3, -1, true);
|
||||
|
||||
// texto
|
||||
String label = setting.getName() + ": " + (typing ? buffer + "_" : setting.getValue());
|
||||
gui.text(mc.font, label, x + 5, y + 3, -1, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int mouseX, int mouseY, int button) {
|
||||
if (isHovered(mouseX, mouseY) && ClickGui.INSTANCE.trySelect(this)) {
|
||||
if (button == 0) {
|
||||
typing = true;
|
||||
buffer.setLength(0);
|
||||
buffer.append(setting.getValue()); // precargar valor anterior
|
||||
} else if (button == 1 && KeyUtil.isShiftDown()) {
|
||||
typing = false;
|
||||
setting.reset();
|
||||
}
|
||||
} else {
|
||||
typing = false;
|
||||
if (isBrowseButtonHovered(mouseX, mouseY)) {
|
||||
Path path = pickFile();
|
||||
if (path != null) {
|
||||
setting.setValue(path.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKey(int key, int action) {
|
||||
if (!typing || action == GLFW.GLFW_RELEASE) return;
|
||||
|
||||
// pegar con ctrl + v
|
||||
if (key == GLFW.GLFW_KEY_V && KeyUtil.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL)) {
|
||||
paste();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (key) { // casos para teclas especiales como enter, escape o borrar
|
||||
case GLFW.GLFW_KEY_ENTER -> {
|
||||
setting.setValue(buffer.toString());
|
||||
typing = false;
|
||||
} case GLFW.GLFW_KEY_BACKSPACE -> {
|
||||
onBackspace();
|
||||
} case GLFW.GLFW_KEY_ESCAPE -> {
|
||||
typing = false;
|
||||
} case GLFW.GLFW_KEY_SPACE -> {
|
||||
charTyped(' ');
|
||||
} default -> {
|
||||
String c = KeyUtil.getKeyName(key);
|
||||
if (c.length() == 1) {
|
||||
if (KeyUtil.isShiftDown())
|
||||
charTyped(KeyUtil.shiftKey(c).charAt(0));
|
||||
else
|
||||
charTyped(c.toLowerCase().charAt(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void charTyped(char c) {
|
||||
if (!typing) return;
|
||||
buffer.append(c);
|
||||
|
||||
if (mc.font.width(setting.getName() + ": " + buffer + "_") > w - 8) {
|
||||
onBackspace();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFocused() {
|
||||
return typing;
|
||||
}
|
||||
|
||||
public void onBackspace() {
|
||||
MiscUtil.backspace(buffer);
|
||||
}
|
||||
|
||||
public void paste() {
|
||||
buffer.append(MiscUtil.getPasteContent(100));
|
||||
}
|
||||
|
||||
private boolean isBrowseButtonHovered(int mx, int my) {
|
||||
return mx >= x + w - 20 && mx <= x + w
|
||||
&& my >= y && my <= y + h;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHovered(int mx, int my) {
|
||||
return mx > x && mx < x + w - 20
|
||||
&& my > y && my <= y + h;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Path pickFile() {
|
||||
String result = TinyFileDialogs.tinyfd_openFileDialog(
|
||||
I18n.get("sputnik.filesetting.choose"),
|
||||
setting.isDirectory()
|
||||
? setting.getValue()
|
||||
: setting.getPath().getParent().toString(),
|
||||
null,
|
||||
I18n.get("sputnik.filesetting.supportedfiles"),
|
||||
false);
|
||||
return result == null ? null : Path.of(result);
|
||||
}
|
||||
}
|
||||
@@ -221,6 +221,7 @@ public class SettingsPanel extends CloseablePanel<SettingButton<? extends Settin
|
||||
case SliderButton sliderButton -> text += ": " + sliderButton.df.format((sliderButton.getSetting()).getValue());
|
||||
case CycleButton<?> cycleButton -> text += ": " + cycleButton.getSetting().getValue();
|
||||
case BindButton bindButton -> text += ": " + bindButton.getSetting().getKeyName();
|
||||
case FileButton fileButton -> text += ": " + fileButton.getSetting().getValue() + " ...";
|
||||
case TextButton textButton -> text += ": " + textButton.getSetting().getValue();
|
||||
case ColorButton colorButton -> text += colorButton.getSetting().getTooltipText();
|
||||
default -> {}
|
||||
@@ -307,6 +308,7 @@ public class SettingsPanel extends CloseablePanel<SettingButton<? extends Settin
|
||||
case BooleanSetting b -> new ToggleButton(b, this, offset);
|
||||
case NumberSetting n -> new SliderButton(n, this, offset);
|
||||
case EnumSetting<?> e -> new CycleButton<>(e, this, offset);
|
||||
case FileSetting f -> new FileButton(f, this, offset);
|
||||
case KeySetting k -> new BindButton(k, this, offset);
|
||||
case StringSetting s -> new TextButton(s, this, offset);
|
||||
case ListSetting<?> l -> new ListButton<>(l, this, offset);
|
||||
|
||||
@@ -46,6 +46,8 @@ public class Lists {
|
||||
public static final List<MenuType<?>> screenList = BuiltInRegistries.MENU.stream().toList();
|
||||
public static Map<MenuType<?>, String> screenNames;
|
||||
|
||||
public static List<PacketType<? extends Packet<?>>> packetList = new ArrayList<>();
|
||||
public static Map<PacketType<? extends @NonNull Packet<?>>, String> packetNames = new HashMap<>();
|
||||
public static List<PacketType<? extends @NonNull Packet<?>>> c2sPacketList = new ArrayList<>();
|
||||
public static Map<PacketType<? extends @NonNull Packet<?>>, String> c2sPacketNames = new HashMap<>();
|
||||
public static List<PacketType<? extends @NonNull Packet<?>>> s2cPacketList = new ArrayList<>();
|
||||
@@ -116,6 +118,11 @@ public class Lists {
|
||||
c2sPacketList.add(type);
|
||||
c2sPacketNames.put(type, type.id().toShortString());
|
||||
}));
|
||||
|
||||
packetList.addAll(c2sPacketList);
|
||||
packetList.addAll(s2cPacketList);
|
||||
packetNames.putAll(c2sPacketNames);
|
||||
packetNames.putAll(s2cPacketNames);
|
||||
}
|
||||
|
||||
public static <T> Map<T, Boolean> allTrue(List<T> options) {
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
"sputnik.enum.module.modules.combat.projectiletrajectories.trajectorytargets.entities": "entities",
|
||||
"sputnik.enum.module.modules.combat.projectiletrajectories.trajectorytargets.none": "none",
|
||||
"sputnik.enum.module.modules.misc.anvilfont.fontmode.circled": "round",
|
||||
"sputnik.enum.module.modules.misc.anvilfont.fontmode.cursed": "well weird",
|
||||
"sputnik.enum.module.modules.misc.anvilfont.fontmode.cursed": "cursed",
|
||||
"sputnik.enum.module.modules.misc.anvilfont.fontmode.greek": "greek",
|
||||
"sputnik.enum.module.modules.misc.anvilfont.fontmode.normal": "normal",
|
||||
"sputnik.enum.module.modules.misc.anvilfont.fontmode.uppercase": "uppercase",
|
||||
@@ -214,6 +214,10 @@
|
||||
"sputnik.enum.module.modules.world.timechanger.moonphases.waning_gibbous": "waning gibbous",
|
||||
"sputnik.enum.module.modules.world.timechanger.moonphases.waxing_crescent": "waxing crescent",
|
||||
"sputnik.enum.module.modules.world.timechanger.moonphases.waxing_gibbous": "waxing gibbous",
|
||||
"sputnik.filesetting.cannotwrite": "cannot write to \"%s\"!",
|
||||
"sputnik.filesetting.choose": "choose a file",
|
||||
"sputnik.filesetting.supportedfiles": "supported files",
|
||||
"sputnik.filesetting.doesnotexist": "file \"%s\" does not exist!",
|
||||
"sputnik.group.andamios.bloques": "blocks",
|
||||
"sputnik.group.andamios.puente": "bridge",
|
||||
"sputnik.group.andamios.renderizado": "render",
|
||||
@@ -395,9 +399,9 @@
|
||||
"sputnik.module.cocaina.desc": "changes the speed of everything in the game",
|
||||
"sputnik.module.cocaina.name": "cocaine",
|
||||
"sputnik.module.colocarenaire.desc": "lets you place blocks in the air",
|
||||
"sputnik.module.colocarenaire.name": "place in air",
|
||||
"sputnik.module.colocarenaire.name": "airplace",
|
||||
"sputnik.module.conejo.desc": "do the elytra bounce by holding space",
|
||||
"sputnik.module.conejo.name": "rabbit",
|
||||
"sputnik.module.conejo.name": "ebounce",
|
||||
"sputnik.module.confetti.desc": "changes the color of the totem pop particles",
|
||||
"sputnik.module.confetti.name": "confetti",
|
||||
"sputnik.module.contorno.desc": "customizes the block outline",
|
||||
@@ -406,13 +410,13 @@
|
||||
"sputnik.module.criticos.name": "crits",
|
||||
"sputnik.module.delaydepaquetes.desc": "applies a delay to packets",
|
||||
"sputnik.module.delaydepaquetes.name": "packet delay",
|
||||
"sputnik.module.delfin.desc": "*dolphin noise*",
|
||||
"sputnik.module.delfin.desc": "*dolphin noises*",
|
||||
"sputnik.module.delfin.name": "dolphin",
|
||||
"sputnik.module.destellodeenchants.desc": "changes the color of the enchantment glint",
|
||||
"sputnik.module.destellodeenchants.name": "enchant glint",
|
||||
"sputnik.module.desyncdehitbox.desc": "chinese exploit",
|
||||
"sputnik.module.desyncdehitbox.name": "hitbox desync",
|
||||
"sputnik.module.discordrpc.desc": "customizes your activity on dishcord",
|
||||
"sputnik.module.discordrpc.desc": "customizes your activity on dickord",
|
||||
"sputnik.module.discordrpc.disconnected": "disconnected: %s - %s",
|
||||
"sputnik.module.discordrpc.error": "error: %s - %s",
|
||||
"sputnik.module.discordrpc.initerror": "error initializing rpc: %s",
|
||||
@@ -426,7 +430,7 @@
|
||||
"sputnik.module.dupedebundle.desc": "dupes items using a bundle and a book",
|
||||
"sputnik.module.dupedebundle.name": "bundle dupe",
|
||||
"sputnik.module.elytras.desc": "fly with elytra",
|
||||
"sputnik.module.elytras.name": "elytra",
|
||||
"sputnik.module.elytras.name": "elytrafly",
|
||||
"sputnik.module.escalerasveloces.desc": "climb ladders faster",
|
||||
"sputnik.module.escalerasveloces.name": "fast ladders",
|
||||
"sputnik.module.escalones.desc": "makes the step-up height whatever you want",
|
||||
@@ -465,6 +469,8 @@
|
||||
"sputnik.module.keypearl.nopearls": "you have no pearls",
|
||||
"sputnik.module.lsd.desc": "what the actual FUCK",
|
||||
"sputnik.module.lsd.name": "lsd",
|
||||
"sputnik.module.loggerdepaquetes.name": "packet logger",
|
||||
"sputnik.module.loggerdepaquetes.desc": "logs packets",
|
||||
"sputnik.module.macekill.oops": "oops: %s",
|
||||
"sputnik.module.manos.desc": "changes the way hands are rendered",
|
||||
"sputnik.module.manos.name": "hands",
|
||||
@@ -512,7 +518,9 @@
|
||||
"sputnik.module.progresodeminado.name": "mining progress",
|
||||
"sputnik.module.puntosdedesconexion.desc": "shows you the spots where other players log out",
|
||||
"sputnik.module.puntosdedesconexion.name": "logout spots",
|
||||
"sputnik.module.racismo.desc": "gimme a smoke bro",
|
||||
"sputnik.module.putogordo.name": "fatass",
|
||||
"sputnik.moduke.putogordo.desc": "automatically eats when hungry",
|
||||
"sputnik.module.racismo.desc": "detroit moment",
|
||||
"sputnik.module.racismo.name": "racism",
|
||||
"sputnik.module.reconectar.desc": "adds a button to reconnect to a server after being disconnected",
|
||||
"sputnik.module.reconectar.name": "reconnect",
|
||||
@@ -743,6 +751,10 @@
|
||||
"sputnik.setting.camaralibre.velocidad.tecladelscroll.name": "scroll key",
|
||||
"sputnik.setting.camaralibre.velocidad.velocidad.desc": "camera movement speed",
|
||||
"sputnik.setting.camaralibre.velocidad.velocidad.name": "speed",
|
||||
"sputnik.setting.canceladordepaquetes.general.c2s.name": "C2S",
|
||||
"sputnik.setting.canceladordepaquetes.general.c2s.desc": "serverbound packets to cancel",
|
||||
"sputnik.setting.canceladordepaquetes.general.s2c.name": "S2C",
|
||||
"sputnik.setting.canceladordepaquetes.general.s2c.desc": "clientbound packets to cancel",
|
||||
"sputnik.setting.capas.general.capa.desc": "which cape to wear",
|
||||
"sputnik.setting.capas.general.capa.name": "cape",
|
||||
"sputnik.setting.capturasdepantalla.botones.botondeabrir.desc": "show a button to open the screenshot file",
|
||||
@@ -1007,6 +1019,12 @@
|
||||
"sputnik.setting.jugadorfalso.general.nombre.desc": "what name to give the player",
|
||||
"sputnik.setting.jugadorfalso.general.nombre.name": "name",
|
||||
"sputnik.setting.key.reset": "keybind for module %s reset",
|
||||
"sputnik.setting.loggerdepaquetes.general.paquetes.name": "packets",
|
||||
"sputnik.setting.loggerdepaquetes.general.paquetes.desc": "packets to log",
|
||||
"sputnik.setting.loggerdepaquetes.general.mododelogueo.name": "logging mode",
|
||||
"sputnik.setting.loggerdepaquetes.general.mododelogueo.desc": "how to log packets",
|
||||
"sputnik.setting.loggerdepaquetes.general.archivo.name": "file",
|
||||
"sputnik.setting.loggerdepaquetes.general.archivo.desc": "file to use as log file",
|
||||
"sputnik.setting.lsd.general.intensidad.desc": "how much the image is distorted and tinted",
|
||||
"sputnik.setting.lsd.general.intensidad.name": "strength",
|
||||
"sputnik.setting.lsd.general.rotaciones.desc": "how much the offset swirls; higher = more whirls",
|
||||
@@ -1281,6 +1299,8 @@
|
||||
"sputnik.setting.puntosdedesconexion.relleno.colordelrelleno.name": "fill color",
|
||||
"sputnik.setting.puntosdedesconexion.relleno.relleno.desc": "render the box fill (faces)",
|
||||
"sputnik.setting.puntosdedesconexion.relleno.relleno.name": "fill",
|
||||
"sputnik.setting.putogordo.hambre.name": "hunger",
|
||||
"sputnik.setting.putogordo.hambre.desc": "how hungry you have to be to eat (food points)",
|
||||
"sputnik.setting.recorrido.general.color.desc": "color to use",
|
||||
"sputnik.setting.recorrido.general.color.name": "color",
|
||||
"sputnik.setting.recorrido.general.esperanzadevida.desc": "how long the trails last",
|
||||
|
||||
@@ -214,6 +214,10 @@
|
||||
"sputnik.enum.module.modules.world.timechanger.moonphases.waning_gibbous": "menguante gibosa",
|
||||
"sputnik.enum.module.modules.world.timechanger.moonphases.waxing_crescent": "creciente",
|
||||
"sputnik.enum.module.modules.world.timechanger.moonphases.waxing_gibbous": "creciente gibosa",
|
||||
"sputnik.filesetting.doesnotexist": "el archivo \"%s\" no existe!",
|
||||
"sputnik.filesetting.cannotwrite": "no se puede escribir a \"%s\"!",
|
||||
"sputnik.filesetting.choose": "elige un archivo",
|
||||
"sputnik.filesetting.supportedfiles": "archivos soportados",
|
||||
"sputnik.group.andamios.bloques": "bloques",
|
||||
"sputnik.group.andamios.puente": "puente",
|
||||
"sputnik.group.andamios.renderizado": "renderizado",
|
||||
@@ -465,6 +469,8 @@
|
||||
"sputnik.module.keypearl.nopearls": "no tienes perlas",
|
||||
"sputnik.module.lsd.desc": "distorsiona y tiñe la pantalla",
|
||||
"sputnik.module.lsd.name": "lsd",
|
||||
"sputnik.module.loggerdepaquetes.name": "logger de paquetes",
|
||||
"sputnik.module.loggerdepaquetes.desc": "loguea paquetes",
|
||||
"sputnik.module.macekill.oops": "upsi: %s",
|
||||
"sputnik.module.manos.desc": "modifica la manera en la que se renderizan las manos",
|
||||
"sputnik.module.manos.name": "manos",
|
||||
@@ -492,6 +498,8 @@
|
||||
"sputnik.module.notificaciones.name": "notificaciones",
|
||||
"sputnik.module.packetdelay.singleplayer": "delay de paquetes no funciona en un solo jugador",
|
||||
"sputnik.module.packetmine.pickbreaking": "pico por romperse",
|
||||
"sputnik.module.canceladordepaquetes.name": "cancelador de paquetes",
|
||||
"sputnik.module.canceladordepaquetes.desc": "cancela paquetes.",
|
||||
"sputnik.module.parkour.desc": "salta automáticamente en el último tick posible, en la esquina del bloque",
|
||||
"sputnik.module.parkour.name": "parkour",
|
||||
"sputnik.module.particulas.desc": "emite particulas artificiales",
|
||||
@@ -510,6 +518,8 @@
|
||||
"sputnik.module.progresodeminado.name": "progreso de minado",
|
||||
"sputnik.module.puntosdedesconexion.desc": "te muestra los puntos donde otros jugadores se desconectan",
|
||||
"sputnik.module.puntosdedesconexion.name": "puntos de desconexión",
|
||||
"sputnik.module.putogordo.name": "puto gordo",
|
||||
"sputnik.moduke.putogordo.desc": "come automáticamente al tener hambre",
|
||||
"sputnik.module.racismo.desc": "amego segarro",
|
||||
"sputnik.module.racismo.name": "racismo",
|
||||
"sputnik.module.reconectar.desc": "añade un botón para reconectarse a un servidor tras ser desconectado",
|
||||
@@ -741,6 +751,10 @@
|
||||
"sputnik.setting.camaralibre.velocidad.tecladelscroll.name": "tecla del scroll",
|
||||
"sputnik.setting.camaralibre.velocidad.velocidad.desc": "velocidad de movimiento de la cámara",
|
||||
"sputnik.setting.camaralibre.velocidad.velocidad.name": "velocidad",
|
||||
"sputnik.setting.canceladordepaquetes.general.c2s.name": "C2S",
|
||||
"sputnik.setting.canceladordepaquetes.general.c2s.desc": "paquetes a cancelar, dirección servidor",
|
||||
"sputnik.setting.canceladordepaquetes.general.s2c.name": "S2C",
|
||||
"sputnik.setting.canceladordepaquetes.general.s2c.desc": "paquetes a cancelar, dirección cliente",
|
||||
"sputnik.setting.capas.general.capa.desc": "qué capa llevar puesta",
|
||||
"sputnik.setting.capas.general.capa.name": "capa",
|
||||
"sputnik.setting.capturasdepantalla.botones.botondeabrir.desc": "mostrar botón para abrir el archivo de la captura",
|
||||
@@ -1005,6 +1019,12 @@
|
||||
"sputnik.setting.jugadorfalso.general.nombre.desc": "qué nombre asignarle al jugador",
|
||||
"sputnik.setting.jugadorfalso.general.nombre.name": "nombre",
|
||||
"sputnik.setting.key.reset": "tecla del módulo %s restablecida",
|
||||
"sputnik.setting.loggerdepaquetes.general.paquetes.name": "paquetes",
|
||||
"sputnik.setting.loggerdepaquetes.general.paquetes.desc": "paquetes a loguear",
|
||||
"sputnik.setting.loggerdepaquetes.general.mododelogueo.name": "modo de logueo",
|
||||
"sputnik.setting.loggerdepaquetes.general.mododelogueo.desc": "de qué manera loguear los paquetes",
|
||||
"sputnik.setting.loggerdepaquetes.general.archivo.name": "archivo",
|
||||
"sputnik.setting.loggerdepaquetes.general.archivo.desc": "archivo al que loguear los paquetes",
|
||||
"sputnik.setting.lsd.general.intensidad.desc": "cuánto se distorsiona y se tiñe la imagen",
|
||||
"sputnik.setting.lsd.general.intensidad.name": "intensidad",
|
||||
"sputnik.setting.lsd.general.rotaciones.desc": "cuántas vueltas da el desplazamiento; más = más remolinos",
|
||||
@@ -1279,6 +1299,8 @@
|
||||
"sputnik.setting.puntosdedesconexion.relleno.colordelrelleno.name": "color del relleno",
|
||||
"sputnik.setting.puntosdedesconexion.relleno.relleno.desc": "renderizar relleno de la caja (caras)",
|
||||
"sputnik.setting.puntosdedesconexion.relleno.relleno.name": "relleno",
|
||||
"sputnik.setting.putogordo.hambre.name": "hambre",
|
||||
"sputnik.setting.putogordo.hambre.desc": "cuánta hambre es necesaria para comer (puntos de comida)",
|
||||
"sputnik.setting.recorrido.general.color.desc": "color a usar",
|
||||
"sputnik.setting.recorrido.general.color.name": "color",
|
||||
"sputnik.setting.recorrido.general.esperanzadevida.desc": "cuánto duran los trazos",
|
||||
|
||||
@@ -7,10 +7,6 @@ uniform sampler2D InSampler;
|
||||
in vec2 texCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
// 26.2 pasó los samplers con nombre a bind groups; los uniforms van en un bloque std140
|
||||
// que rellena LsdPostProcessor cada frame. el tiempo se lleva aquí en vez de leerlo de
|
||||
// Globals.GameTime porque ese es una fracción del día (se reinicia cada 24000 ticks) y
|
||||
// animaría la distorsión lentísimo con un salto cada 20 minutos
|
||||
layout(std140) uniform LsdConfig {
|
||||
float strength;
|
||||
float seed;
|
||||
|
||||
Reference in new issue
Block a user