Compare commits

...
3 Commits
Author SHA1 Message Date
retucio 629d03ff92 v6.5 2026-09-14 19:17:07 +02:00
retucio c1a03f3ddb v6.4 2026-09-06 11:55:58 +02:00
retucio 44494830be v6.3 2026-09-04 12:58:41 +02:00
61 changed files with 1771 additions and 584 deletions

No files matched your search

+82
View File
@@ -0,0 +1,82 @@
<p align="center">
<a href="README.md"><img src="https://img.shields.io/badge/lang-Español-yellow.svg" alt="español"></a>
<a href="README.en.md"><img src="https://img.shields.io/badge/lang-English-blue.svg" alt="english"></a>
</p>
# jenny's mod 2 (100% real)
> Minecraft Fabric 26.2 mod that adds some "QOL" features, mostly related to the camera.
## installation
### for normal people:
1. go to [releases](https://codeberg.org/retucio/sputnik/releases)
2. choose the most recent version
3. download the .jar file
4. move it to your mods dir (prolly `%appdata%/.minecraft/mods`)
make sure to have a Minecraft and Fabric version compatible with the mod (MC `26.2`; Fabric `0.19.3`)
issues could arise when using it with other mods, especially other clients, since they could conflict
### for nerds
1. clone the repo (`git clone https://codeberg.org/retucio/sputnik`)
2. enter the repo dir (`cd sputnik`)
3. `gradlew build` for Windows (ew) or `chmod +x gradlew` + `./gradlew build` for Unix-likes (Linux & Mac)
4. the built .jar will be found in `/build/libs/sputnik-X.X.jar`
## usage
`rshift` by default to open the GUI
`insert` by default to open the HUD editor
`$` as prefix for commands (autocompleted)
some modules have keys assigned by default, assign them `ESC` to unbind them.
## ui
- left click to toggle modules
- right click to open its settings
- left click + drag to move a panel
- right click on a panel's header to expand/contract it, or to close it
- left click over settings to change them
- shift + right click on a setting to reset it to its default value
- place the mouse cursor over a module/setting to read its description
## screenshots
<img src="screenshots/automine.png" alt="auto mine">
<img src="screenshots/blockesp.png" alt="block ESP + light overlay">
<img src="screenshots/camtweaks.png" alt="perspective plus">
<img src="screenshots/chatplus.png" alt="chatplus + nametags + screenshots plus">
<img src="screenshots/clickgui.png" alt="click GUI">
<img src="screenshots/freecam.png" alt="freecam + tracers">
<img src="screenshots/hudeditor.png" alt="HUD editor">
<img src="screenshots/itemphysics.png" alt="item physics">
<img src="screenshots/lsd.png" alt="lsd module">
<img src="screenshots/macros.png" alt="macros tab">
<img src="screenshots/trajectories.png" alt="projectile trajectories">
## contribution
yes please (PRs are welcome)
## license
[CC0 license](LICENSE)
## disclaimer
i don't give a single fuck what happens to you when using this mod on servers where its features are bannable and such.
## deps
- [fabric api](https://modrinth.com/mod/fabric-api/)
## notes
this mod IS BUGGY. VERY BUGGY, i know. i started this project when i was 14 and the codebase is such a mess i refuse to fix it. i might rewrite it in a future, though.
+26 -34
View File
@@ -1,6 +1,11 @@
<p align="center">
<a href="README.md"><img src="https://img.shields.io/badge/lang-Español-yellow.svg" alt="español"></a>
<a href="README.en.md"><img src="https://img.shields.io/badge/lang-English-blue.svg" alt="english"></a>
</p>
# jenny's mod 2 100% real
mod para Minecraft Fabric 26.2 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
> mod para Minecraft Fabric 26.2 que añade algunas cosas "QOL", mayormente relacionadas a la cámara.
## instalación
@@ -14,10 +19,10 @@ asegúrate de tener una version de Minecraft y Fabric compatibles con el mod (MC
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/sputnik`)
1. clona el respositorio (`git clone https://codeberg.org/retucio/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/sputnik-X.X.jar` (el que no lleva "sources" en el nombre)
3. `gradlew build` para Windows (ew) o `chmod +x gradlew` + `./gradlew build` para Unix-likes (Linux & Mac)
4. el resultado estará en `/build/libs/sputnik-X.X.jar`
## uso
@@ -33,28 +38,25 @@ algunos módulos tienen teclas asignadas por defecto, asígnales `ESC` para desa
- clic izquierdo para activar / desactivar módulos
- clic derecho para abrir sus ajustes
- clic izquierdo + arrastrar para mover marcos
- clic izquierdo + arrastrar para mover paneles
- clic derecho en la cabeza del marco para expandirlo / contraerlo o para cerrarlo
- clic izquierdo sobre ajustes para modificarlos
- shift + clic derecho sobre ajustes para restablecerlos
- posiciona el puntero del ratón sobre un módulo o ajuste para leer su descripción
### protips
- shift mientras pasas el puntero por encima de un ajuste de modos para ver los modos disponibles
- clic derecho para ciclar hacia atrás en ajustes de modo
- usa la rueda del ratón para mover la interfaz verticalmente
- shift + rueda del ratón para mover todos los marcos a un rango visible en la pantalla
## capturas
<img src="screenshots/ui.png" alt="interfaz">
<img src="screenshots/nametags.png" alt="nametags mostrando daño de un tridente">
<img src="screenshots/chatplus.png" alt="chatplus y capturas en uso">
<img src="screenshots/crits.png" alt="críticos">
<img src="screenshots/fullbright.png" alt="fullbright en modo gamma cambiando el color de los shaders">
<img src="screenshots/hud.png" alt="HUD">
<img src="screenshots/automine.png" alt="auto minado">
<img src="screenshots/blockesp.png" alt="resaltado de bloques + superposición de luz">
<img src="screenshots/camtweaks.png" alt="perspectiva plus">
<img src="screenshots/chatplus.png" alt="chatplus + nametags + capturas">
<img src="screenshots/clickgui.png" alt="interfaz">
<img src="screenshots/freecam.png" alt="cámara libre + trazos">
<img src="screenshots/hudeditor.png" alt="editor de HUD">
<img src="screenshots/colorpicker.png" alt="selector de colores">
<img src="screenshots/itemphysics.png" alt="físicas de items">
<img src="screenshots/lsd.png" alt="LSD">
<img src="screenshots/macros.png" alt="macros">
<img src="screenshots/trajectories.png" alt="trayectorias">
## contribuciones
@@ -62,26 +64,16 @@ sí por favor
## licencia
no sé, haz lo que quieras con esto, es puta basura xd
aunque estaría guay que acreditases
pero bueno
[licencia CC0](LICENSE)
## descargo de responsabilidad
me importa una puta mierda lo que pase al usar este mod en servers donde es baneable y así.
## mods recomendados
## dependencias
> mods que recomiendo usar junto a este:
- [fabric api](https://modrinth.com/mod/fabric-api/)
- [fabric api (necesario)](https://modrinth.com/mod/fabric-api/): necesario para el mod
- [sodium](https://modrinth.com/mod/sodium): mejora el rendimiento general del juego
- [viafabricplus](https://modrinth.com/mod/viafabricplus): te permite conectarte a servidores que tengan una versión distinta a la de tu cliente
- [xaero's world map](https://modrinth.com/mod/xaeros-world-map/) y [xaero's minimap](https://modrinth.com/mod/xaeros-minimap/): mapa chulo
- [mod menu](https://modrinth.com/mod/modmenu): lista de los mods instalados, y sus ajustes
- [iris](https://modrinth.com/mod/iris): shaders
- [lambdynamiclights](https://modrinth.com/mod/lambdynamiclights): iluminación dinámica
- [appleskin](https://modrinth.com/mod/appleskin/): información relacionada con la comida
- [baritone (desactualizado)](https://github.com/cabaletta/baritone): google maps para juego de cubos
## notas
este mod tiene MUCHOS bugs. empecé este proyecto cuando tenía 14 años y no sabía una mierda de programar. el código es un puto desastre y me niego a arreglarlo. puede que en un futuro reescriba el mod o algo. no sé.
+6 -8
View File
@@ -1,18 +1,16 @@
# v6.2
# v6.5
## novedades
### adiciones
#### elementos del HUD nuevos:
- arraylist: lista de los módulos activados
### arreglos / mejoras
- ahora puedes hacer puentes de varios bloques de ancho con `andamios`
- unidades distintas para el elemento del HUD `velocidad`
- opción para cancelar la animación original para `progreso de minado`
- ahora los amigos se muestran en una pestaña separada en la interfaz
## problemas reconocidos
- lo de siempre.
- `reponer` no funciona
- `copiar` tras sacar una captura con `capturas` no funciona correctamente
- \+ lo de siempre.
+1 -1
View File
@@ -10,6 +10,6 @@ discord_rpc_version=1.0.3
neutrino_version=1.1.0
jdk_version=25
mod_version=6.2
mod_version=6.5
maven_group=me.retucio
archives_base_name=sputnik
+2 -3
View File
@@ -1,7 +1,6 @@
#Sat Aug 29 22:10:52 CEST 2026
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 KiB

After

Width:  |  Height:  |  Size: 700 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 691 KiB

@@ -14,7 +14,7 @@ import java.util.Map;
public class BinarySerializer {
private static final int MAGIC_NUMBER = 0x53505554; // "SPUT"
private static final int VERSION = 3;
private static final int VERSION = 4;
private static final int MIN_VERSION = 2;
private static final byte TYPE_NULL = 0;
@@ -72,7 +72,7 @@ public class BinarySerializer {
writeStringIntArrayMap(out, config.hudPositions);
writeStringBooleanMap(out, config.hudVisibilities);
writeStringStringMap(out, config.hudImagePaths);
writeStringStringMap(out, config.friends);
writeFriendsMap(out, config.friends);
writeMacros(out, config.macros);
writeString(out, config.currentProfile);
@@ -123,7 +123,9 @@ public class BinarySerializer {
Map<String, int[]> hudPositions = readStringIntArrayMap(in);
Map<String, Boolean> hudVisibilities = readStringBooleanMap(in);
Map<String, String> hudImagePaths = readStringStringMap(in);
Map<String, String> friends = readStringStringMap(in);
Map<String, ClientConfig.FriendData> friends = version >= 4
? readFriendsMap(in)
: migrateFriendsMap(readStringStringMap(in));
List<ClientConfig.MacroData> macros = version >= 3 ? readMacros(in) : new ArrayList<>();
String currentProfile = version >= 3 ? readString(in) : "";
@@ -422,6 +424,45 @@ public class BinarySerializer {
return macros;
}
private static void writeFriendsMap(DataOutputStream out, Map<String, ClientConfig.FriendData> map)
throws IOException {
if (map == null) {
out.writeInt(0);
return;
}
out.writeInt(map.size());
for (Map.Entry<String, ClientConfig.FriendData> entry : map.entrySet()) {
writeString(out, entry.getKey());
ClientConfig.FriendData data = entry.getValue();
writeString(out, data.name());
writeString(out, data.nick());
out.writeLong(data.befriendedAt());
}
}
private static Map<String, ClientConfig.FriendData> readFriendsMap(DataInputStream in)
throws IOException {
int size = in.readInt();
Map<String, ClientConfig.FriendData> map = new HashMap<>(size);
for (int i = 0; i < size; i++) {
String uuid = readString(in);
String name = readString(in);
String nick = readString(in);
long befriendedAt = in.readLong();
map.put(uuid, new ClientConfig.FriendData(name, nick, befriendedAt));
}
return map;
}
private static Map<String, ClientConfig.FriendData> migrateFriendsMap(Map<String, String> legacy) {
Map<String, ClientConfig.FriendData> map = new HashMap<>(legacy.size());
long now = System.currentTimeMillis();
for (Map.Entry<String, String> entry : legacy.entrySet()) {
map.put(entry.getKey(), new ClientConfig.FriendData(entry.getValue(), entry.getValue(), now));
}
return map;
}
private static void writeString(DataOutputStream out, String str) throws IOException {
if (str == null) {
out.writeInt(-1);
@@ -4,8 +4,6 @@ import com.github.retucio.neutrino.EventListener;
import me.retucio.sputnik.event.sputnik.*;
import me.retucio.sputnik.module.setting.settings.*;
import me.retucio.sputnik.ui.screen.ClickGui;
import me.retucio.sputnik.ui.widgets.panels.FriendsPanel;
import me.retucio.sputnik.util.ChatUtil;
import java.io.Serial;
import java.io.Serializable;
@@ -44,8 +42,8 @@ public class ClientConfig {
// posición de la barra de búsqueda (x, y)
public int[] searchBarPosition = new int[] { 340, 16 };
// amigos: uuid -> nombre
public Map<String, String> friends = new HashMap<>();
// amigos: uuid -> FriendData (nombre, apodo, fecha)
public Map<String, FriendData> friends = new HashMap<>();
public List<MacroData> macros = new ArrayList<>();
@@ -146,31 +144,15 @@ public class ClientConfig {
ConfigManager.INSTANCE.markDirty();
}
@EventListener
public void onExtendFriendsPanel(FriendPanelEvent.Extend event) {
extendablePanels.put("amigos", new PanelData(
ClickGui.INSTANCE.getFriendsPanel().getX(),
ClickGui.INSTANCE.getFriendsPanel().getY(),
ClickGui.INSTANCE.getFriendsPanel().isExtended()));
ConfigManager.INSTANCE.markDirty();
}
@EventListener
public void onMoveFriendsPanel(FriendPanelEvent.Move event) {
extendablePanels.put("amigos", new PanelData(
ClickGui.INSTANCE.getFriendsPanel().getX(),
ClickGui.INSTANCE.getFriendsPanel().getY(),
ClickGui.INSTANCE.getFriendsPanel().isExtended()));
ConfigManager.INSTANCE.markDirty();
}
@EventListener
public void onAddFriend(FriendEvent.Add event) {
if (isApplying()) return;
String uuid = event.getFriend().getUuid().toString();
String name = event.getFriend().getName();
if (!friends.containsKey(uuid)) {
friends.put(uuid, name);
friends.put(uuid, new FriendData(
event.getFriend().getName(),
event.getFriend().getNick(),
event.getFriend().getBefriendedAt()));
}
ConfigManager.INSTANCE.markDirty();
}
@@ -182,10 +164,25 @@ public class ClientConfig {
ConfigManager.INSTANCE.markDirty();
}
@EventListener
public void onRenameFriend(FriendEvent.Rename event) {
if (isApplying()) return;
String uuid = event.getFriend().getUuid().toString();
FriendData existing = friends.get(uuid);
if (existing == null) return; // no debería pasar, pero porsiaca
friends.put(uuid, new FriendData(existing.name(), event.getFriend().getNick(), existing.befriendedAt()));
ConfigManager.INSTANCE.markDirty();
}
public record PanelData(int x, int y, boolean extended) implements Serializable {
@Serial private static final long serialVersionUID = 1L;
}
public record FriendData(String name, String nick, long befriendedAt) implements Serializable {
@Serial private static final long serialVersionUID = 1L;
}
public record MacroData(String name, int key, List<String> lines) implements Serializable {
@Serial private static final long serialVersionUID = 1L;
}
@@ -16,12 +16,10 @@ import me.retucio.sputnik.ui.hud.HudElement;
import me.retucio.sputnik.ui.hud.HudRenderer;
import me.retucio.sputnik.ui.widgets.Panel;
import me.retucio.sputnik.ui.widgets.panels.ExtendablePanel;
import me.retucio.sputnik.ui.widgets.panels.FriendsPanel;
import me.retucio.sputnik.ui.widgets.panels.ModulePanel;
import me.retucio.sputnik.ui.screen.ClickGui;
import me.retucio.sputnik.ui.widgets.panels.settings.ClientSettingsPanel;
import me.retucio.sputnik.ui.widgets.panels.SettingsPanel;
import me.retucio.sputnik.util.ChatUtil;
import me.retucio.sputnik.util.I18nUtil;
import net.minecraft.network.chat.Component;
@@ -316,15 +314,15 @@ public class ConfigManager {
// ------------------ APLICAR AJUSTES ------------------
public void applyFriends() {
config.friends.forEach((uuid, name) -> {
Friend friend = new Friend(UUID.fromString(uuid));
friend.setName(name);
config.friends.forEach((uuid, data) -> {
Friend friend = new Friend(UUID.fromString(uuid), data.befriendedAt());
friend.setName(data.name());
friend.setNick(data.nick());
FriendManager.INSTANCE.add(friend);
});
Sputnik.LOGGER.info(I18nUtil.fmt("sputnik.config.info.friends",
"amigos aplicados"));
}
public void applyMacros() {
MacroManager.INSTANCE.setMacros(config.macros.stream()
.map(data -> new Macro(data.name(), data.key(), data.lines()))
@@ -424,7 +422,6 @@ public class ConfigManager {
applyExtendablePanel(panel);
}
applyExtendablePanel(ClickGui.INSTANCE.getClientSettingsPanel());
applyExtendablePanel(ClickGui.INSTANCE.getFriendsPanel());
Sputnik.LOGGER.info(I18nUtil.fmt("sputnik.config.info.extendablepanels",
"posiciones de marcos extendibles aplicadas"));
@@ -440,9 +437,6 @@ public class ConfigManager {
if (panel instanceof ClientSettingsPanel) {
panelData = config.extendablePanels.get("ajustes");
}
if (panel instanceof FriendsPanel) {
panelData = config.extendablePanels.get("amigos");
}
if (panelData != null) {
panel.setX(panelData.x());
@@ -3,7 +3,8 @@ package me.retucio.sputnik.event.sputnik;
import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.friend.Friend;
// evento lanzado cuando se agrega o se elimina un amigo
// evento lanzado cuando se agrega, elimina o renombra un amigo
public class FriendEvent extends Event {
private final Friend friend;
@@ -23,4 +24,8 @@ public class FriendEvent extends Event {
public static class Remove extends FriendEvent {
public Remove(Friend friend) { super(friend); }
}
public static class Rename extends FriendEvent {
public Rename(Friend friend) { super(friend); }
}
}
@@ -1,9 +0,0 @@
package me.retucio.sputnik.event.sputnik;
import com.github.retucio.neutrino.Event;
public class FriendPanelEvent {
public static class Extend extends Event {} // al extenderlo / contraerlo
public static class Move extends Event {} // al cambiarlo de posición
}
@@ -1,6 +1,7 @@
package me.retucio.sputnik.friend;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.PlayerInfo;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import org.jetbrains.annotations.Nullable;
@@ -13,12 +14,20 @@ public class Friend {
private static final Minecraft mc = Minecraft.getInstance();
private String name;
private String nick;
private final UUID uuid;
private final long befriendedAt;
private boolean searchMatch;
public Friend(UUID uuid) {
this.uuid = uuid;
this.befriendedAt = System.currentTimeMillis();
}
public Friend(UUID uuid, long befriendedAt) {
this.uuid = uuid;
this.befriendedAt = befriendedAt;
}
public String getName() {
@@ -29,10 +38,27 @@ public class Friend {
this.name = name;
}
public String getNick() {
return nick;
}
public void setNick(String nick) {
this.nick = nick;
}
// apodo si existe, si no el nombre real
public String getDisplayName() {
return (nick == null || nick.isBlank()) ? name : nick;
}
public UUID getUuid() {
return uuid;
}
public long getBefriendedAt() {
return befriendedAt;
}
public @Nullable Player getPlayer() {
if (mc.level == null) return null;
Entity entity = mc.level.getEntity(uuid);
@@ -40,6 +66,11 @@ public class Friend {
return player;
}
public @Nullable PlayerInfo getPlayerInfo() {
if (mc.getConnection() == null) return null;
return mc.getConnection().getPlayerInfo(uuid);
}
public boolean isSearchMatch() {
return searchMatch;
}
@@ -29,6 +29,7 @@ public class FriendManager {
public void add(UUID uuid) {
Friend friend = new Friend(uuid);
friend.setName(friend.getPlayer().getName().getString());
friend.setNick(friend.getName());
add(friend);
}
@@ -61,6 +62,11 @@ public class FriendManager {
return Friend.Status.SUCCESS;
}
public void rename(Friend friend, String nick) {
friend.setNick(nick);
Sputnik.EVENT_BUS.post(new FriendEvent.Rename(friend));
}
public Friend get(UUID uuid) {
for (Friend friend : friends) {
if (friend.getUuid().equals(uuid)) {
@@ -8,8 +8,10 @@ import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.world.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -0,0 +1,33 @@
package me.retucio.sputnik.mixin.mixins.misc;
import me.retucio.sputnik.util.Lists;
import net.minecraft.core.Holder;
import net.minecraft.core.component.DataComponentMap;
import net.minecraft.core.component.DataComponents;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.item.Item;
import org.jspecify.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Holder.Reference.class)
public abstract class ReferenceMixin<T> {
@Shadow
private @Nullable DataComponentMap components;
@Shadow
private @Nullable T value;
@Inject(method = "bindComponents", at = @At("TAIL"))
private void onBindComponents(DataComponentMap components, CallbackInfo ci) {
if (this.components == null || !this.components.has(DataComponents.FOOD)) return;
if (!(this.value instanceof Item item)) return;
Lists.foodList.add(item);
Lists.foodNames.put(item, BuiltInRegistries.ITEM.getKey(item).toLanguageKey());
}
}
@@ -10,16 +10,25 @@ import me.retucio.sputnik.event.render.Render3DEvent;
import me.retucio.sputnik.event.render.RenderBlockOutlineEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.modules.render.BreakingProgress;
import me.retucio.sputnik.util.render.SputnikBuffers;
import net.minecraft.client.DeltaTracker;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.ShaderManager;
import net.minecraft.client.renderer.SubmitNodeCollector;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher;
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
import net.minecraft.client.renderer.state.level.CameraRenderState;
import net.minecraft.client.renderer.state.level.LevelRenderState;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.client.resources.model.sprite.AtlasManager;
import net.minecraft.util.profiling.ProfilerFiller;
import org.joml.Matrix4fc;
import org.joml.Vector4f;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
@@ -31,6 +40,14 @@ import static me.retucio.sputnik.Sputnik.mc;
@Mixin(LevelRenderer.class)
public abstract class LevelRendererMixin {
@Unique
private BreakingProgress bp;
@Inject(method = "<init>", at = @At("TAIL"))
private void getModules(EntityRenderDispatcher entityRenderDispatcher, BlockEntityRenderDispatcher blockEntityRenderDispatcher, ModelManager modelManager, TextureManager textureManager, AtlasManager atlasManager, ShaderManager shaderManager, GameRenderer gameRenderer, int width, int height, CallbackInfo ci) {
bp = ModuleManager.INSTANCE.getModuleByClass(BreakingProgress.class);
}
@Inject(method = "render", at = @At("RETURN"))
private void render(GraphicsResourceAllocator resourceAllocator, DeltaTracker dt, boolean renderOutline, CameraRenderState cameraState, Matrix4fc modelViewMatrix, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky, CallbackInfo ci, @Local(name = "profiler") ProfilerFiller profiler) {
if (mc == null || mc.level == null) return;
@@ -55,13 +72,6 @@ public abstract class LevelRendererMixin {
if (freecam.isEnabled() && !freecam.blockOutlines.getValue()) ci.cancel();
}
// @Inject(method = "hasBlindnessOrDarkness(Lnet/minecraft/client/extractRenderState/Camera;)Z", at = @At("HEAD"), cancellable = true)
// private void hasBlindnessOrDarkness(Camera camera, CallbackInfoReturnable<Boolean> cir) {
// NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
// if (!noRender.isEnabled()) return;
// if (!noRender.blindnessEffect.getValue() || !noRender.darknessEffect.getValue()) cir.setReturnValue(null);
// }
// puto mojang con sus nombres confusos
@ModifyArgs(method = "submitBlockOutline", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LevelRenderer;submitHitOutline(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/rendertype/RenderType;Lnet/minecraft/client/renderer/state/level/BlockOutlineRenderState;IFZ)V"))
private void modifyBlockOutline(Args args) {
@@ -72,4 +82,12 @@ public abstract class LevelRendererMixin {
if (event.getLineWidth() != (float) args.get(5))
args.set(5, event.getLineWidth());
}
@Inject(method = "submitBlockDestroyAnimation", at = @At("HEAD"), cancellable = true)
private void cancelBreakingAnim(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, LevelRenderState levelRenderState, CallbackInfo ci) {
if (!bp.isEnabled()) return;
if (bp.cancelAnim.getValue()) {
ci.cancel();
}
}
}
@@ -8,7 +8,6 @@ import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.modules.render.Nametags;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
@@ -16,6 +15,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@@ -49,19 +49,27 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity> {
}
@ModifyReturnValue(method = "shouldShowName(Lnet/minecraft/world/entity/LivingEntity;D)Z", at = @At("RETURN"))
private boolean shouldRenderPlayerNametag(boolean original, @Local(argsOnly = true) T livingEntity) {
if (nametags.isEnabled() && livingEntity instanceof Player)
private boolean shouldRenderPlayerNametag(boolean original, @Local(argsOnly = true, name = "entity") T entity) {
if (nametags.isEnabled() && entity instanceof Player)
return nametags.entities.isEnabled(EntityTypes.PLAYER) && original;
return original;
}
@Inject(method = "shouldShowName(Lnet/minecraft/world/entity/LivingEntity;D)Z", at = @At("RETURN"), cancellable = true)
private void renderSelfNametag(T livingEntity, double d, CallbackInfoReturnable<Boolean> cir) {
if (livingEntity instanceof Player player) {
private void renderSelfNametag(T entity, double distanceToCameraSq, CallbackInfoReturnable<Boolean> cir) {
if (entity instanceof Player player) {
if (player == mc.player && nametags.showSelf.getValue()) {
cir.setReturnValue(true);
cir.cancel();
}
}
}
@ModifyArg(method = "extractNameTags(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;F)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/EntityRenderer;extractNameTags(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/client/renderer/entity/state/EntityRenderState;FDD)V"), index = 3)
private double modifyNametagRenderDistance(double original) {
if (nametags.isEnabled()) {
return nametags.distance.getValue();
}
return original;
}
}
@@ -185,8 +185,6 @@ public class Module {
// getters y setters
// OJO: nombre interno. es la clave de la config. (moduleStates, getSettingKey, settingsPanels)
// y no se traduce nunca. para mostrarlo al usuario usar getDisplayName()
public String getName() {
return name;
}
@@ -182,10 +182,12 @@ public class ModuleManager {
add(new Nametags());
add(new NoRender());
add(new Particles());
add(new Stylish());
add(new Tracers());
}
private void addWorld() {
add(new AutoMine());
add(new AutoSign());
add(new AutoTool());
add(new BlockInfo());
@@ -358,8 +358,9 @@ public class Freecam extends Module {
if (mc.player == null) return; // el jugador probablemente nunca sea nulo bajo estas circunstancias pero quién sabe
if (event.getPacket() instanceof ClientboundPlayerCombatKillPacket packet) {
if (mc.player.getId() == packet.playerId())
if (mc.player.getId() == packet.playerId()) {
toggle();
}
} else if (event.getPacket() instanceof ClientboundSetHealthPacket packet) {
if (mc.player.getHealth() - packet.getHealth() > 0 && toggleOnDamage.getValue()) {
ChatUtil.info(Component.translatable("sputnik.module.freecam.damagedisable"));
@@ -34,8 +34,10 @@ public class ScreenshotPlus extends Module {
private final SettingGroup sgButtons = addSg(new SettingGroup("botones", true));
public final EnumSetting<ScreenshotActions> defaultAction = sgGeneral.add(new EnumSetting<>("por defecto", "qué acción tomar por defecto",
ScreenshotActions.class, ScreenshotActions.NONE));
public final EnumSetting<ScreenshotActions> defaultAction = sgGeneral.add(new EnumSetting<>(
"por defecto", "qué acción tomar por defecto",
ScreenshotActions.class, ScreenshotActions.NONE)
);
private final BooleanSetting saveButton = sgButtons.add(new BooleanSetting("botón de guardar", "mostrar botón para guardar la captura localmente", true));
private final BooleanSetting copyButton = sgButtons.add(new BooleanSetting("botón de copiar", "mostrar botón para copiar la captura al portapapeles", true));
@@ -13,12 +13,12 @@ import org.jspecify.annotations.NonNull;
public class PacketCanceller extends Module {
private final ListSetting<PacketType<? extends @NonNull Packet<?>>> c2s = sgGeneral.add(new ListSetting(
private final ListSetting<PacketType<? extends @NonNull Packet<?>>> c2s = sgGeneral.add(new ListSetting<>(
"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(
private final ListSetting<PacketType<? extends @NonNull Packet<?>>> s2c = sgGeneral.add(new ListSetting<>(
"S2C", "paquetes a cancelar, dirección cliente",
Lists.s2cPacketList, Lists.allFalse(Lists.s2cPacketList), Lists.s2cPacketNames
));
@@ -54,8 +54,6 @@ public class PacketMine extends Module {
ClickAction.ADD_PRIORITY
));
// el espacio del final es a propósito: compartía clave de config. con retryTime ("delay"),
// así que se pisaban el valor. se muestra igual porque getName() hace strip()
private final NumberSetting selectionDelay = sgGeneral.add(new NumberSetting(
"delay ",
"delay entre selecciones de bloques",
@@ -2,12 +2,18 @@ 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.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.ListSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import me.retucio.sputnik.util.InventoryUtil;
import me.retucio.sputnik.util.Lists;
import net.minecraft.core.component.DataComponents;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.component.Consumable;
import net.minecraft.world.item.consume_effects.ApplyStatusEffectsConsumeEffect;
import java.util.Comparator;
import java.util.List;
@@ -20,10 +26,28 @@ public class AutoEat extends Module {
6, 0, 19, 1
));
private final NumberSetting whenToStop = sgGeneral.add(new NumberSetting(
"cuándo parar", "cuántos puntos de comida hace falta tener para parar de comer",
20, 1, 20, 1
));
private final ListSetting<Item> blacklist = sgGeneral.add(new ListSetting<>(
"lista negra", "alimentos a NO comer",
() -> Lists.foodList,
() -> Lists.allFalseExcept(Lists.foodList, this::isBad),
() -> Lists.foodNames
));
private boolean eating;
public AutoEat() {
super("puto gordo", "come automáticamente al tener hambre", Category.PLAYER);
super("puto gordo", "come aut/omáticamente al tener hambre", Category.PLAYER);
}
@Override
public void onDisable() {
if (eating) stopEating();
super.onDisable();
}
@Override
@@ -34,7 +58,9 @@ public class AutoEat extends Module {
if (mc.player.getUseItemRemainingTicks() > 0) {
return;
} else {
stopEating();
if (mc.player.getFoodData().getFoodLevel() >= whenToStop.getIntValue()) {
stopEating();
}
}
}
@@ -42,15 +68,21 @@ public class AutoEat extends Module {
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()));
sorted.sort(Comparator.comparingInt(
(ItemStack s) -> s.getItem().components().get(DataComponents.FOOD).nutrition()
).reversed());
if (sorted.isEmpty()) return;
sorted.removeIf(stack -> blacklist.isEnabled(stack.getItem()));
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;
break;
}
}
@@ -79,4 +111,13 @@ public class AutoEat extends Module {
eating = false;
mc.options.keyUse.setDown(false);
}
private boolean isBad(Item item) {
Consumable consumable = item.components().get(DataComponents.CONSUMABLE);
if (consumable == null) return false;
return consumable.onConsumeEffects().stream()
.anyMatch(effect -> effect instanceof ApplyStatusEffectsConsumeEffect applyEffects
&& applyEffects.effects().stream().anyMatch(mobEffectInstance ->
!mobEffectInstance.getEffect().value().isBeneficial()));
}
}
@@ -20,16 +20,22 @@ import java.awt.*;
public class BreakingProgress extends Module {
private final SettingGroup sgOulines = addSg(new SettingGroup("contorno", true));
private final SettingGroup sgOutlines = addSg(new SettingGroup("contorno", true));
private final SettingGroup sgFilling = addSg(new SettingGroup("relleno", true));
private final EnumSetting<BreakMode> breakMode = sgGeneral.add(new EnumSetting<>("modo de minado", "elige si el cubo se encoge o se dilata",
BreakMode.class, BreakMode.INWARDS));
private final BooleanSetting outlines = sgOulines.add(new BooleanSetting("contorno", "renderizar contorno", true));
private final ColorSetting outlineColor = sgOulines.add(new ColorSetting("color del contorno", "color del contorno",
public final BooleanSetting cancelAnim = sgGeneral.add(new BooleanSetting(
"cancelar animación",
"no renderizar la anim. original",
true
));
private final BooleanSetting outlines = sgOutlines.add(new BooleanSetting("contorno", "renderizar contorno", true));
private final ColorSetting outlineColor = sgOutlines.add(new ColorSetting("color del contorno", "color del contorno",
new Color(0, 255, 0, 200), false));
private final NumberSetting lineWidth = sgOulines.add(new NumberSetting("grosor de línea", "grosor de las líneas del contorno", 1, 1, 5, 0.1));
private final NumberSetting lineWidth = sgOutlines.add(new NumberSetting("grosor de línea", "grosor de las líneas del contorno", 1, 1, 5, 0.1));
private final BooleanSetting fillings = sgFilling.add(new BooleanSetting("relleno", "renderizar relleno", true));
private final ColorSetting fillingColor = sgFilling.add(new ColorSetting("color del relleno", "color del relleno",
@@ -3,6 +3,7 @@ package me.retucio.sputnik.module.modules.render;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.config.ConfigManager;
import me.retucio.sputnik.mixin.mixins.entity.EntityMixin;
import me.retucio.sputnik.mixin.mixins.entity.ItemEntityMixin;
import me.retucio.sputnik.mixin.mixins.player.PlayerMixin;
@@ -13,6 +14,7 @@ import me.retucio.sputnik.module.setting.SettingGroup;
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.EnumSetting;
import me.retucio.sputnik.module.setting.settings.ListSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import me.retucio.sputnik.util.Lists;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.Mth;
@@ -64,6 +66,7 @@ public class Nametags extends Module {
public final BooleanSetting alwaysVisible = sgGeneral.add(new BooleanSetting("siempre mostrar nametags", "mostrar nametag cuando el jugador está agachado o es invisible", false));
public final BooleanSetting showSelf = sgGeneral.add(new BooleanSetting("mostrar propio", "mostrar nametag propio", false));
public final BooleanSetting friendNick = sgGeneral.add(new BooleanSetting("motes", "usar los motes de amigos", true));
public final NumberSetting distance = sgGeneral.add(new NumberSetting("distancia", "distancia máxima para renderizar nametags", 1024, 1, 1024, 1));
public final BooleanSetting countItems = sgInfo.add(new BooleanSetting("contar items", "muestra cuánto de un item hay en un stack dropeado", true));
public final BooleanSetting showProjectileDamage = sgInfo.add(new BooleanSetting("daño del proyectil", "muestra cuánto daño hace un proyectil en su nametag", true));
@@ -88,7 +91,7 @@ public class Nametags extends Module {
defaultEntities.replace(EntityTypes.TNT, true);
entities.setDefaultValue(defaultEntities);
health.onUpdate(v -> healthMode.visibility(v));
health.onUpdate(healthMode::visibility);
entities.onUpdate(entities -> {
items.visibility(entities.get(EntityTypes.ITEM));
@@ -129,7 +132,7 @@ public class Nametags extends Module {
@SuppressWarnings("deprecation")
public String getOwnerName(EntityReference<LivingEntity> owner) {
// si el dueño está en línea (de manera segura)
if (mc.level instanceof UniquelyIdentifyable queriableWorld) { // UUIDLookup<?> ??
if (mc.level instanceof UniquelyIdentifyable queriableWorld) {
LivingEntity ownerEntity = owner.resolve(queriableWorld, LivingEntity.class);
if (ownerEntity instanceof Player playerEntity) return playerEntity.getName().getString();
}
@@ -0,0 +1,255 @@
package me.retucio.sputnik.module.modules.render;
import com.github.retucio.neutrino.EventListener;
import com.mojang.blaze3d.vertex.PoseStack;
import me.retucio.sputnik.event.input.KeyEvent;
import me.retucio.sputnik.event.render.RenderHeldItemEvent;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.EnumSetting;
import me.retucio.sputnik.module.setting.settings.KeySetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import net.minecraft.world.InteractionHand;
import org.joml.Quaternionf;
import org.lwjgl.glfw.GLFW;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Stylish extends Module {
private final KeySetting key = sgGeneral.add(new KeySetting(
"tecla", "tecla a pulsar para hacer el truco",
GLFW.GLFW_KEY_Y
));
private final EnumSetting<TrickType> trick = sgGeneral.add(new EnumSetting<>(
"truco", "qué truco hacer al pulsar la tecla",
TrickType.class, TrickType.SPIN
));
private final BooleanSetting comboMode = sgGeneral.add(new BooleanSetting(
"combo", "encadena varios trucos distintos en una sola pulsación",
false
));
private final NumberSetting comboLength = sgGeneral.add(new NumberSetting(
"trucos por combo", "cuántos trucos encadenar si el combo está activado",
3, 2, 6, 1
)).visibility(comboMode::getValue);
private final NumberSetting speed = sgGeneral.add(new NumberSetting(
"velocidad", "velocidad de giro (grados/seg)",
360, 30, 2000, 1
));
private final NumberSetting spins = sgGeneral.add(new NumberSetting(
"vueltas", "cuantas vueltas completas da por truco",
1, 1, 5, 1
));
private final EnumSetting<RotateDirection> dir = sgGeneral.add(new EnumSetting<>(
"dirección", "dirección a rotar el ítem",
RotateDirection.class, RotateDirection.COUNTER_CLOCKWISE
));
private final EnumSetting<Hand> hand = sgGeneral.add(new EnumSetting<>(
"mano", "en qué mano(s) hacerlo",
Hand.class, Hand.MAIN_HAND
));
private final BooleanSetting easing = sgGeneral.add(new BooleanSetting(
"suavizado", "usa una curva de aceleración/desaceleración en vez de velocidad lineal",
true
));
private final NumberSetting cooldown = sgGeneral.add(new NumberSetting(
"cooldown", "tiempo mínimo en ms entre activaciones",
150, 0, 2000, 10
));
// estado de anim.
private boolean spinning = false;
private float progressDegrees = 0f;
private long lastTimeNanos = 0L;
private long lastTriggerMillis = 0L;
private final List<TrickType> queue = new ArrayList<>();
private int queueIndex = 0;
private final Random random = new Random();
public Stylish() {
super("estiloso", "haz truquitos con items en las manos", Category.RENDER);
}
@EventListener
private void onKey(KeyEvent event) {
if (event.getKey() != key.getValue()) return;
if (event.getAction() != GLFW.GLFW_PRESS) return;
if (spinning) return;
long now = System.currentTimeMillis();
if (now - lastTriggerMillis < cooldown.getIntValue()) return;
lastTriggerMillis = now;
buildQueue();
startNextTrick();
}
private void buildQueue() {
queue.clear();
queueIndex = 0;
if (!comboMode.getValue()) {
queue.add(resolveTrick(trick.getValue()));
return;
}
int amount = comboLength.getIntValue();
for (int i = 0; i < amount; i++) {
queue.add(resolveTrick(TrickType.RANDOM));
}
}
private TrickType resolveTrick(TrickType requested) {
if (requested != TrickType.RANDOM) return requested;
TrickType[] real = {
TrickType.SPIN, TrickType.FLIP, TrickType.ROLL,
TrickType.TWIRL, TrickType.WAVE, TrickType.POP, TrickType.THROW_CATCH
};
return real[random.nextInt(real.length)];
}
private void startNextTrick() {
if (queueIndex >= queue.size()) {
spinning = false;
return;
}
spinning = true;
progressDegrees = 0f;
lastTimeNanos = System.nanoTime();
}
@EventListener
private void onRenderHeldItem(RenderHeldItemEvent event) {
if (!spinning) return;
if ((event.getHand() == InteractionHand.MAIN_HAND && hand.is(Hand.OFF_HAND))
|| (event.getHand() == InteractionHand.OFF_HAND && hand.is(Hand.MAIN_HAND))
) {
return;
}
PoseStack matrices = event.getMatrices();
long now = System.nanoTime();
float delta = (now - lastTimeNanos) / 1_000_000_000f;
lastTimeNanos = now;
float target = 360.0f * spins.getIntValue();
progressDegrees += speed.getFloatValue() * delta;
boolean finished = progressDegrees >= target;
if (finished) progressDegrees = target;
float rawFraction = progressDegrees / target; // 0..1
float fraction = easing.getValue() ? easeInOutCubic(rawFraction) : rawFraction;
TrickType current = queue.get(queueIndex);
applyTrick(current, matrices, fraction);
if (finished) {
queueIndex++;
if (queueIndex < queue.size()) {
startNextTrick();
} else {
spinning = false;
}
}
}
private void applyTrick(TrickType type, PoseStack matrices, float fraction) {
float directionSign = dir.getValue() == RotateDirection.CLOCKWISE ? -1f : 1f;
float degrees = fraction * 360.0f * spins.getIntValue();
float angleRad = (float) Math.toRadians(degrees * directionSign);
switch (type) {
case SPIN -> matrices.mulPose(new Quaternionf().rotationZ(angleRad));
case FLIP -> matrices.mulPose(new Quaternionf().rotationX(angleRad));
case ROLL -> matrices.mulPose(new Quaternionf().rotationY(angleRad));
case TWIRL -> {
// combina spin + flip para un giro más aparatoso
matrices.mulPose(new Quaternionf().rotationZ(angleRad));
matrices.mulPose(new Quaternionf().rotationX(angleRad * 0.5f));
}
case WAVE -> {
// bamboleo tipo saludo, sin vuelta completa
float waveAngle = (float) Math.sin(fraction * Math.PI * spins.getIntValue()) * 25f;
matrices.mulPose(new Quaternionf().rotationZ((float) Math.toRadians(waveAngle * directionSign)));
}
case POP -> {
// pequeño pulso de escala, como si el ítem "respirara"
float scalePulse = 1f + (float) Math.sin(fraction * Math.PI) * 0.25f;
matrices.scale(scalePulse, scalePulse, scalePulse);
matrices.mulPose(new Quaternionf().rotationZ(angleRad * 0.3f));
}
case THROW_CATCH -> {
// el ítem "sube", gira en el aire y "cae" de vuelta
float height = (float) Math.sin(fraction * Math.PI) * 0.35f;
matrices.translate(0f, height, 0f);
matrices.mulPose(new Quaternionf().rotationX(angleRad * 2f));
}
case RANDOM -> {
// no debería llegar aquí, resolveTrick lo reemplaza antes
matrices.mulPose(new Quaternionf().rotationZ(angleRad));
}
}
}
private float easeInOutCubic(float t) {
return t < 0.5f
? 4f * t * t * t
: 1f - (float) Math.pow(-2f * t + 2f, 3) / 2f;
}
private enum TrickType {
SPIN("giro"),
FLIP("voltereta"),
ROLL("balanceo"),
TWIRL("giro doble"),
WAVE("saludo"),
POP("pulso"),
THROW_CATCH("lanzar y coger"),
RANDOM("aleatorio");
private final String name;
TrickType(String name) { this.name = name; }
@Override public String toString() { return name; }
}
private enum RotateDirection {
CLOCKWISE("sentido horario"),
COUNTER_CLOCKWISE("sentido antihorario");
private final String name;
RotateDirection(String name) { this.name = name; }
@Override public String toString() { return name; }
}
private enum Hand {
MAIN_HAND("mano principal"),
OFF_HAND("mano secundaria");
private final String name;
Hand(String name) { this.name = name; }
@Override public String toString() { return name; }
}
}
@@ -4,6 +4,8 @@ import com.github.retucio.neutrino.EventListener;
import me.retucio.sputnik.event.render.Render3DEvent;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.setting.SettingGroup;
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.ColorSetting;
@@ -46,7 +48,7 @@ public class Tracers extends Module {
private final BooleanSetting self = sgGeneral.add(new BooleanSetting(
"uno mismo",
"apuntarse a uno mismo en cámara libre o así",
"apuntarse a uno mismo en cámara libre",
true
));
@@ -105,6 +107,7 @@ public class Tracers extends Module {
private Color getColor(Entity entity) {
if (!entities.isEnabled(entity.getType())) return null;
if (!self.getValue() && mc.player == entity) return null;
if (self.getValue() && mc.player == entity && !ModuleManager.INSTANCE.getModuleByClass(Freecam.class).isEnabled()) return null;
if (entity instanceof Player) return playerColor.getValue();
return switch (entity.getType().getCategory()) {
@@ -0,0 +1,484 @@
package me.retucio.sputnik.module.modules.world;
import com.github.retucio.neutrino.EventListener;
import me.retucio.sputnik.event.input.MouseClickEvent;
import me.retucio.sputnik.event.interact.AttackBlockEvent;
import me.retucio.sputnik.event.network.PacketEvent;
import me.retucio.sputnik.event.render.Render3DEvent;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.SettingGroup;
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.ColorSetting;
import me.retucio.sputnik.module.setting.settings.EnumSetting;
import me.retucio.sputnik.module.setting.settings.ListSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import me.retucio.sputnik.util.ChatUtil;
import me.retucio.sputnik.util.InventoryUtil;
import me.retucio.sputnik.util.Lists;
import me.retucio.sputnik.util.MiscUtil;
import me.retucio.sputnik.util.RotationUtil;
import me.retucio.sputnik.util.render.RenderUtil;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.component.DataComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.component.Tool;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.lwjgl.glfw.GLFW;
import java.awt.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class AutoMine extends Module {
private final SettingGroup sgBlocks = addSg(new SettingGroup("bloques", true));
private final SettingGroup sgRender = addSg(new SettingGroup("renderizado", true));
private final EnumSetting<SelectionMode> mode = sgGeneral.add(new EnumSetting<>(
"modo de selección",
"cómo seleccionar los bloques a minar",
SelectionMode.class,
SelectionMode.INDIVIDUAL
));
private final NumberSetting maxBlocks = sgGeneral.add(new NumberSetting(
"límite de bloques",
"cantidad máxima de bloques a seleccionar de una vez (caja / flood)",
256,
1,
4096,
1
));
private final NumberSetting retryTime = sgGeneral.add(new NumberSetting(
"delay",
"delay entre reintentos de minado",
30,
0,
1000,
1
));
private final BooleanSetting cancelOutOfReach = sgGeneral.add(new BooleanSetting(
"cancelar fuera de alcance",
"cancelar aquellos paquetes que intenten romper bloques fuera del alcance del jugador",
true
));
private final BooleanSetting autoTool = sgGeneral.add(new BooleanSetting(
"auto herramienta",
"cambiar automáticamente a la herramienta más rápida antes de minar cada bloque",
true
));
private final BooleanSetting dontBreak = sgGeneral.add(new BooleanSetting(
"no romper pico",
"evita romper la herramienta seleccionada",
true
));
private final EnumSetting<RotateMode> rotate = sgGeneral.add(new EnumSetting<>(
"rotar",
"rotar al minar bloques mediante el módulo",
RotateMode.class, RotateMode.NONE
));
private final NumberSetting packetLimiter = sgGeneral.add(new NumberSetting(
"limitar paquetes",
"limita la cantidad de paquetes enviados en un segundo (0 para desactivar)",
15000, 0, 30000, 100
));
private final ListSetting<Block> blacklist = sgBlocks.add(new ListSetting<>(
"lista negra",
"bloques a excluir de la selección",
Lists.blockList,
Lists.allFalse(Lists.blockList),
Lists.blockNames
));
private final BooleanSetting render = sgRender.add(new BooleanSetting(
"renderizar",
"renderizar un contorno alrededor de los bloques que están siendo minados",
true
));
private final ColorSetting color = sgRender.add(new ColorSetting(
"color",
"color del contorno renderizado",
new Color(0, 255, 0, 100),
false
));
private final ColorSetting pendingColor = sgRender.add(new ColorSetting(
"color de selección pendiente",
"color del contorno de la primera esquina, en modo caja, mientras se espera la segunda",
new Color(255, 255, 0, 100),
false
));
private final NumberSetting lineWidth = sgRender.add(new NumberSetting(
"grosor",
"grosor de las líneas del contorno",
2,
0.1,
10,
0.1
));
private final List<MiningBlock> miningBlocks = new ArrayList<>();
private BlockPos pendingCorner = null;
private int packetCount = 0;
private int tickCount = 0;
public AutoMine() {
super(
"auto minado",
"selecciona un área o bloques individuales para minarlos automáticamente",
Category.WORLD
);
render.onUpdate(v -> {
color.visibility(v);
pendingColor.visibility(v);
lineWidth.visibility(v);
});
}
@Override
public void onDisable() {
miningBlocks.clear();
pendingCorner = null;
packetCount = 0;
tickCount = 0;
super.onDisable();
}
@Override
public void onTick() {
if (mc.player == null || mc.level == null || mc.gameMode == null) return;
tickCount++;
if (tickCount % 20 == 0) {
tickCount = 0;
packetCount = 0;
}
if (miningBlocks.isEmpty()) return;
// se limpian bloques ya rotos, o que fueron blacklisteados después de seleccionarse
Iterator<MiningBlock> iterator = miningBlocks.iterator();
while (iterator.hasNext()) {
MiningBlock block = iterator.next();
BlockState state = mc.level.getBlockState(block.pos);
if (state.isAir() || blacklist.isEnabled(state.getBlock())) {
iterator.remove();
}
}
for (MiningBlock block : miningBlocks) {
processBlock(block);
}
}
@EventListener
private void onClick(MouseClickEvent event) {
if (mc.gui.screen() != null) return;
if (mc.level == null || mc.hitResult == null) return;
if (event.getAction() != GLFW.GLFW_PRESS) return;
if (event.getButton() != GLFW.GLFW_MOUSE_BUTTON_1) return;
BlockHitResult bhr;
if (mc.hitResult.getType() == HitResult.Type.BLOCK) {
bhr = (BlockHitResult) mc.hitResult;
} else {
return;
}
event.cancel();
BlockPos pos = bhr.getBlockPos();
Direction dir = bhr.getDirection();
Block block = mc.level.getBlockState(pos).getBlock();
// clicar un bloque ya seleccionado lo quita de la selección, sea cual sea el modo
MiningBlock existing = getMiningBlock(pos);
if (existing != null) {
miningBlocks.remove(existing);
return;
}
if (blacklist.isEnabled(block)) {
ChatUtil.warn(Component.translatable("sputnik.module.autominado.blacklisted"));
return;
}
switch (mode.getValue()) {
case INDIVIDUAL -> tryAddBlock(pos, dir);
case BOX -> handleBoxSelection(pos, dir);
case FLOOD_FILL -> handleFloodFill(pos, dir);
}
}
@EventListener
private void onRenderWorld(Render3DEvent event) {
if (!render.getValue()) return;
for (MiningBlock block : miningBlocks) {
block.render(event);
}
if (pendingCorner != null) {
renderOutline(event, pendingCorner, pendingColor.getValue());
}
}
@EventListener
private void onPacketSend(PacketEvent.Send event) {
if (packetLimiter.getValue() <= 0) return;
if (packetCount > packetLimiter.getIntValue()) {
event.cancel();
return;
}
packetCount++;
}
private void handleBoxSelection(BlockPos pos, Direction dir) {
if (pendingCorner == null) {
pendingCorner = pos;
ChatUtil.info(Component.translatable("sputnik.module.autominado.cornerselected"));
return;
}
BlockPos corner1 = pendingCorner;
BlockPos corner2 = pos;
pendingCorner = null;
int minX = Math.min(corner1.getX(), corner2.getX());
int maxX = Math.max(corner1.getX(), corner2.getX());
int minY = Math.min(corner1.getY(), corner2.getY());
int maxY = Math.max(corner1.getY(), corner2.getY());
int minZ = Math.min(corner1.getZ(), corner2.getZ());
int maxZ = Math.max(corner1.getZ(), corner2.getZ());
int added = 0;
int limit = maxBlocks.getIntValue();
outer:
for (int x = minX; x <= maxX; x++) {
for (int y = minY; y <= maxY; y++) {
for (int z = minZ; z <= maxZ; z++) {
if (added >= limit) break outer;
if (tryAddBlock(new BlockPos(x, y, z), dir)) added++;
}
}
}
ChatUtil.info(Component.translatable("sputnik.module.autominado.boxselected", added));
}
private void handleFloodFill(BlockPos origin, Direction dir) {
if (mc.level == null) return;
Block target = mc.level.getBlockState(origin).getBlock();
Set<BlockPos> visited = new HashSet<>();
Deque<BlockPos> queue = new ArrayDeque<>();
queue.add(origin);
visited.add(origin);
int added = 0;
int limit = maxBlocks.getIntValue();
while (!queue.isEmpty() && added < limit) {
BlockPos current = queue.poll();
if (mc.level.getBlockState(current).getBlock() != target) continue;
if (tryAddBlock(current, dir)) added++;
for (Direction d : Direction.values()) {
BlockPos neighbor = current.relative(d);
if (visited.contains(neighbor)) continue;
visited.add(neighbor);
if (mc.level.getBlockState(neighbor).getBlock() == target) {
queue.add(neighbor);
}
}
}
ChatUtil.info(Component.translatable("sputnik.module.autominado.floodfilled", added));
}
// false si el bloque no se pudo (o no debía) agregar: aire, ya seleccionado o en la lista negra
private boolean tryAddBlock(BlockPos pos, Direction dir) {
if (mc.level == null) return false;
if (mc.level.getBlockState(pos).isAir()) return false;
if (getMiningBlock(pos) != null) return false;
if (blacklist.isEnabled(mc.level.getBlockState(pos).getBlock())) return false;
miningBlocks.add(new MiningBlock(pos, dir));
return true;
}
private boolean processBlock(MiningBlock block) {
if (mc.level.getBlockState(block.pos).isAir()) return false;
if (!block.mining) {
return block.mine();
} else if (block.shouldRetry()) {
block.startTime = System.currentTimeMillis();
block.mining = false;
return block.mine();
}
return false;
}
private MiningBlock getMiningBlock(BlockPos pos) {
for (MiningBlock block : miningBlocks) {
if (block.pos.equals(pos)) return block;
}
return null;
}
// básicamente AutoTool::selectFastestTool, pero apuntado a un bloque puntual en vez del raycast bajo la mira
private void switchToBestTool(BlockPos pos) {
if (mc.player == null || mc.level == null) return;
BlockState state = mc.level.getBlockState(pos);
List<ItemStack> tools = InventoryUtil.findAllStacks(stack -> stack.has(DataComponents.TOOL));
Map<Float, ItemStack> speeds = new HashMap<>();
for (ItemStack tool : tools) {
int slot = mc.player.getInventory().findSlotMatchingItem(tool);
if (!Inventory.isHotbarSlot(slot)) continue;
Tool toolComponent = tool.get(DataComponents.TOOL);
if (toolComponent != null) {
speeds.put(toolComponent.getMiningSpeed(state), tool);
}
}
if (speeds.isEmpty()) return;
Float fastestSpeed = MiscUtil.getHighest(speeds.keySet().stream().toList());
ItemStack fastestTool = speeds.get(fastestSpeed);
int slot = mc.player.getInventory().findSlotMatchingItem(fastestTool);
if (slot != -1) mc.player.getInventory().setSelectedSlot(slot);
}
private void renderOutline(Render3DEvent event, BlockPos pos, Color renderColor) {
VoxelShape shape = mc.level.getBlockState(pos).getShape(mc.level, pos);
if (shape.isEmpty()) return;
RenderUtil.drawVoxelShapeOutline(
event.getMatrices(),
shape,
pos,
renderColor,
lineWidth.getFloatValue(),
false
);
}
private RotationUtil.Mode getRotationMode() {
return switch (rotate.getValue()) {
case CLIENT, BOTH -> RotationUtil.Mode.CLIENT;
case SERVER -> RotationUtil.Mode.SILENT;
case NONE -> null;
};
}
private class MiningBlock {
BlockPos pos;
Direction dir;
boolean mining = false;
long startTime;
public MiningBlock(BlockPos pos, Direction dir) {
this.pos = pos;
this.dir = dir;
this.startTime = System.currentTimeMillis();
}
public boolean mine() {
if (cancelOutOfReach.getValue()
&& mc.player.position().distanceToSqr(Vec3.atLowerCornerOf(pos)) > Math.pow(mc.player.blockInteractionRange(), 2)) {
return false;
}
if (dontBreak.getValue()
&& mc.player.isHolding(ItemStack::isDamageableItem)
&& mc.player.getMainHandItem().getMaxDamage() - mc.player.getMainHandItem().getDamageValue() <= 1) {
ChatUtil.warn(Component.translatable("sputnik.module.autominado.pickbreaking"));
toggle();
return false;
}
if (autoTool.getValue()) {
switchToBestTool(pos);
}
Runnable mine = () -> {
mc.gameMode.startPrediction(mc.level, sequence ->
new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, pos, dir, sequence));
mc.gameMode.startPrediction(mc.level, sequence ->
new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.STOP_DESTROY_BLOCK, pos, dir, sequence));
};
RotationUtil.Mode rotation = getRotationMode();
if (rotation == null) mine.run();
else RotationUtil.lookAt(RotationUtil.NORMAL, Vec3.atLowerCornerOf(pos), 0, rotation, mine);
mining = true;
return true;
}
public void render(Render3DEvent event) {
renderOutline(event, pos, color.getValue());
}
public boolean shouldRetry() {
return mining && (System.currentTimeMillis() - startTime >= retryTime.getValue());
}
}
private enum SelectionMode {
INDIVIDUAL("individual"),
BOX("caja"),
FLOOD_FILL("inundación");
private final String name;
SelectionMode(String name) { this.name = name; }
@Override public String toString() { return name; }
}
private enum RotateMode {
CLIENT("cámara"),
SERVER("mediante paquetes"),
BOTH("ambos"),
NONE("no");
private final String name;
RotateMode(String name) { this.name = name; }
@Override public String toString() { return name; }
}
}
@@ -4,22 +4,31 @@ import me.retucio.sputnik.module.setting.Setting;
import me.retucio.sputnik.util.I18nUtil;
import java.util.*;
import java.util.function.Supplier;
public class ListSetting<T> extends Setting<Map<T, Boolean>> {
private final List<T> options;
private List<T> options;
private Map<T, String> displayNames = null;
private final Supplier<List<T>> optionsSupplier;
private final Supplier<Map<T, Boolean>> initialValuesSupplier;
private final Supplier<Map<T, String>> displayNamesSupplier;
private boolean resolved;
public ListSetting(String name, String description, List<T> options, Map<T, Boolean> initialValues) {
super(name, description, initialValues);
super(name, description, new HashMap<>());
this.optionsSupplier = null;
this.initialValuesSupplier = null;
this.displayNamesSupplier = null;
this.resolved = true;
this.options = new ArrayList<>(options);
this.defaultValue = new HashMap<>();
for (T option : options) {
boolean enabled = initialValues != null && initialValues.getOrDefault(option, false);
defaultValue.put(option, enabled);
}
this.value = new HashMap<>(defaultValue);
}
@@ -28,11 +37,65 @@ public class ListSetting<T> extends Setting<Map<T, Boolean>> {
this.displayNames = displayNames;
}
// constructor "lazy": para listas que no están listas (no pun intended) al momento de construirlas
public ListSetting(String name, String description,
Supplier<List<T>> optionsSupplier,
Supplier<Map<T, Boolean>> initialValuesSupplier,
Supplier<Map<T, String>> displayNamesSupplier
) {
super(name, description, new HashMap<>());
this.optionsSupplier = optionsSupplier;
this.initialValuesSupplier = initialValuesSupplier;
this.displayNamesSupplier = displayNamesSupplier;
this.resolved = false;
this.options = new ArrayList<>();
this.defaultValue = new HashMap<>();
this.value = new HashMap<>();
}
// resuelve la lista real la primera vez que se necesita
private void resolveIfNeeded() {
if (resolved || optionsSupplier == null) return;
resolved = true;
List<T> resolvedOptions = optionsSupplier.get();
if (resolvedOptions == null) resolvedOptions = new ArrayList<>();
Map<T, Boolean> resolvedInitial = initialValuesSupplier != null ? initialValuesSupplier.get() : null;
Map<T, Boolean> previousValue = this.value;
this.options = new ArrayList<>(resolvedOptions);
this.defaultValue = new HashMap<>();
for (T option : resolvedOptions) {
boolean enabled = resolvedInitial != null && resolvedInitial.getOrDefault(option, false);
defaultValue.put(option, enabled);
}
this.value = new HashMap<>(defaultValue);
// preservar cualquier valor ya aplicado (p. ej. por ConfigManager) antes del resolve
if (previousValue != null) {
for (Map.Entry<T, Boolean> entry : previousValue.entrySet()) {
if (this.value.containsKey(entry.getKey())) {
this.value.put(entry.getKey(), entry.getValue());
}
}
}
if (displayNamesSupplier != null) {
this.displayNames = displayNamesSupplier.get();
}
}
public boolean isEnabled(T option) {
resolveIfNeeded();
return value.getOrDefault(option, false);
}
public void setEnabled(T option, boolean enabled) {
resolveIfNeeded();
if (value.containsKey(option) && value.get(option) != enabled) {
value.put(option, enabled);
fireUpdateEvent();
@@ -45,22 +108,26 @@ public class ListSetting<T> extends Setting<Map<T, Boolean>> {
}
public Map<T, Boolean> getValues() {
resolveIfNeeded();
return new HashMap<>(value);
}
@Override
public void setValue(Map<T, Boolean> values) {
resolveIfNeeded();
if (!this.value.equals(values)) {
super.setValue(values);
}
}
public void setDefaultValue(Map<T, Boolean> values) {
resolveIfNeeded();
defaultValue.clear();
defaultValue.putAll(values);
}
public Map<String, Boolean> getConfigValues() {
resolveIfNeeded();
Map<String, Boolean> configValues = new HashMap<>();
for (T option : options) {
configValues.put(getConfigName(option), value.getOrDefault(option, false));
@@ -69,16 +136,17 @@ public class ListSetting<T> extends Setting<Map<T, Boolean>> {
}
public void addOption(T option, boolean isDefault, String displayName) {
resolveIfNeeded();
options.add(option);
defaultValue.put(option, isDefault);
value.put(option, isDefault);
if (this.displayNames != null) {
this.displayNames.put(option, displayName);
}
}
public void setAll(boolean enabled) {
resolveIfNeeded();
for (T option : options) {
value.put(option, enabled);
}
@@ -87,10 +155,12 @@ public class ListSetting<T> extends Setting<Map<T, Boolean>> {
}
public List<T> getOptions() {
resolveIfNeeded();
return Collections.unmodifiableList(options);
}
public List<T> getEnabledOptions() {
resolveIfNeeded();
List<T> enabledOptions = new ArrayList<>();
for (T option : options) {
if (isEnabled(option)) {
@@ -101,21 +171,18 @@ public class ListSetting<T> extends Setting<Map<T, Boolean>> {
}
public Map<T, String> getDisplayNames() {
resolveIfNeeded();
return displayNames != null ? new HashMap<>(displayNames) : null;
}
// OJO: nombre interno de la opción. es la clave de la config. (ver
// ConfigManager#applyListSetting) y para las listas del juego es la clave de
// traducción ("entity.minecraft.zombie"), que no depende del idioma. no traducir
public String getConfigName(T key) {
resolveIfNeeded();
if (displayNames != null && displayNames.containsKey(key)) {
return displayNames.get(key);
}
return key != null ? key.toString() : "?";
}
// nombre visible: se traduce aquí. antes se mostraba el nombre interno tal cual, o sea
// los nombres de vanilla en inglés aunque el juego estuviera en otro idioma
public String getDisplayName(T key) {
String name = getConfigName(key);
return I18nUtil.orElse(name, name);
@@ -12,11 +12,10 @@ import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.Setting;
import me.retucio.sputnik.module.setting.settings.ColorSetting;
import me.retucio.sputnik.ui.widgets.buttons.FriendButton;
import me.retucio.sputnik.ui.screen.tabs.FriendsTab;
import me.retucio.sputnik.ui.widgets.buttons.settings.ListButton;
import me.retucio.sputnik.ui.widgets.buttons.ModuleButton;
import me.retucio.sputnik.ui.widgets.buttons.SettingButton;
import me.retucio.sputnik.ui.widgets.panels.FriendsPanel;
import me.retucio.sputnik.ui.widgets.panels.settings.ClientSettingsPanel;
import me.retucio.sputnik.ui.widgets.panels.settings.ColorPickerPanel;
import me.retucio.sputnik.ui.widgets.panels.ModulePanel;
@@ -31,7 +30,6 @@ import me.retucio.sputnik.ui.widgets.misc.ScrollBarWidget;
import me.retucio.sputnik.ui.widgets.misc.SearchBarWidget;
import me.retucio.sputnik.ui.widgets.misc.TabBarWidget;
import me.retucio.sputnik.util.Colors;
import me.retucio.sputnik.ui.widgets.panels.settings.FriendSettingsPanel;
import me.retucio.sputnik.util.KeyUtil;
import me.retucio.sputnik.util.MiscUtil;
@@ -69,7 +67,6 @@ public class ClickGui extends Screen {
private final List<ModulePanel> modulePanels = new ArrayList<>();
private final List<SettingsPanel> settingsPanels = new ArrayList<>();
private final ClientSettingsPanel clientSettingsPanel = new ClientSettingsPanel(620, 280, 100, 20);
private final FriendsPanel friendsPanel = new FriendsPanel(40, 280, 100, 20);
private final ScrollBarWidget scrollBar = new ScrollBarWidget();
private final SearchBarWidget searchBar = new SearchBarWidget(320, 10, 320, 20);
@@ -78,6 +75,9 @@ public class ClickGui extends Screen {
private final TabBarWidget tabBar = new TabBarWidget(this::onTabLeft);
private final ProfilesTab profilesTab = new ProfilesTab();
private final MacrosTab macrosTab = new MacrosTab();
private final FriendsTab friendsTab = new FriendsTab();
private static final int PLACEMENT_SEARCH_STEP = 8;
public ClickGui() {
super(Component.translatable("sputnik.ui.clickgui.title"));
@@ -97,6 +97,7 @@ public class ClickGui extends Screen {
case HUD -> renderHud(gui, mouseX, mouseY);
case PROFILES -> profilesTab.render(gui, mouseX, mouseY, delta);
case MACROS -> macrosTab.render(gui, mouseX, mouseY, delta);
case FRIENDS -> friendsTab.render(gui, mouseX, mouseY, delta);
}
tabBar.render(gui, mouseX, mouseY, delta);
@@ -124,7 +125,6 @@ public class ClickGui extends Screen {
searchBar.updatePosition(mouseX, mouseY);
// actualizar la posición de renderizado vertical de los paneles cada tick
friendsPanel.updateRenderY(scrollOffset);
clientSettingsPanel.updateRenderY(scrollOffset);
for (ModulePanel mp : modulePanels) {
mp.updateRenderY(scrollOffset);
@@ -149,9 +149,6 @@ public class ClickGui extends Screen {
sp.drawTooltips(gui, mouseX, mouseY);
}
friendsPanel.render(gui, mouseX, mouseY, delta);
friendsPanel.updatePosition(mouseX, mouseY);
clientSettingsPanel.render(gui, mouseX, mouseY, delta);
clientSettingsPanel.updatePosition(mouseX, mouseY);
@@ -191,10 +188,6 @@ public class ClickGui extends Screen {
bottom = Math.max(bottom, sp.getY() + sp.getH() + sp.getTotalHeight());
}
int friendsBottom = friendsPanel.getY() + friendsPanel.getH()
+ (friendsPanel.isExtended() ? friendsPanel.getTotalHeight() : 0);
bottom = Math.max(bottom, friendsBottom);
int clientBottom = clientSettingsPanel.getY() + clientSettingsPanel.getH()
+ (clientSettingsPanel.isExtended() ? clientSettingsPanel.getTotalHeight() : 0);
bottom = Math.max(bottom, clientBottom);
@@ -202,6 +195,46 @@ public class ClickGui extends Screen {
return bottom + 20; // padding
}
private int[] findEmptyPosition(int w, int h, int preferredX, int preferredY) {
int screenWidth = mc.getWindow().getGuiScaledWidth();
int maxX = Math.max(0, screenWidth - w);
int startX = Math.clamp(preferredX, 0, maxX);
int startY = Math.max(preferredY, 0);
int searchBottom = calculateContentHeight() + h;
for (int y = startY; y <= searchBottom; y += PLACEMENT_SEARCH_STEP) {
for (int candidateX = 0; candidateX <= maxX; candidateX += PLACEMENT_SEARCH_STEP) {
if (!overlapsAnything(candidateX, y, w, h)) {
return new int[]{candidateX, y};
}
}
}
// no hay hueco: colocarlo debajo de todo lo demás, para llegar a él haciendo scroll
return new int[]{startX, calculateContentHeight()};
}
private boolean overlapsAnything(int x, int y, int w, int h) {
for (ModulePanel mp : modulePanels) {
int mpHeight = mp.getH() + (mp.isExtended() ? mp.getTotalHeight() : 0);
if (rectsOverlap(x, y, w, h, mp.getX(), mp.getY(), mp.getW(), mpHeight)) return true;
}
for (SettingsPanel sp : settingsPanels) {
int spHeight = sp.getH() + sp.getTotalHeight();
if (rectsOverlap(x, y, w, h, sp.getX(), sp.getY(), sp.getW(), spHeight)) return true;
}
int clientHeight = clientSettingsPanel.getH() + (clientSettingsPanel.isExtended() ? clientSettingsPanel.getTotalHeight() : 0);
return rectsOverlap(x, y, w, h, clientSettingsPanel.getX(), clientSettingsPanel.getY(), clientSettingsPanel.getW(), clientHeight);
}
private boolean rectsOverlap(int ax, int ay, int aw, int ah, int bx, int by, int bw, int bh) {
return ax < bx + bw && ax + aw > bx
&& ay < by + bh && ay + ah > by;
}
@Override
public boolean mouseClicked(MouseButtonEvent click, boolean doubled) {
int x = (int) click.x();
@@ -212,8 +245,6 @@ public class ClickGui extends Screen {
switch (tabBar.getSelected()) {
case MODULES -> {
miscWidgets.forEach(w -> w.mouseClicked(x, y, click.button()));
friendsPanel.mouseClicked(x, y, click.button());
clientSettingsPanel.mouseClicked(x, y, click.button());
for (ModulePanel mp : modulePanels.reversed()) {
mp.mouseClicked(x, y, click.button());
@@ -225,6 +256,7 @@ public class ClickGui extends Screen {
case HUD -> HudEditor.INSTANCE.mouseClicked(x, y, click.button());
case PROFILES -> profilesTab.mouseClicked(x, y, click.button());
case MACROS -> macrosTab.mouseClicked(x, y, click.button());
case FRIENDS -> friendsTab.mouseClicked(x, y, click.button());
}
return super.mouseClicked(click, doubled);
@@ -246,7 +278,6 @@ public class ClickGui extends Screen {
x, y, click.button()));
// registrar cuándo se suelta el clic, en cada panel respectivamente
friendsPanel.mouseReleased(x, y, click.button());
clientSettingsPanel.mouseReleased(x, y, click.button());
for (ModulePanel mp : modulePanels.reversed()) {
mp.mouseReleased(x, y, click.button());
@@ -290,6 +321,7 @@ public class ClickGui extends Screen {
}
case PROFILES -> profilesTab.onKey(event.getKey(), event.getAction());
case MACROS -> macrosTab.onKey(event.getKey(), event.getAction());
case FRIENDS -> friendsTab.onKey(event.getKey(), event.getAction());
}
}
@@ -313,7 +345,6 @@ public class ClickGui extends Screen {
if (correction != 0) {
modulePanels.forEach(mp -> mp.setY(mp.getY() + correction));
settingsPanels.forEach(sp -> sp.setY(sp.getY() + correction));
friendsPanel.setY(friendsPanel.getY() + correction);
clientSettingsPanel.setY(clientSettingsPanel.getY() + correction);
}
}
@@ -382,26 +413,6 @@ public class ClickGui extends Screen {
}
}
for (Button b : friendsPanel.getButtons()) {
if (!(b instanceof FriendButton fb)) continue;
Friend friend = fb.getFriend();
if (searchInput.isEmpty()) {
friend.setSearchMatch(true);
continue;
}
String name = MiscUtil.removeAccentMarks(friend.getName());
String uuid = MiscUtil.removeAccentMarks(friend.getUuid().toString());
if (!clientSettings.matchCase.getValue()) {
name = name.toLowerCase();
uuid = uuid.toLowerCase();
}
friend.setSearchMatch(name.contains(searchInput) || uuid.contains(searchInput));
}
for (Button b : clientSettingsPanel.getButtons()) {
if (!(b instanceof SettingButton<?> sb)) continue;
Setting<?> setting = sb.getSetting();
@@ -433,12 +444,18 @@ public class ClickGui extends Screen {
);
}
// abrir un marco donde se encuentran los ajustes del módulo deseado
// abrir un marco donde se encuentran los ajustes del módulo deseado, buscando un
// hueco libre cerca de (x, y) para que no se solape con otros paneles ya abiertos
public void openSettingsPanel(Module module, int x, int y) {
// asegurarse de que no se sale de la pantalla
x = Math.clamp(x, 0, mc.getWindow().getGuiScaledWidth() - 80);
SettingsPanel panel = new SettingsPanel(module, 0, 0, 100, 20);
panel.updateTotalHeight(); // altura real disponible ya tras el constructor
int panelHeight = panel.getH() + panel.getTotalHeight();
int[] position = findEmptyPosition(panel.getW(), panelHeight, x, y);
panel.setX(position[0]);
panel.setY(position[1]);
SettingsPanel panel = new SettingsPanel(module, x, y, 100, 20);
settingsPanels.add(panel);
Sputnik.EVENT_BUS.post(new SettingsPanelEvent.Open(panel));
@@ -499,33 +516,6 @@ public class ClickGui extends Screen {
}
}
public boolean isFriendSettingsPanelOpen(Friend friend) {
for (SettingsPanel sp : getSettingsPanels()) {
if (sp instanceof FriendSettingsPanel fsp) {
if (fsp.getFriend().getUuid().equals(friend.getUuid())) return true;
}
}
return false;
}
public void openFriendSettingsPanel(Friend friend, int x, int y) {
FriendSettingsPanel panel = new FriendSettingsPanel(friend, x + 80, y + 5, 153, 20);
if (isFriendSettingsPanelOpen(friend)) {
closeFriendSettingsPanel(friend);
return;
}
settingsPanels.add(panel);
}
public void closeFriendSettingsPanel(Friend friend) {
for (SettingsPanel sp : getSettingsPanels()) {
if (sp instanceof FriendSettingsPanel fsp && fsp.getFriend().getUuid().equals(friend.getUuid())) {
settingsPanels.remove(fsp);
break;
}
}
}
public void refreshListButtons() {
for (SettingsPanel panel : settingsPanels)
for (Button button : panel.getButtons())
@@ -546,7 +536,8 @@ public class ClickGui extends Screen {
// lo miran Sputnik#onInput y el editor del hud para no tratar las teclas que se están
// escribiendo como atajos de módulos
public boolean isCapturingInput() {
return searchBar.isFocused() || profilesTab.isCapturingInput() || macrosTab.isCapturingInput();
return searchBar.isFocused() || profilesTab.isCapturingInput()
|| macrosTab.isCapturingInput() || friendsTab.isCapturingInput();
}
public boolean isOnHudTab() {
@@ -599,7 +590,6 @@ public class ClickGui extends Screen {
public List<ModulePanel> getModulePanels() { return modulePanels; }
public List<SettingsPanel> getSettingsPanels() { return settingsPanels; }
public ClientSettingsPanel getClientSettingsPanel() { return clientSettingsPanel; }
public FriendsPanel getFriendsPanel() { return friendsPanel; }
public SearchBarWidget getSearchBar() { return searchBar; }
public TabBarWidget getTabBar() { return tabBar; }
public ScrollBarWidget getScrollBar() { return scrollBar; }
@@ -8,7 +8,8 @@ public enum Tab {
MODULES("módulos"),
HUD("hud"),
PROFILES("perfiles"),
MACROS("macros");
MACROS("macros"),
FRIENDS("amigos");
private final String name;
@@ -0,0 +1,101 @@
package me.retucio.sputnik.ui.screen.tabs;
import me.retucio.sputnik.friend.Friend;
import me.retucio.sputnik.friend.FriendManager;
import me.retucio.sputnik.ui.hud.HudRenderer;
import me.retucio.sputnik.ui.widgets.misc.FriendWidget;
import me.retucio.sputnik.util.Colors;
import me.retucio.sputnik.util.I18nUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.network.chat.Component;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class FriendsTab {
private static final Minecraft mc = Minecraft.getInstance();
private static final int COLUMNS = 3;
private static final int CARD_HEIGHT = 60;
private static final int MARGIN = 6;
private static final int TOP = 40;
// uno por amigo, persistente entre frames para no perder el foco del campo de apodo mientras se edita
private final Map<UUID, FriendWidget> widgets = new LinkedHashMap<>();
public void render(GuiGraphicsExtractor gui, int mouseX, int mouseY, float delta) {
List<Friend> friends = FriendManager.INSTANCE.getFriends();
syncWidgets(friends);
int screenWidth = mc.getWindow().getGuiScaledWidth();
int cardWidth = screenWidth / COLUMNS;
gui.centeredText(mc.font, Component.translatable("sputnik.ui.friends.title"),
screenWidth / 2, TOP - 14, Colors.mainColor.getRGB());
if (friends.isEmpty()) {
gui.centeredText(mc.font, Component.translatable("sputnik.ui.friends.empty"),
screenWidth / 2, TOP + 20, Colors.instructionsTextColor.getRGB());
return;
}
int col = 0;
int row = 0;
for (Friend friend : friends) {
FriendWidget widget = widgets.get(friend.getUuid());
int cx = col * cardWidth + MARGIN;
int cy = TOP + row * (CARD_HEIGHT + MARGIN);
int cw = cardWidth - MARGIN * 2;
widget.updateBounds(cx, cy, cw, CARD_HEIGHT);
widget.render(gui, mouseX, mouseY, delta);
col++;
if (col >= COLUMNS) {
col = 0;
row++;
}
}
}
// añade widgets para amigos nuevos y elimina los de quienes ya no lo son
private void syncWidgets(List<Friend> friends) {
widgets.keySet().removeIf(uuid -> friends.stream().noneMatch(f -> f.getUuid().equals(uuid)));
for (Friend friend : friends) {
widgets.computeIfAbsent(friend.getUuid(),
uuid -> new FriendWidget(friend, 0, 0, 0, CARD_HEIGHT, this::remove));
}
}
private void remove(Friend friend) {
FriendManager.INSTANCE.remove(friend);
HudRenderer.INSTANCE.pushNotification(
I18nUtil.orElse("sputnik.ui.friends.title", "amigos"),
I18nUtil.orElse("sputnik.ui.friends.removed", "sputnik.ui.friends.removed", friend.getName()));
}
public void mouseClicked(int mouseX, int mouseY, int button) {
for (FriendWidget widget : widgets.values()) {
if (widget.isHovered(mouseX, mouseY) || widget.isCapturingInput()) {
widget.mouseClicked(mouseX, mouseY, button);
}
}
}
public void onKey(int key, int action) {
for (FriendWidget widget : widgets.values()) {
if (widget.isCapturingInput()) widget.onKey(key, action);
}
}
public boolean isCapturingInput() {
return widgets.values().stream().anyMatch(FriendWidget::isCapturingInput);
}
}
@@ -9,10 +9,6 @@ import java.util.function.Supplier;
public abstract class Panel<B extends Button> extends Widget {
// el título se resuelve al pintarlo, no al construir el marco: los marcos se crean en
// la inicialización del mod, cuando el idioma todavía no ha cargado, así que guardar el
// texto ya traducido dejaba los títulos en español para siempre (y no cambiaban aunque
// se cambiara el idioma del juego en marcha)
private Supplier<String> title;
protected final List<B> buttons = new ArrayList<>();
@@ -1,75 +0,0 @@
package me.retucio.sputnik.ui.widgets.buttons;
import me.retucio.sputnik.friend.Friend;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.ui.screen.ClickGui;
import me.retucio.sputnik.ui.widgets.panels.FriendsPanel;
import me.retucio.sputnik.ui.widgets.panels.ModulePanel;
import me.retucio.sputnik.ui.widgets.Button;
import me.retucio.sputnik.util.Colors;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.network.chat.Component;
// clase para el botón para cada módulo
public class FriendButton extends Button {
private final Friend friend;
public final int height = 18;
public FriendButton(Friend friend, FriendsPanel parent, int offset) {
super(parent, offset);
this.friend = friend;
}
@Override
public void render(GuiGraphicsExtractor gui, int mouseX, int mouseY, float delta) {
gui.fill( // dibujar el contorno del botón
parent.getX() + 2, parent.getRenderY() + offset + 3,
parent.getX() + parent.getW() - 2 , parent.getRenderY() + height + offset,
determineColor(mouseX, mouseY));
gui.text( // dibujar el nombre del amigo
mc.font, friend.getName(),
parent.getX() + 5, parent.getRenderY() + offset + (height / 2) - (mc.font.lineHeight / 2) + 2,
-1, true);
// dibujar "tooltips" (cajas de texto) al pasar el puntero encima del botón, para mostrar su UUID
if (isHovered(mouseX, mouseY)) {
drawTooltip(gui, mouseX, mouseY);
}
}
@Override
public void drawTooltip(GuiGraphicsExtractor gui, int mouseX, int mouseY) {
gui.setTooltipForNextFrame(Component.literal(friend.getUuid().toString()), mouseX, mouseY + 20);
}
@Override
public void mouseClicked(int mouseX, int mouseY, int button) {
if (isHovered(mouseX, mouseY) && ClickGui.INSTANCE.trySelect(this)) {
ClickGui.INSTANCE.openFriendSettingsPanel(friend, mouseX, mouseY);
}
}
// verifica si el puntero del ratón se encuentra sobre el botón
@Override
public boolean isHovered(int mouseX, int mouseY) {
return ClickGui.INSTANCE.canSelect(this)
&& mouseX > parent.getX()
&& mouseX < parent.getX() + parent.getW()
&& mouseY > parent.getRenderY() + offset
&& mouseY < parent.getRenderY() + height + offset;
}
public int determineColor(double mouseX, double mouseY) {
// determina el color del botón, dependiendo de si está el puntero encima
return isHovered((int) mouseX, (int) mouseY)
? Colors.buttonColor.brighter().getRGB()
: Colors.buttonColor.getRGB();
}
public Friend getFriend() {
return friend;
}
}
@@ -0,0 +1,156 @@
package me.retucio.sputnik.ui.widgets.misc;
import me.retucio.sputnik.friend.Friend;
import me.retucio.sputnik.friend.FriendManager;
import me.retucio.sputnik.ui.widgets.Widget;
import me.retucio.sputnik.util.Colors;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.client.gui.components.PlayerFaceExtractor;
import net.minecraft.client.multiplayer.PlayerInfo;
import net.minecraft.network.chat.Component;
import java.awt.Color;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.function.Consumer;
public class FriendWidget extends Widget {
private static final int PADDING = 6;
private static final int HEAD_SIZE = 28;
private static final int REMOVE_SIZE = 14;
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM/yyyy");
private final Friend friend;
private final Consumer<Friend> onRemove;
private final TextFieldWidget nickField;
public FriendWidget(Friend friend, int x, int y, int w, int h, Consumer<Friend> onRemove) {
super(x, y, w, h);
this.friend = friend;
this.onRemove = onRemove;
this.nickField = new TextFieldWidget(() -> "sputnik.ui.friends.nickplaceholder", 0, 0, 0, 14)
.maxLength(32)
.onSubmit(nick -> FriendManager.INSTANCE.rename(friend, nick));
}
// recalcula la posición/tamaño cada frame, para que la rejilla se adapte al ancho de pantalla
public void updateBounds(int x, int y, int w, int h) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
}
@Override
public void render(GuiGraphicsExtractor gui, int mouseX, int mouseY, float delta) {
boolean hovered = isHovered(mouseX, mouseY);
gui.fill(x, y, x + w, y + h, hovered ? Colors.buttonColor.brighter().getRGB() : Colors.buttonColor.getRGB());
int headX = x + PADDING;
int headY = y + (h - HEAD_SIZE) / 2;
drawHead(gui, headX, headY);
int textX = headX + HEAD_SIZE + 8;
int textW = x + w - REMOVE_SIZE - 10 - textX;
gui.text(mc.font, friend.getName(), textX, y + 6, -1, true);
int nickY = y + 6 + mc.font.lineHeight + 2;
if (nickField.isFocused()) {
nickField.setX(textX);
nickField.setY(nickY);
nickField.setW(textW);
nickField.render(gui, mouseX, mouseY, delta);
} else {
gui.text(mc.font, friend.getDisplayName(), textX, nickY, Colors.mainColor.getRGB(), true);
}
String date = DATE_FORMAT.format(new Date(friend.getBefriendedAt()));
gui.text(mc.font, Component.translatable("sputnik.ui.friends.befriendedon", date),
textX, y + h - mc.font.lineHeight - 5, Colors.instructionsTextColor.getRGB(), true
);
String uuid = friend.getUuid().toString();
gui.text(mc.font, Component.translatable("sputnik.ui.friends.uuid", uuid),
textX, y + 24 + mc.font.lineHeight, Colors.instructionsTextColor.getRGB(), true
);
drawRemoveButton(gui, mouseX, mouseY);
}
private void drawHead(GuiGraphicsExtractor gui, int hx, int hy) {
PlayerInfo info = friend.getPlayerInfo();
if (info != null) {
PlayerFaceExtractor.extractRenderState(gui, info.getSkin(), hx, hy, HEAD_SIZE, -1);
} else {
// sin conexión al jugador (offline / no en el mismo server): placeholder gris
gui.fill(hx, hy, hx + HEAD_SIZE, hy + HEAD_SIZE, Colors.panelBgColor.getRGB());
}
}
private void drawRemoveButton(GuiGraphicsExtractor gui, int mouseX, int mouseY) {
int rx = x + w - REMOVE_SIZE - 5;
int ry = y + 5;
boolean hovered = isRemoveHovered(mouseX, mouseY);
gui.fill(rx, ry, rx + REMOVE_SIZE, ry + REMOVE_SIZE,
hovered ? new Color(200, 60, 60).brighter().getRGB() : new Color(150, 40, 40).getRGB());
gui.text(mc.font, "x", rx + REMOVE_SIZE / 2 - 2, ry + REMOVE_SIZE / 2 - mc.font.lineHeight / 2, -1, true);
}
@Override
public void mouseClicked(int mouseX, int mouseY, int button) {
if (button == 0 && isRemoveHovered(mouseX, mouseY)) {
onRemove.accept(friend);
return;
}
if (nickField.isFocused()) {
nickField.mouseClicked(mouseX, mouseY, button);
return;
}
if (button == 0 && isNickHovered(mouseX, mouseY)) {
nickField.setText(friend.getDisplayName());
nickField.setFocused(true);
}
}
@Override
public void mouseReleased(int mouseX, int mouseY, int button) {
nickField.mouseReleased(mouseX, mouseY, button);
}
public void onKey(int key, int action) {
if (nickField.isFocused()) nickField.onKey(key, action);
}
public boolean isCapturingInput() {
return nickField.isFocused();
}
private boolean isNickHovered(int mouseX, int mouseY) {
int textX = x + PADDING + HEAD_SIZE + 8;
int nickY = y + 6 + mc.font.lineHeight + 2;
return mouseX >= textX && mouseX < x + w - REMOVE_SIZE - 10
&& mouseY >= nickY && mouseY < nickY + 14;
}
private boolean isRemoveHovered(int mouseX, int mouseY) {
int rx = x + w - REMOVE_SIZE - 5;
int ry = y + 5;
return mouseX >= rx && mouseX < rx + REMOVE_SIZE && mouseY >= ry && mouseY < ry + REMOVE_SIZE;
}
@Override
public boolean isHovered(int mouseX, int mouseY) {
return mouseX >= x && mouseX < x + w && mouseY >= y && mouseY < y + h;
}
public Friend getFriend() {
return friend;
}
}
@@ -111,6 +111,11 @@ public class TextFieldWidget extends Widget {
}
public String getText() { return buffer.toString(); }
public void setText(String text) {
buffer.setLength(0);
buffer.append(text.length() > maxLength ? text.substring(0, maxLength) : text);
}
public void clear() { buffer.setLength(0); }
public boolean isFocused() { return focused; }
@@ -1,143 +0,0 @@
package me.retucio.sputnik.ui.widgets.panels;
import com.github.retucio.neutrino.EventListener;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.sputnik.FriendEvent;
import me.retucio.sputnik.event.sputnik.FriendPanelEvent;
import me.retucio.sputnik.friend.Friend;
import me.retucio.sputnik.friend.FriendManager;
import me.retucio.sputnik.ui.screen.ClickGui;
import me.retucio.sputnik.ui.widgets.buttons.FriendButton;
import me.retucio.sputnik.util.Colors;
import me.retucio.sputnik.util.I18nUtil;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.network.chat.Component;
import java.util.List;
public class FriendsPanel extends ExtendablePanel<FriendButton> {
private int offset;
public FriendsPanel(int x, int y, int w, int h) {
super(() -> I18nUtil.orElse("sputnik.ui.friends.title", "amigos"), x, y, w, h);
dragging = false;
Sputnik.EVENT_BUS.subscribe(this);
offset = h;
for (Friend friend : FriendManager.INSTANCE.getFriends()) {
buttons.add(new FriendButton(friend, this, offset));
offset += h;
}
}
@Override
protected void updateWidth() {
int maxWidth = mc.font.width(getTitle()) + mc.font.width(" +");
for (FriendButton button : buttons) {
int textWidth = mc.font.width(button.getFriend().getName());
maxWidth = Math.max(maxWidth, textWidth);
}
this.w = maxWidth + 22;
}
@Override
public void render(GuiGraphicsExtractor gui, int mouseX, int mouseY, float delta) {
updateWidth();
gui.fill(x, renderY, x + w, renderY + h, Colors.mainColor.getRGB());
gui.text(mc.font, Component.literal(getTitle()),
x + 8,
renderY + (h / 2) - (mc.font.lineHeight / 2),
-1, true);
drawExpandCollapse(gui, mouseX, mouseY);
List<FriendButton> visibleButtons = buttons.stream()
.filter(fb -> fb.getFriend().isSearchMatch())
.toList();
if (extended) {
totalHeight = visibleButtons.size() * h + 3;
gui.fill(x, renderY + h + 1, x + w, renderY + h + totalHeight, Colors.panelBgColor.getRGB());
int buttonY = renderY + h + 1;
for (FriendButton friendButton : visibleButtons) {
friendButton.setOffset(buttonY - renderY);
friendButton.render(gui, mouseX, mouseY, delta);
buttonY += h;
}
} else {
totalHeight = 0;
}
}
@Override
public void mouseClicked(int mouseX, int mouseY, int button) {
if (isHovered(mouseX, mouseY) && ClickGui.INSTANCE.trySelect(this)) {
if (button == 0) {
dragging = true;
dragX = mouseX - x;
dragY = mouseY - y;
} else if (button == 1) {
toggleExtended();
Sputnik.EVENT_BUS.post(new FriendPanelEvent.Extend());
}
}
if (!extended) return;
List<FriendButton> visibleFriendButtons = buttons.stream()
.filter(fb -> fb.getFriend().isSearchMatch())
.toList();
for (FriendButton friendButton : visibleFriendButtons) {
friendButton.mouseClicked(mouseX, mouseY, button);
}
}
@Override
public void mouseReleased(int mouseX, int mouseY, int button) {
ClickGui.INSTANCE.unselect(this);
if (button == 0 && dragging) dragging = false;
List<FriendButton> visibleFriendButtons = buttons.stream()
.filter(fb -> fb.getFriend().isSearchMatch())
.toList();
for (FriendButton friendButton : visibleFriendButtons) {
if (friendButton.isHovered(mouseX, mouseY))
friendButton.mouseReleased(mouseX, mouseY, button);
}
if (isHovered(mouseX, mouseY))
Sputnik.EVENT_BUS.post(new FriendPanelEvent.Move());
}
public void updatePosition(double mouseX, double mouseY) {
if (dragging) {
x = (int) (mouseX - dragX);
y = (int) (mouseY - dragY);
}
}
@EventListener
private void onAddFriend(FriendEvent.Add event) {
buttons.add(new FriendButton(event.getFriend(), this, offset));
}
@EventListener
private void onRemoveFriend(FriendEvent.Remove event) {
buttons.remove(getButtonOfFriend(event.getFriend()));
}
public FriendButton getButtonOfFriend(Friend friend) {
for (FriendButton button : buttons) {
if (button.getFriend().getUuid().equals(friend.getUuid()))
return button;
}
return null;
}
}
@@ -8,7 +8,6 @@ import me.retucio.sputnik.module.setting.settings.*;
import me.retucio.sputnik.ui.widgets.buttons.settings.*;
import me.retucio.sputnik.ui.screen.ClickGui;
import me.retucio.sputnik.ui.widgets.buttons.*;
import me.retucio.sputnik.ui.widgets.Panel;
import me.retucio.sputnik.util.Colors;
import me.retucio.sputnik.util.I18nUtil;
@@ -43,6 +42,7 @@ public class SettingsPanel extends CloseablePanel<SettingButton<? extends Settin
@Override
public void render(GuiGraphicsExtractor gui, int mouseX, int mouseY, float delta) {
updateWidth();
updateTotalHeight();
int centerX = x + w / 2;
int centerY = renderY + h / 2;
@@ -77,31 +77,8 @@ public class SettingsPanel extends CloseablePanel<SettingButton<? extends Settin
int descBoxTop = renderY + h + PADDING;
int descBoxBottom = descBoxTop + descHeight + PADDING * 2;
totalHeight = descHeight + 3 * PADDING;
int currentY;
// obtener valores de altura y tal
for (SettingGroup group : settingGroups) {
if (hasVisibleSettingsInGroup(group)) {
totalHeight += h + PADDING;
if (group.isExtended()) {
List<SettingButton<?>> groupButtons = getButtonsForGroup(group);
for (int j = 0; j < groupButtons.size(); j++) {
SettingButton<?> sb = groupButtons.get(j);
if (sb.getSetting().isVisible() && sb.getSetting().isSearchMatch()) {
if (j < groupButtons.size() - 1) {
totalHeight += (h - h / 4) + PADDING;
} else {
totalHeight += (h - h / 4);
}
}
}
totalHeight += PADDING;
}
}
}
// fondo del marco
gui.fill(x, descBoxTop - PADDING + 1, x + w, descBoxTop + totalHeight, Colors.panelBgColor.getRGB());
@@ -112,10 +89,9 @@ public class SettingsPanel extends CloseablePanel<SettingButton<? extends Settin
currentY = descBoxBottom + PADDING;
// dibujar botones y cabezales
for (int i = 0; i < settingGroups.size(); i++) {
SettingGroup group = settingGroups.get(i);
for (SettingGroup group : settingGroups) {
if (hasVisibleSettingsInGroup(group)) {
int groupHeaderColor = isGroupHeaderHovered(mouseX, mouseY, i)
int groupHeaderColor = isGroupHeaderHovered(mouseX, mouseY, group)
? Colors.buttonColor.brighter().getRGB()
: Colors.buttonColor.getRGB();
@@ -176,9 +152,8 @@ public class SettingsPanel extends CloseablePanel<SettingButton<? extends Settin
}
}
for (int i = 0; i < settingGroups.size(); i++) {
SettingGroup group = settingGroups.get(i);
if (hasVisibleSettingsInGroup(group) && isGroupHeaderHovered(mouseX, mouseY, i)) {
for (SettingGroup group : settingGroups) {
if (hasVisibleSettingsInGroup(group) && isGroupHeaderHovered(mouseX, mouseY, group)) {
group.setExtended(!group.isExtended());
updateVisibleButtonsForGroup(group);
return;
@@ -239,6 +214,36 @@ public class SettingsPanel extends CloseablePanel<SettingButton<? extends Settin
this.w = maxWidth + 30;
}
public void updateTotalHeight() {
List<String> descLines = wrapDescription(module.getDisplayDescription(), w - 2 * PADDING);
int descHeight = descLines.size() * mc.font.lineHeight + (descLines.size() - 1) * 2;
int height = descHeight + 3 * PADDING;
for (SettingGroup group : settingGroups) {
if (!hasVisibleSettingsInGroup(group)) continue;
height += h + PADDING;
if (group.isExtended()) {
List<SettingButton<?>> groupButtons = getButtonsForGroup(group);
for (int j = 0; j < groupButtons.size(); j++) {
SettingButton<?> sb = groupButtons.get(j);
if (sb.getSetting().isVisible() && sb.getSetting().isSearchMatch()) {
if (j < groupButtons.size() - 1) {
height += (h - h / 4) + PADDING;
} else {
height += (h - h / 4);
}
}
}
height += PADDING;
}
}
totalHeight = height;
}
public void updatePosition(double mouseX, double mouseY) {
if (dragging) {
x = (int) (mouseX - dragX);
@@ -246,44 +251,40 @@ public class SettingsPanel extends CloseablePanel<SettingButton<? extends Settin
}
}
public int getGroupHeaderY(int groupIndex) {
public int getGroupHeaderY(SettingGroup targetGroup) {
int currentY = renderY + h + PADDING;
List<String> descLines = wrapDescription(module.getDisplayDescription(), w - 2 * PADDING);
int descHeight = descLines.size() * mc.font.lineHeight + (descLines.size() - 1) * 2;
currentY += descHeight + 3 * PADDING; // descBoxBottom + padding
// iterar hasta llegar al grupo deseado
int currentIndex = 0;
for (SettingGroup group : settingGroups) {
if (hasVisibleSettingsInGroup(group)) {
if (currentIndex == groupIndex) {
return currentY;
}
if (!hasVisibleSettingsInGroup(group)) continue;
if (group == targetGroup) {
return currentY;
}
currentY += h + PADDING;
currentY += h + PADDING;
if (group.isExtended()) {
List<SettingButton<?>> groupButtons = getButtonsForGroup(group);
for (int j = 0; j < groupButtons.size(); j++) {
SettingButton<?> sb = groupButtons.get(j);
if (sb.getSetting().isVisible() && sb.getSetting().isSearchMatch()) {
if (j < groupButtons.size() - 1) {
currentY += (h - h / 4) + PADDING;
} else {
currentY += (h - h / 4);
}
if (group.isExtended()) {
List<SettingButton<?>> groupButtons = getButtonsForGroup(group);
for (int j = 0; j < groupButtons.size(); j++) {
SettingButton<?> sb = groupButtons.get(j);
if (sb.getSetting().isVisible() && sb.getSetting().isSearchMatch()) {
if (j < groupButtons.size() - 1) {
currentY += (h - h / 4) + PADDING;
} else {
currentY += (h - h / 4);
}
}
currentY += PADDING;
}
currentIndex++;
currentY += PADDING;
}
} // fallback
return currentY;
}
public boolean isGroupHeaderHovered(int mouseX, int mouseY, int groupIndex) {
int headerY = getGroupHeaderY(groupIndex);
public boolean isGroupHeaderHovered(int mouseX, int mouseY, SettingGroup group) {
int headerY = getGroupHeaderY(group);
return mouseX > x + PADDING && mouseX < x + w - PADDING &&
mouseY > headerY && mouseY < headerY + h;
@@ -1,102 +0,0 @@
package me.retucio.sputnik.ui.widgets.panels.settings;
import me.retucio.sputnik.config.ConfigManager;
import me.retucio.sputnik.friend.Friend;
import me.retucio.sputnik.friend.FriendManager;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.client.Friends;
import me.retucio.sputnik.module.setting.settings.StringSetting;
import me.retucio.sputnik.ui.screen.ClickGui;
import me.retucio.sputnik.ui.widgets.buttons.settings.TextButton;
import me.retucio.sputnik.ui.widgets.panels.SettingsPanel;
import me.retucio.sputnik.util.Colors;
import me.retucio.sputnik.util.I18nUtil;
import net.minecraft.client.gui.GuiGraphicsExtractor;
public class FriendSettingsPanel extends SettingsPanel {
private final Friend friend;
private final StringSetting nickname;
public final Module dummyModule;
private int removeButtonY;
public FriendSettingsPanel(Friend friend, int x, int y, int w, int h) {
super(ModuleManager.INSTANCE.getModuleByClass(Friends.class), x, y, w, h);
this.friend = friend;
dummyModule = new Module(friend.getName(),
I18nUtil.orElse("sputnik.ui.friend.manage", "gestiona a " + friend.getName(), friend.getName()),
Category.CLIENT) {
@Override public void onEnable() {}
@Override public void onDisable() {}
};
dummyModule.getSettings().forEach(s -> s.visibility(false));
dummyModule.shouldSaveSettings(false);
setModule(dummyModule);
// clave a mano: el módulo es un dummy con el nombre del jugador, así que la clave
// derivada dependería de él y no existiría nunca en el lang
nickname = new StringSetting("nombre", "con qué nombre guardar al amigo", friend.getName(), 40)
.translationKey("sputnik.setting.friend.nickname");
dummyModule.getSgGeneral().add(nickname);
nickname.onUpdate(name -> {
friend.setName(name);
ConfigManager.INSTANCE.getConfig().friends.put(friend.getUuid().toString(), name);
ConfigManager.INSTANCE.save();
});
buttons.clear();
addButton(new TextButton(nickname, this, h));
setSettingGroups(dummyModule.getSgs());
}
@Override
public void render(GuiGraphicsExtractor gui, int mx, int my, float delta) {
super.render(gui, mx, my, delta);
removeButtonY = renderY + h + totalHeight + PADDING;
int buttonH = h - h / 4;
gui.fill(x, removeButtonY, x + w, removeButtonY + buttonH + PADDING, Colors.panelBgColor.getRGB());
int color = isRemoveButtonHovered(mx, my)
? Colors.disabledToggleButtonColor.brighter().getRGB()
: Colors.disabledToggleButtonColor.getRGB();
gui.fill(x + PADDING, removeButtonY, x + w - PADDING, removeButtonY + buttonH, color);
String label = I18nUtil.orElse("sputnik.ui.friend.remove", "eliminar amigo");
gui.text(mc.font, label,
x + w / 2 - mc.font.width(label) / 2,
removeButtonY + (buttonH - mc.font.lineHeight) / 2,
-1, true);
}
@Override
public void mouseClicked(int mouseX, int mouseY, int button) {
super.mouseClicked(mouseX, mouseY, button);
if (button == 0 && isRemoveButtonHovered(mouseX, mouseY)) {
FriendManager.INSTANCE.remove(friend);
ClickGui.INSTANCE.closeSettingsPanel(dummyModule);
}
}
private boolean isRemoveButtonHovered(int mouseX, int mouseY) {
int buttonH = h - h / 4;
return mouseX > x + PADDING && mouseX < x + w - PADDING
&& mouseY > removeButtonY && mouseY < removeButtonY + buttonH;
}
public Friend getFriend() {
return friend;
}
}
@@ -1,6 +1,8 @@
package me.retucio.sputnik.util;
import me.retucio.sputnik.Sputnik;
import net.minecraft.core.component.DataComponents;
import net.minecraft.core.particles.ParticleType;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.ProtocolInfo;
@@ -16,12 +18,15 @@ import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.inventory.MenuType;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import org.jspecify.annotations.NonNull;
import java.awt.*;
import java.util.*;
import java.util.List;
import java.util.function.BooleanSupplier;
import java.util.function.Predicate;
import java.util.stream.Stream;
import static me.retucio.sputnik.util.Colors.*;
@@ -46,6 +51,9 @@ public class Lists {
public static final List<MenuType<?>> screenList = BuiltInRegistries.MENU.stream().toList();
public static Map<MenuType<?>, String> screenNames;
public static List<Item> foodList = new ArrayList<>();
public static Map<Item, String> foodNames = new HashMap<>();
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<>();
@@ -133,11 +141,17 @@ public class Lists {
@SafeVarargs
public static <T> Map<T, Boolean> allTrueExcept(List<T> options, T... exceptions) {
Map<T, Boolean> map = allFalse(options);
Map<T, Boolean> map = allTrue(options);
for (T exception : exceptions) map.replace(exception, false);
return map;
}
public static <T> Map<T, Boolean> allTrueExcept(List<T> options, Predicate<T> not) {
Map<T, Boolean> map = allTrue(options);
map.keySet().forEach(t -> { if (not.test(t)) map.put(t, false); });
return map;
}
public static <T> Map<T, Boolean> allFalse(List<T> options) {
Map<T, Boolean> map = new HashMap<>();
for (T option : options) map.put(option, false);
@@ -151,14 +165,21 @@ public class Lists {
return map;
}
public static <T> Map<T, Boolean> allFalseExcept(List<T> options, Predicate<T> not) {
Map<T, Boolean> map = allFalse(options);
map.keySet().forEach(t -> { if (not.test(t)) map.put(t, true); });
return map;
}
public static <T> Map<T, String> getMapOfLists(List<T> options, List<String> names) {
Map<T, String> result = new HashMap<>();
// no exceder los límites de ninguna de las dos listas
int size = Math.min(options.size(), names.size());
for (int i = 0; i < size; i++)
for (int i = 0; i < size; i++) {
result.put(options.get(i), names.get(i));
}
return result;
}
@@ -377,7 +377,91 @@
"sputnik.module.autofish.rodbreaking": "the rod is about to break",
"sputnik.module.autoherramienta.desc": "automatically switches to the right tool",
"sputnik.module.autoherramienta.name": "auto tool",
"sputnik.module.autominado.name": "auto mine",
"sputnik.module.autominado.desc": "select blocks to mine them automatically",
"sputnik.module.autominado.blacklisted": "that block is blacklisted!",
"sputnik.module.autominado.cornerselected": "corner selected",
"sputnik.module.autominado.boxselected": "box selected",
"sputnik.module.autominado.floodfilled": "flood filled",
"sputnik.module.autominado.pickbreaking": "pickaxe's about to break!",
"sputnik.setting.autominado.general.mododeseleccion.name": "selection mode",
"sputnik.setting.autominado.general.mododeseleccion.desc": "in which way to select blocks",
"sputnik.enum.module.modules.world.automine.selectionmode.individual": "individual",
"sputnik.enum.module.modules.world.automine.selectionmode.box": "box",
"sputnik.enum.module.modules.world.automine.selectionmode.flood_fill": "flood fill",
"sputnik.setting.autominado.general.limitedebloques.name": "block limit",
"sputnik.setting.autominado.general.limitedebloques.desc": "max number of blocks to select",
"sputnik.setting.autominado.general.delay.name": "delay",
"sputnik.setting.autominado.general.delay.desc": "delay between attempts to mine",
"sputnik.setting.autominado.general.cancelarfueradealcance.name": "cancel out of reach",
"sputnik.setting.autominado.general.cancelarfueradealcance.desc": "do not try to mine blocks that are out of reach",
"sputnik.setting.autominado.general.autoherramienta.name": "autotool",
"sputnik.setting.autominado.general.autoherramienta.desc": "select the best tool automatically",
"sputnik.setting.autominado.general.noromperpico.name": "don't break",
"sputnik.setting.autominado.general.noromperpico.desc": "avoid breaking the current tool",
"sputnik.setting.autominado.general.rotar.name": "rotate",
"sputnik.setting.autominado.general.rotar.desc": "whether to rotate to face the block being mined, and in which way to do so",
"sputnik.enum.module.modules.world.automine.rotatemode.client": "client-sided",
"sputnik.enum.module.modules.world.automine.rotatemode.server": "server-sided",
"sputnik.enum.module.modules.world.automine.rotatemode.both": "client- and server-sided",
"sputnik.enum.module.modules.world.automine.rotatemode.none": "none",
"sputnik.setting.autominado.general.limitarpaquetes.name": "limit packets",
"sputnik.setting.autominado.general.limitarpaquetes.desc": "max number of packets to send per second (0 to disable)",
"sputnik.setting.autominado.bloques.listanegra.name": "blacklist",
"sputnik.setting.autominado.bloques.listanegra.desc": "blocks NOT to mine",
"sputnik.setting.autominado.renderizado.renderizar.name": "render",
"sputnik.setting.autominado.renderizado.renderizar.desc": "whether to render outlines of blocks being mined, or in the queue",
"sputnik.setting.autominado.renderizado.color.name": "color",
"sputnik.setting.autominado.renderizado.color.desc": "color of blocks being mined",
"sputnik.setting.autominado.renderizado.colordeseleccionpendiente.name": "color of pending selection",
"sputnik.setting.autominado.renderizado.colordeseleccionpendiente.desc": "color of the first corner in box mode",
"sputnik.setting.autominado.renderizado.grosor.name": "thickness",
"sputnik.setting.autominado.renderizado.grosor.desc": "line thickness",
"sputnik.group.autominado.bloques": "blocks",
"sputnik.group.autominado.renderizado": "render",
"sputnik.module.estiloso.name": "stylish",
"sputnik.module.estiloso.desc": "be stylish",
"sputnik.setting.estiloso.general.truco.name": "trick",
"sputnik.setting.estiloso.general.truco.desc": "which trick to do",
"sputnik.enum.module.modules.render.stylish.tricktype.spin": "spin",
"sputnik.enum.module.modules.render.stylish.tricktype.flip": "flip",
"sputnik.enum.module.modules.render.stylish.tricktype.roll": "roll",
"sputnik.enum.module.modules.render.stylish.tricktype.twirl": "twirl",
"sputnik.enum.module.modules.render.stylish.tricktype.wave": "wave",
"sputnik.enum.module.modules.render.stylish.tricktype.pop": "pop",
"sputnik.enum.module.modules.render.stylish.tricktype.throw_catch": "throw & catch",
"sputnik.enum.module.modules.render.stylish.tricktype.random": "random",
"sputnik.setting.estiloso.general.combo.name": "combo",
"sputnik.setting.estiloso.general.combo.desc": "concatenate tricks to do a combo",
"sputnik.setting.estiloso.general.trucosporcombo.name": "combo tricks",
"sputnik.setting.estiloso.general.trucosporcombo.desc": "how many tricks to do in a combo",
"sputnik.setting.estiloso.general.mano.name": "hand",
"sputnik.setting.estiloso.general.mano.desc": "in which hand(s) to do it",
"sputnik.setting.estiloso.general.tecla.name": "key",
"sputnik.setting.estiloso.general.tecla.desc": "key to use to do the thing",
"sputnik.setting.estiloso.general.velocidad.name": "speed",
"sputnik.setting.estiloso.general.velocidad.desc": "how quickly to do it",
"sputnik.setting.estiloso.general.vueltas.name": "times",
"sputnik.setting.estiloso.general.vueltas.desc": "how many times to do it",
"sputnik.setting.estiloso.general.direccion.name": "direction",
"sputnik.setting.estiloso.general.direccion.desc": "in which direction to do it",
"sputnik.enum.module.modules.render.stylish.hand.main_hand": "main hand",
"sputnik.enum.module.modules.render.stylish.hand.off_hand": "off hand",
"sputnik.setting.estiloso.general.suavizado.name": "easing",
"sputnik.setting.estiloso.general.suavizado.desc": "use non-linear velocity instead of linear",
"sputnik.setting.estiloso.general.cooldown.name": "cooldown",
"sputnik.setting.estiloso.general.cooldown.desc": "cooldown between tricks",
"sputnik.enum.module.modules.render.stylish.rotatedirection.clockwise": "clockwise",
"sputnik.enum.module.modules.render.stylish.rotatedirection.counter_clockwise": "counter-clockwise",
"sputnik.setting.hud.elementos.velocidad.name": "velocity",
"sputnik.setting.hud.elementos.velocidad.desc": "unit to use when showing current speed",
"sputnik.module.autopechera.desc": "switches to a chestplate before hitting with the mace",
"sputnik.setting.nametags.general.distancia.name": "render distance",
"sputnik.setting.nametags.general.distancia.desc": "max distance to render nametags",
"sputnik.setting.putogordo.general.cuandoparar.name": "when to stop",
"sputnik.setting.putogordo.general.cuandoparar.desc": "how many food points you need to have to stop eating",
"sputnik.setting.putogordo.general.listanegra.name": "blacklist",
"sputnik.setting.putogordo.general.listanegra.desc": "food items NOT to eat",
"sputnik.module.autopechera.name": "auto chestplate",
"sputnik.module.autopesca.desc": "fishes for you",
"sputnik.module.autopesca.name": "auto fish",
@@ -1581,5 +1665,10 @@
"sputnik.version.info.dev": "mod in a development state: v%s",
"sputnik.version.info.uptodate": "the mod is up to date: v%s",
"sputnik.version.warn.check": "could not check whether the mod is up to date: %s",
"sputnik.version.warn.metadata": "could not build gradle.properties from the metadata"
"sputnik.version.warn.metadata": "could not build gradle.properties from the metadata",
"sputnik.ui.friends.nickplaceholder": "nickname...",
"sputnik.ui.friends.befriendedon": "friends since %s",
"sputnik.ui.friends.removed": "you now hate %s",
"sputnik.ui.friends.empty": "you don't have any friends loser",
"sputnik.ui.friends.uuid": "UUID: %s"
}
@@ -377,7 +377,91 @@
"sputnik.module.autofish.rodbreaking": "caña a punto de romperse",
"sputnik.module.autoherramienta.desc": "cambia a la herramienta adecuada automáticamente",
"sputnik.module.autoherramienta.name": "auto herramienta",
"sputnik.module.autominado.name": "auto minado",
"sputnik.module.autominado.desc": "selecciona un área o bloques individuales para minarlos automáticamente",
"sputnik.module.autominado.blacklisted": "ese bloque está en la lista negra!",
"sputnik.module.autominado.cornerselected": "esquina seleccionada",
"sputnik.module.autominado.boxselected": "área seleccionada",
"sputnik.module.autominado.floodfilled": "inundación seleccionada",
"sputnik.module.autominado.pickbreaking": "el pico está por romperse!",
"sputnik.setting.autominado.general.mododeseleccion.name": "modo de selección",
"sputnik.setting.autominado.general.mododeseleccion.desc": "cómo seleccionar los bloques a minar",
"sputnik.enum.module.modules.world.automine.selectionmode.individual": "individual",
"sputnik.enum.module.modules.world.automine.selectionmode.box": "caja",
"sputnik.enum.module.modules.world.automine.selectionmode.flood_fill": "inundación",
"sputnik.setting.autominado.general.limitedebloques.name": "límite de bloques",
"sputnik.setting.autominado.general.limitedebloques.desc": "cantidad máxima de bloques a seleccionar de una vez (caja / flood)",
"sputnik.setting.autominado.general.delay.name": "delay",
"sputnik.setting.autominado.general.delay.desc": "delay entre reintentos de minado",
"sputnik.setting.autominado.general.cancelarfueradealcance.name": "cancelar fuera de alcance",
"sputnik.setting.autominado.general.cancelarfueradealcance.desc": "cancelar aquellos paquetes que intenten romper bloques fuera del alcance del jugador",
"sputnik.setting.autominado.general.autoherramienta.name": "auto herramienta",
"sputnik.setting.autominado.general.autoherramienta.desc": "cambiar automáticamente a la herramienta más rápida antes de minar cada bloque",
"sputnik.setting.autominado.general.noromperpico.name": "no romper pico",
"sputnik.setting.autominado.general.noromperpico.desc": "evita romper la herramienta seleccionada",
"sputnik.setting.autominado.general.rotar.name": "rotar",
"sputnik.setting.autominado.general.rotar.desc": "rotar al minar bloques mediante el módulo",
"sputnik.enum.module.modules.world.automine.rotatemode.client": "cámara",
"sputnik.enum.module.modules.world.automine.rotatemode.server": "mediante paquetes",
"sputnik.enum.module.modules.world.automine.rotatemode.both": "ambos",
"sputnik.enum.module.modules.world.automine.rotatemode.none": "no",
"sputnik.setting.autominado.general.limitarpaquetes.name": "limitar paquetes",
"sputnik.setting.autominado.general.limitarpaquetes.desc": "limita la cantidad de paquetes enviados en un segundo (0 para desactivar)",
"sputnik.setting.autominado.bloques.listanegra.name": "lista negra",
"sputnik.setting.autominado.bloques.listanegra.desc": "bloques a excluir de la selección",
"sputnik.setting.autominado.renderizado.renderizar.name": "renderizar",
"sputnik.setting.autominado.renderizado.renderizar.desc": "renderizar un contorno alrededor de los bloques que están siendo minados",
"sputnik.setting.autominado.renderizado.color.name": "color",
"sputnik.setting.autominado.renderizado.color.desc": "color del contorno renderizado",
"sputnik.setting.autominado.renderizado.colordeseleccionpendiente.name": "color de selección pendiente",
"sputnik.setting.autominado.renderizado.colordeseleccionpendiente.desc": "color del contorno de la primera esquina, en modo caja, mientras se espera la segunda",
"sputnik.setting.autominado.renderizado.grosor.name": "grosor",
"sputnik.setting.autominado.renderizado.grosor.desc": "grosor de las líneas del contorno",
"sputnik.group.autominado.bloques": "bloques",
"sputnik.group.autominado.renderizado": "renderizado",
"sputnik.module.estiloso.name": "estiloso",
"sputnik.module.estiloso.desc": "haz truquitos con items en las manos",
"sputnik.setting.estiloso.general.truco.name": "truco",
"sputnik.setting.estiloso.general.truco.desc": "qué truco hacer al pulsar la tecla",
"sputnik.enum.module.modules.render.stylish.tricktype.spin": "giro",
"sputnik.enum.module.modules.render.stylish.tricktype.flip": "voltereta",
"sputnik.enum.module.modules.render.stylish.tricktype.roll": "balanceo",
"sputnik.enum.module.modules.render.stylish.tricktype.twirl": "giro doble",
"sputnik.enum.module.modules.render.stylish.tricktype.wave": "saludo",
"sputnik.enum.module.modules.render.stylish.tricktype.pop": "pulso",
"sputnik.enum.module.modules.render.stylish.tricktype.throw_catch": "lanzar y coger",
"sputnik.enum.module.modules.render.stylish.tricktype.random": "aleatorio",
"sputnik.setting.estiloso.general.combo.name": "combo",
"sputnik.setting.estiloso.general.combo.desc": "encadena varios trucos distintos en una sola pulsación",
"sputnik.setting.estiloso.general.trucosporcombo.name": "combo tricks",
"sputnik.setting.estiloso.general.trucosporcombo.desc": "cuántos trucos encadenar si el combo está activado",
"sputnik.setting.estiloso.general.mano.name": "mano",
"sputnik.setting.estiloso.general.mano.desc": "en qué mano(s) hacerlo",
"sputnik.setting.estiloso.general.tecla.name": "tecla",
"sputnik.setting.estiloso.general.tecla.desc": "tecla a pulsar para hacer el truco",
"sputnik.setting.estiloso.general.velocidad.name": "velocidad",
"sputnik.setting.estiloso.general.velocidad.desc": "velocidad de giro (grados/seg)",
"sputnik.setting.estiloso.general.vueltas.name": "vueltas",
"sputnik.setting.estiloso.general.vueltas.desc": "cuantas vueltas completas da",
"sputnik.setting.estiloso.general.direccion.name": "dirección",
"sputnik.setting.estiloso.general.direccion.desc": "dirección a rotar el ítem",
"sputnik.enum.module.modules.render.stylish.hand.main_hand": "mano principal",
"sputnik.enum.module.modules.render.stylish.hand.off_hand": "mano secundaria",
"sputnik.setting.estiloso.general.suavizado.name": "suavizado",
"sputnik.setting.estiloso.general.suavizado.desc": "usa una curva de aceleración/desaceleración en vez de velocidad lineal",
"sputnik.setting.estiloso.general.cooldown.name": "cooldown",
"sputnik.setting.estiloso.general.cooldown.desc": "tiempo mínimo en ms entre activaciones",
"sputnik.enum.module.modules.render.stylish.rotatedirection.clockwise": "sentido horario",
"sputnik.enum.module.modules.render.stylish.rotatedirection.counter_clockwise": "sentido antihorario",
"sputnik.setting.hud.elementos.velocidad.name": "velocidad",
"sputnik.setting.hud.elementos.velocidad.desc": "unidad a usar para la velocidad",
"sputnik.module.autopechera.desc": "cambia a pechera antes de pegar con el mazo",
"sputnik.setting.nametags.general.distancia.name": "distancia",
"sputnik.setting.nametags.general.distancia.desc": "distancia máxima para renderizar nametags",
"sputnik.setting.putogordo.general.cuandoparar.name": "cuándo parar",
"sputnik.setting.putogordo.general.cuandoparar.desc": "cuántos puntos de comida hace falta tener para parar de comer",
"sputnik.setting.putogordo.general.listanegra.name": "lista negra",
"sputnik.setting.putogordo.general.listanegra.desc": "alimentos a NO comer",
"sputnik.module.autopechera.name": "autopechera",
"sputnik.module.autopesca.desc": "pesca por ti",
"sputnik.module.autopesca.name": "auto pesca",
@@ -1581,5 +1665,10 @@
"sputnik.version.info.dev": "mod en estado de desarrollo: v%s",
"sputnik.version.info.uptodate": "el mod está al día: v%s",
"sputnik.version.warn.check": "no se pudo comprobar si el mod está actualizado: %s",
"sputnik.version.warn.metadata": "no se pudo construir gradle.properties desde la metadata"
"sputnik.version.warn.metadata": "no se pudo construir gradle.properties desde la metadata",
"sputnik.ui.friends.nickplaceholder": "apodo...",
"sputnik.ui.friends.befriendedon": "amigos desde %s",
"sputnik.ui.friends.removed": "%s ya no es tu amigo",
"sputnik.ui.friends.empty": "no tienes amigos jajsjsjs",
"sputnik.ui.friends.uuid": "UUID: %s"
}
+1
View File
@@ -18,6 +18,7 @@
"mixins.item.ItemMixin",
"mixins.item.ItemStackMixin",
"mixins.item.TridentItemMixin",
"mixins.misc.ReferenceMixin",
"mixins.misc.StringUtilMixin",
"mixins.misc.Vec3Mixin",
"mixins.network.ClientIntentionPacketMixin",