use of de.keyle.knbt.TagDouble in project MyPet by xXKeyleXx.
the class Pickup method save.
@Override
public void save(TagCompound tagCompound) {
tagCompound.getCompoundData().put("addset_range", new TagString(addRangeRadioButton.isSelected() ? "add" : "set"));
tagCompound.getCompoundData().put("range", new TagDouble(Double.parseDouble(rangeInput.getText())));
tagCompound.getCompoundData().put("exp_pickup", new TagByte(expPickupCheckBox.isSelected()));
}
use of de.keyle.knbt.TagDouble in project MyPet by xXKeyleXx.
the class Ranged method load.
@Override
public void load(TagCompound TagCompound) {
if (!TagCompound.getCompoundData().containsKey("addset_damage") || TagCompound.getAs("addset_damage", TagString.class).getStringData().equals("add")) {
addDamageRadioButton.setSelected(true);
} else {
setDamageRadioButton.setSelected(true);
}
if (TagCompound.getCompoundData().containsKey("damage")) {
TagCompound.getCompoundData().put("damage_double", new TagDouble(TagCompound.getAs("damage", TagInt.class).getIntData()));
TagCompound.getCompoundData().remove("damage");
}
if (TagCompound.getCompoundData().containsKey("damage_double")) {
damageInput.setText("" + TagCompound.getAs("damage_double", TagDouble.class).getDoubleData());
}
if (TagCompound.getCompoundData().containsKey("projectile")) {
String projectileName = TagCompound.getAs("projectile", TagString.class).getStringData();
for (int i = 0; i < projectileComboBox.getItemCount(); i++) {
if (((String) projectileComboBox.getItemAt(i)).replace(" ", "").equalsIgnoreCase(projectileName)) {
projectileComboBox.setSelectedIndex(i);
break;
}
}
}
if (!TagCompound.getCompoundData().containsKey("addset_rateoffire") || TagCompound.getAs("addset_rateoffire", TagString.class).getStringData().equals("add")) {
addRateOfFireRadioButton.setSelected(true);
} else {
setRateOfFireRadioButton.setSelected(true);
}
if (TagCompound.getCompoundData().containsKey("rateoffire")) {
rateOfFireInput.setText("" + TagCompound.getAs("rateoffire", TagInt.class).getIntData());
}
}
Aggregations