Skip to content

API e Integración de Addons

Este documento describe cómo los desarrolladores pueden interactuar con Velocímetro o utilizar su patrón spy-wrapper.


📊 Cuadro informativo de la API

PropertySpecification
Public Constants Classnet.vanillaoutsider.speedometer.SpeedometerMod
Speedometer IdentifierIdentifier.withDefaultNamespace("speedometer")
Identificador de velocidad vanillaIdentifier.withDefaultNamespace("player_speed")
Custom Entry Interfacenet.minecraft.client.gui.components.debug.DebugScreenEntry

💡 Spy-Wrapper Pattern Reference

java
public class DebugEntryPlayerSpeedWrapper implements DebugScreenEntry {
    private final DebugScreenEntry parent;

    public DebugEntryPlayerSpeedWrapper(DebugScreenEntry parent) {
        this.parent = parent;
    }

    @Override
    public void display(DebugScreenDisplayer displayer, Level level, LevelChunk clientChunk, LevelChunk serverChunk) {
        DebugScreenDisplayer spyDisplayer = new DebugScreenDisplayer() {
            @Override
            public void addLine(String line) {
                displayer.addLine(modifyLine(line));
            }
            
            private String modifyLine(String original) {
                if (original != null && original.startsWith("Speed: ")) {
                    return original + ", custom suffix";
                }
                return original;
            }
        };
        parent.display(spyDisplayer, level, clientChunk, serverChunk);
    }
}

🔗 Páginas relacionadas

Official documentation & web portal for Dasik Igaijinn mods.