Skip to content

zh_tw API and Addon Integration

Rifa edited this page Aug 25, 2026 · 1 revision

API 與附加模組整合

本文件概述了開發者如何與 速度計 (Speedometer) 互動或參考其註冊模式來建立自訂 F3 除錯條目。


📊 API Summary Infobox

Property Specification
Public Constants Class net.vanillaoutsider.speedometer.SpeedometerMod
Speedometer Identifier Identifier.withDefaultNamespace("speedometer")
Vanilla Player Speed Identifier Identifier.withDefaultNamespace("player_speed")
Custom Entry Interface net.minecraft.client.gui.components.debug.DebugScreenEntry

💡 Spy-Wrapper Pattern Reference

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);
    }
}

🔗 相關頁面

📖 Speedometer Wiki

🌐 Languages


🇺🇸 English
🇨🇳 简体中文 (Simplified Chinese)
🇭🇰 繁體中文 (Traditional Chinese)
🇷🇺 Русский (Russian)
🇪🇸 Español (Spanish)
🇩🇪 Deutsch (German)
🇫🇷 Français (French)
🇧🇷 Português (Portuguese)
🇯🇵 日本語 (Japanese)
🇮🇩 Bahasa Indonesia (Indonesian)
🇰🇷 한국어 (Korean)

🔗 External Links

Clone this wiki locally