Search in sources :

Example 1 with TagDouble

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

the class Heal method load.

@Override
public void load(TagCompound TagCompound) {
    if (!TagCompound.getCompoundData().containsKey("addset_hp") || TagCompound.getAs("addset_hp", TagString.class).getStringData().equals("add")) {
        addHealthRadioButton.setSelected(true);
    } else {
        setHealthRadioButton.setSelected(true);
    }
    if (TagCompound.getCompoundData().containsKey("hp")) {
        TagCompound.getCompoundData().put("hp_double", new TagDouble(TagCompound.getAs("hp", TagDouble.class).getDoubleData()));
        TagCompound.getCompoundData().remove("hp");
    }
    if (TagCompound.getCompoundData().containsKey("hp_double")) {
        healthInput.setText("" + TagCompound.getAs("hp_double", TagDouble.class).getDoubleData());
    }
    if (!TagCompound.getCompoundData().containsKey("addset_time") || TagCompound.getAs("addset_time", TagString.class).getStringData().equals("add")) {
        decreaseTimeRadioButton.setSelected(true);
    } else {
        setTimeRadioButton.setSelected(true);
    }
    if (TagCompound.getCompoundData().containsKey("time")) {
        timeInput.setText("" + TagCompound.getAs("time", TagInt.class).getIntData());
    }
}
Also used : TagInt(de.keyle.knbt.TagInt) TagString(de.keyle.knbt.TagString) TagDouble(de.keyle.knbt.TagDouble)

Example 2 with TagDouble

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

the class Heal method save.

@Override
public void save(TagCompound tagCompound) {
    tagCompound.getCompoundData().put("addset_time", new TagString(decreaseTimeRadioButton.isSelected() ? "add" : "set"));
    tagCompound.getCompoundData().put("time", new TagInt(Integer.parseInt(timeInput.getText())));
    tagCompound.getCompoundData().put("addset_hp", new TagString(addHealthRadioButton.isSelected() ? "add" : "set"));
    tagCompound.getCompoundData().put("hp_double", new TagDouble(Double.parseDouble(healthInput.getText())));
}
Also used : TagInt(de.keyle.knbt.TagInt) TagString(de.keyle.knbt.TagString) TagDouble(de.keyle.knbt.TagDouble)

Example 3 with TagDouble

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

the class Life method save.

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

Example 4 with TagDouble

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

the class Life method load.

@Override
public void load(TagCompound TagCompound) {
    if (!TagCompound.getCompoundData().containsKey("addset_hp") || TagCompound.getAs("addset_hp", TagString.class).getStringData().equals("add")) {
        addHealthRadioButton.setSelected(true);
    } else {
        setHealthRadioButton.setSelected(true);
    }
    if (TagCompound.getCompoundData().containsKey("hp")) {
        TagCompound.getCompoundData().put("hp_double", new TagDouble(TagCompound.getAs("hp", TagInt.class).getIntData()));
        TagCompound.getCompoundData().remove("hp");
    }
    if (TagCompound.getCompoundData().containsKey("hp_double")) {
        healthInput.setText("" + TagCompound.getAs("hp_double", TagDouble.class).getDoubleData());
    }
}
Also used : TagInt(de.keyle.knbt.TagInt) TagString(de.keyle.knbt.TagString) TagDouble(de.keyle.knbt.TagDouble)

Example 5 with TagDouble

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

the class Lightning 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_double", new TagDouble(Double.parseDouble(damageInput.getText())));
}
Also used : TagInt(de.keyle.knbt.TagInt) TagString(de.keyle.knbt.TagString) TagDouble(de.keyle.knbt.TagDouble)

Aggregations

TagDouble (de.keyle.knbt.TagDouble)17 TagString (de.keyle.knbt.TagString)17 TagInt (de.keyle.knbt.TagInt)14 DamageInfo (de.Keyle.MyPet.api.skill.skills.DamageInfo)1 HealInfo (de.Keyle.MyPet.api.skill.skills.HealInfo)1 LifeInfo (de.Keyle.MyPet.api.skill.skills.LifeInfo)1 LightningInfo (de.Keyle.MyPet.api.skill.skills.LightningInfo)1 RangedInfo (de.Keyle.MyPet.api.skill.skills.RangedInfo)1 TagByte (de.keyle.knbt.TagByte)1