All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.lang.TranslationContainer Maven / Gradle / Ivy

Go to download

A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.

There is a newer version: 1.6.0.1-PN
Show newest version
package cn.nukkit.lang;

/**
 * @author MagicDroidX (Nukkit Project)
 */
public class TranslationContainer extends TextContainer implements Cloneable {

    protected String[] params;

    public TranslationContainer(String text) {
        this(text, new String[]{});
    }

    public TranslationContainer(String text, String params) {
        super(text);
        this.setParameters(new String[]{params});
    }

    public TranslationContainer(String text, String... params) {
        super(text);
        this.setParameters(params);
    }

    public String[] getParameters() {
        return params;
    }

    public void setParameters(String[] params) {
        this.params = params;
    }

    public String getParameter(int i) {
        return (i >= 0 && i < this.params.length) ? this.params[i] : null;
    }

    public void setParameter(int i, String str) {
        if (i >= 0 && i < this.params.length) {
            this.params[i] = str;
        }
    }

    @Override
    public TranslationContainer clone() {
        return new TranslationContainer(this.text, this.params.clone());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy