Search in sources :

Example 11 with TagString

use of de.keyle.knbt.TagString in project MyPet by xXKeyleXx.

the class Stomp method save.

@Override
public void save(TagCompound tagCompound) {
    tagCompound.getCompoundData().put("addset_chance", new TagString(addChanceRadioButton.isSelected() ? "add" : "set"));
    tagCompound.getCompoundData().put("chance", new TagInt(Integer.parseInt(chanceInput.getText())));
    tagCompound.getCompoundData().put("addset_damage", new TagString(addDamageRadioButton.isSelected() ? "add" : "set"));
    tagCompound.getCompoundData().put("damage", new TagDouble(Double.parseDouble(damageInput.getText())));
}
Also used : TagInt(de.keyle.knbt.TagInt) TagString(de.keyle.knbt.TagString) TagDouble(de.keyle.knbt.TagDouble)

Example 12 with TagString

use of de.keyle.knbt.TagString in project MyPet by xXKeyleXx.

the class Behavior method save.

public TagCompound save() {
    TagCompound nbtTagCompound = new TagCompound();
    nbtTagCompound.getCompoundData().put("Mode", new TagString(behavior.name()));
    return nbtTagCompound;
}
Also used : TagString(de.keyle.knbt.TagString) TagCompound(de.keyle.knbt.TagCompound)

Example 13 with TagString

use of de.keyle.knbt.TagString in project MyPet by xXKeyleXx.

the class SkullMeta method applyTo.

public void applyTo(TagCompound tag) {
    if (hasOwner()) {
        TagCompound ownerTag = new TagCompound();
        ownerTag.put("Name", new TagString(getOwner()));
        if (hasTexture()) {
            TagCompound propertiesTag = new TagCompound();
            TagList textureList = new TagList();
            TagCompound textureTag = new TagCompound();
            JSONObject jsonObject = new JSONObject();
            JSONObject texturesObject = new JSONObject();
            JSONObject skinObject = new JSONObject();
            jsonObject.put("textures", texturesObject);
            texturesObject.put("SKIN", skinObject);
            skinObject.put("url", getTexture());
            String base64 = BaseEncoding.base64Url().encode(jsonObject.toJSONString().getBytes());
            textureTag.put("Value", new TagString(base64));
            textureList.addTag(textureTag);
            propertiesTag.put("textures", textureList);
            ownerTag.put("Properties", propertiesTag);
        }
        tag.put("SkullOwner", ownerTag);
    }
}
Also used : JSONObject(org.json.simple.JSONObject) TagString(de.keyle.knbt.TagString) TagList(de.keyle.knbt.TagList) TagString(de.keyle.knbt.TagString) TagCompound(de.keyle.knbt.TagCompound)

Example 14 with TagString

use of de.keyle.knbt.TagString in project MyPet by xXKeyleXx.

the class Damage method save.

@Override
public void save(TagCompound tagCompound) {
    tagCompound.getCompoundData().put("addset_damage", new TagString(addDamageRadioButton.isSelected() ? "add" : "set"));
    tagCompound.getCompoundData().put("damage_double", new TagDouble(Double.parseDouble(damageInput.getText())));
}
Also used : TagString(de.keyle.knbt.TagString) TagDouble(de.keyle.knbt.TagDouble)

Example 15 with TagString

use of de.keyle.knbt.TagString in project MyPet by xXKeyleXx.

the class Knockback method save.

@Override
public void save(TagCompound tagCompound) {
    tagCompound.getCompoundData().put("addset_chance", new TagString(addChanceRadioButton.isSelected() ? "add" : "set"));
    tagCompound.getCompoundData().put("chance", new TagInt(Integer.parseInt(chanceInput.getText())));
}
Also used : TagInt(de.keyle.knbt.TagInt) TagString(de.keyle.knbt.TagString)

Aggregations

TagString (de.keyle.knbt.TagString)20 TagInt (de.keyle.knbt.TagInt)10 TagCompound (de.keyle.knbt.TagCompound)7 TagDouble (de.keyle.knbt.TagDouble)7 TagByte (de.keyle.knbt.TagByte)1 TagList (de.keyle.knbt.TagList)1 JSONObject (org.json.simple.JSONObject)1