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