Ejemplo n.º 1
0
 public void save() {
   if (hasUpdated) {
     hasUpdated = false;
     String sql =
         "UPDATE "
             + DeityNPCMain.getNPCTableName()
             + " SET name = ?, name_color = ?, x_coord = ?, y_coord = ?, z_coord = ?, yaw = ?, pitch = ?, held_item_row_id = ?, armor_helm_row_id = ?, armor_chest_row_id = ?, armor_legging_row_id = ?, armor_boot_row_id = ? WHERE id = ?;";
     DeityAPI.getAPI()
         .getDataAPI()
         .getMySQL()
         .write(
             sql,
             name,
             (nameColor.getChar() + "").toUpperCase(),
             location.getBlockX(),
             location.getBlockY(),
             location.getBlockZ(),
             location.getYaw(),
             location.getPitch(),
             heldItem.getId(),
             armorHelm.getId(),
             armorChest.getId(),
             armorLegging.getId(),
             armorBoot.getId(),
             databaseId);
   }
 }
Ejemplo n.º 2
0
 public void remove() {
   DeityAPI.getAPI()
       .getDataAPI()
       .getMySQL()
       .write("DELETE FROM " + DeityNPCMain.getNPCTableName() + " WHERE id = ?;", databaseId);
 }